Commit b2fdc672 authored by Mark Olesen's avatar Mark Olesen
Browse files

ENH: improve verbosity controls for topoSetSource

parent 02881f62
......@@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2020 OpenCFD Ltd.
Copyright (C) 2018-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -45,6 +45,16 @@ Foam::topoSetCellSource::topoSetCellSource(const polyMesh& mesh)
{}
Foam::topoSetCellSource::topoSetCellSource
(
const polyMesh& mesh,
const dictionary& dict
)
:
topoSetSource(mesh, dict)
{}
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::topoSetCellSource>
......
......@@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2020 OpenCFD Ltd.
Copyright (C) 2018-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -89,9 +89,13 @@ public:
// Constructors
//- Construct from components
//- Construct from mesh
explicit topoSetCellSource(const polyMesh& mesh);
//- Construct from mesh, use "verbose" entry if present
topoSetCellSource(const polyMesh& mesh, const dictionary& dict);
//- Clone (disallowed)
autoPtr<topoSetCellSource> clone() const
{
......
......@@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -45,6 +45,16 @@ Foam::topoSetCellZoneSource::topoSetCellZoneSource(const polyMesh& mesh)
{}
Foam::topoSetCellZoneSource::topoSetCellZoneSource
(
const polyMesh& mesh,
const dictionary& dict
)
:
topoSetSource(mesh, dict)
{}
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::topoSetCellZoneSource>
......
......@@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -92,9 +92,13 @@ public:
// Constructors
//- Construct from components
//- Construct from mesh
explicit topoSetCellZoneSource(const polyMesh& mesh);
//- Construct from mesh, use "verbose" entry if present
topoSetCellZoneSource(const polyMesh& mesh, const dictionary& dict);
//- Clone (disallowed)
autoPtr<topoSetCellZoneSource> clone() const
{
......
......@@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2020 OpenCFD Ltd.
Copyright (C) 2018-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -45,6 +45,16 @@ Foam::topoSetFaceSource::topoSetFaceSource(const polyMesh& mesh)
{}
Foam::topoSetFaceSource::topoSetFaceSource
(
const polyMesh& mesh,
const dictionary& dict
)
:
topoSetSource(mesh, dict)
{}
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::topoSetFaceSource>
......
......@@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2020 OpenCFD Ltd.
Copyright (C) 2018-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -89,9 +89,13 @@ public:
// Constructors
//- Construct from components
//- Construct from mesh
explicit topoSetFaceSource(const polyMesh& mesh);
//- Construct from mesh, use "verbose" entry if present
topoSetFaceSource(const polyMesh& mesh, const dictionary& dict);
//- Clone (disallowed)
autoPtr<topoSetFaceSource> clone() const
{
......
......@@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -45,6 +45,16 @@ Foam::topoSetFaceZoneSource::topoSetFaceZoneSource(const polyMesh& mesh)
{}
Foam::topoSetFaceZoneSource::topoSetFaceZoneSource
(
const polyMesh& mesh,
const dictionary& dict
)
:
topoSetSource(mesh, dict)
{}
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::topoSetFaceZoneSource>
......
......@@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -92,9 +92,13 @@ public:
// Constructors
//- Construct from components
//- Construct from mesh
explicit topoSetFaceZoneSource(const polyMesh& mesh);
//- Construct from mesh, use "verbose" entry if present
topoSetFaceZoneSource(const polyMesh& mesh, const dictionary& dict);
//- Clone (disallowed)
autoPtr<topoSetFaceZoneSource> clone() const
{
......
......@@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2020 OpenCFD Ltd.
Copyright (C) 2018-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -45,6 +45,16 @@ Foam::topoSetPointSource::topoSetPointSource(const polyMesh& mesh)
{}
Foam::topoSetPointSource::topoSetPointSource
(
const polyMesh& mesh,
const dictionary& dict
)
:
topoSetSource(mesh, dict)
{}
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::topoSetPointSource>
......
......@@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2020 OpenCFD Ltd.
Copyright (C) 2018-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -89,9 +89,13 @@ public:
// Constructors
//- Construct from components
//- Construct from mesh
explicit topoSetPointSource(const polyMesh& mesh);
//- Construct from mesh, use "verbose" entry if present
topoSetPointSource(const polyMesh& mesh, const dictionary& dict);
//- Clone (disallowed)
autoPtr<topoSetPointSource> clone() const
{
......
......@@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -45,6 +45,16 @@ Foam::topoSetPointZoneSource::topoSetPointZoneSource(const polyMesh& mesh)
{}
Foam::topoSetPointZoneSource::topoSetPointZoneSource
(
const polyMesh& mesh,
const dictionary& dict
)
:
topoSetSource(mesh, dict)
{}
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::topoSetPointZoneSource>
......
......@@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -92,9 +92,13 @@ public:
// Constructors
//- Construct from components
//- Construct from mesh
explicit topoSetPointZoneSource(const polyMesh& mesh);
//- Construct from mesh, use "verbose" entry if present
topoSetPointZoneSource(const polyMesh& mesh, const dictionary& dict);
//- Clone (disallowed)
autoPtr<topoSetPointZoneSource> clone() const
{
......
......@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2018-2019 OpenCFD Ltd.
Copyright (C) 2018-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -27,6 +27,7 @@ License
\*---------------------------------------------------------------------------*/
#include "topoSetSource.H"
#include "dictionary.H"
#include "polyMesh.H"
#include "bitSet.H"
#include "topoSet.H"
......@@ -228,11 +229,40 @@ void Foam::topoSetSource::addOrDelete
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::topoSetSource::topoSetSource(const polyMesh& mesh)
Foam::topoSetSource::topoSetSource
(
const polyMesh& mesh,
bool verbose
)
:
mesh_(mesh),
verbose_(true)
verbose_(verbose)
{}
Foam::topoSetSource::topoSetSource
(
const polyMesh& mesh,
const dictionary& dict
)
:
topoSetSource(mesh)
{
verbose(dict);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::topoSetSource::verbose(const dictionary& dict)
{
bool flag(verbose_);
if (dict.readIfPresent("verbose", flag))
{
verbose_ = flag;
}
}
// ************************************************************************* //
......@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2018-2020 OpenCFD Ltd.
Copyright (C) 2018-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -56,6 +56,7 @@ namespace Foam
{
// Forward Declarations
class dictionary;
class polyMesh;
class bitSet;
class topoSet;
......@@ -151,7 +152,7 @@ protected:
//- Reference to the mesh
const polyMesh& mesh_;
//- Verbosity (default: true)
//- Output verbosity (default: true)
bool verbose_;
......@@ -294,8 +295,12 @@ public:
// Constructors
//- Construct from components
explicit topoSetSource(const polyMesh& mesh);
//- Construct from mesh, with preferred verbosity
explicit topoSetSource(const polyMesh& mesh, bool verbose = true);
//- Construct from mesh, use "verbose" entry if present
topoSetSource(const polyMesh& mesh, const dictionary& dict);
//- Clone (disallowed)
autoPtr<topoSetSource> clone() const
......@@ -331,23 +336,29 @@ public:
// Member Functions
//- Reference to the mesh
const polyMesh& mesh() const
const polyMesh& mesh() const noexcept
{
return mesh_;
}
//- Return the current verbosity
bool verbose() const
//- Get output verbosity
bool verbose() const noexcept
{
return verbose_;
}
//- Set the current verbosity
void verbose(bool on)
//- Enable/disable verbose output
// \return old value
bool verbose(bool on) noexcept
{
bool old(verbose_);
verbose_ = on;
return old;
}
//- Use "verbose" entry (if present) to enable/disable verbose output
void verbose(const dictionary& dict);
// Member Functions
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment