Commit 02f97872 authored by Andrew Heather's avatar Andrew Heather
Browse files

ENH: Dry-run - Include creation of sets and zones for dyanmic mesh cases

parent cf7dbcd0
......@@ -61,6 +61,9 @@ SimplifiedDynamicFvMesh
// Add the patches
addLocalPatches(*this);
// Add the zones if constructed from mesh
initialiseZones(*this);
}
......
......@@ -75,7 +75,8 @@ bool Foam::simplifiedMeshes::columnFvMeshInfo::setPatchEntries
{
polyBoundaryMeshEntries allPatchEntries(boundaryIO);
Info<< "Creating simplified mesh using " << allPatchEntries.path() << endl;
Info<< "Creating simplified mesh using " << allPatchEntries.path()
<< endl;
for (const entry& e : allPatchEntries)
{
......@@ -134,7 +135,7 @@ bool Foam::simplifiedMeshes::columnFvMeshInfo::setPatchEntries
dictionary simplifiedEntries;
simplifiedEntries.add("startFace", 0);
simplifiedEntries.add("nFaces", 1);
simplifiedEntries.add("type", "wall"); // default to wall type
simplifiedEntries.add("type", "wall"); // default to wall
patchEntries_.add(e.keyword(), simplifiedEntries);
}
......@@ -304,7 +305,12 @@ void Foam::simplifiedMeshes::columnFvMeshInfo::initialise(const Time& runTime)
}
void Foam::simplifiedMeshes::columnFvMeshInfo::addLocalPatches(fvMesh& mesh) const
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
void Foam::simplifiedMeshes::columnFvMeshInfo::addLocalPatches
(
fvMesh& mesh
) const
{
const label nPatch = patchEntries_.size();
......@@ -367,6 +373,24 @@ void Foam::simplifiedMeshes::columnFvMeshInfo::addLocalPatches(fvMesh& mesh) con
}
}
void Foam::simplifiedMeshes::columnFvMeshInfo::initialiseZones(fvMesh& mesh)
{
if (createFromMesh_)
{
// Initialise the zones
initialiseZone<pointZoneMesh>
(
"point",
localInstance_,
mesh.pointZones()
);
initialiseZone<faceZoneMesh>("face", localInstance_, mesh.faceZones());
initialiseZone<cellZoneMesh>("cell", localInstance_, mesh.cellZones());
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::simplifiedMeshes::columnFvMeshInfo::columnFvMeshInfo(const Time& runTime)
......@@ -389,6 +413,11 @@ Foam::simplifiedMeshes::columnFvMeshInfo::columnFvMeshInfo(const Time& runTime)
nPatchWithFace_(0)
{
initialise(runTime);
// Dummy zones and sets created on demand
// Note: zones can be updated post-construction
cellZoneMesh::disallowGenericZones = 1;
topoSet::disallowGenericSets = 1;
}
......@@ -423,24 +452,8 @@ Foam::simplifiedMeshes::columnFvMesh::columnFvMesh(const Time& runTime)
// Add the patches
addLocalPatches(*this);
// Add the zones
if (createFromMesh_)
{
// Initialise the zones
initialiseZone<pointZoneMesh>("point", localInstance_, pointZones());
initialiseZone<faceZoneMesh>("face", localInstance_, faceZones());
initialiseZone<cellZoneMesh>("cell", localInstance_, cellZones());
// Dummy sets created on demand
topoSet::disallowGenericSets = 1;
}
else
{
// Dummy zones and sets created on demand
cellZoneMesh::disallowGenericZones = 1;
topoSet::disallowGenericSets = 1;
}
// Add the zones if constructed from mesh
initialiseZones(*this);
if (debug)
{
......
......@@ -59,6 +59,15 @@ class columnFvMeshInfo
//- Initialise
void initialise(const Time& runTime);
//- Helper function to initialise empty zones
template<class ZoneMeshType>
void initialiseZone
(
const word& zoneTypeName,
const fileName& instance,
ZoneMeshType& zoneType
);
protected:
......@@ -99,6 +108,9 @@ protected:
//- Add the patches to the mesh
void addLocalPatches(fvMesh& mesh) const;
//- Initialise zones if constructed from mesh
void initialiseZones(fvMesh& mesh);
public:
......@@ -133,6 +145,12 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "columnFvMeshTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
......@@ -22,14 +22,13 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "polyMesh.H"
template<class ZoneMeshType>
void Foam::simplifiedFvMesh::initialiseZone
void Foam::simplifiedMeshes::columnFvMeshInfo::initialiseZone
(
const word& zoneTypeName,
const fileName& instance,
const fileName& instance,
ZoneMeshType& zoneType
)
{
......
......@@ -94,6 +94,8 @@ Foam::simplifiedMeshes::hexCellFvMesh::hexCellFvMesh
);
addFvPatches(patches);
// Note: no sets or zones created
}
......
......@@ -25,6 +25,7 @@ License
#include "simplifiedFvMesh.H"
#include "fvPatchField.H"
#include "topoSet.H"
// * * * * * * * * * * * * * * * Static Members * * * * * * * * * * * * * * //
......@@ -57,6 +58,8 @@ bool Foam::simplifiedFvMesh::fvPatchFieldExists(const word& patchType)
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::simplifiedFvMesh::simplifiedFvMesh
(
const IOobject& io,
......
......@@ -52,18 +52,6 @@ class simplifiedFvMesh
:
public fvMesh
{
protected:
//- Helper function to initialise empty zones
template<class ZoneMeshType>
void initialiseZone
(
const word& zoneTypeName,
const fileName& instance,
ZoneMeshType& zoneType
);
public:
//- Runtime type information
......@@ -118,12 +106,6 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "simplifiedFvMeshTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
Markdown is supported
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