DemandDrivenMeshObject: Templated abstract base-class for demand-driven mesh objects
Replaces MeshObject, providing a formalised method for creating demand-driven
mesh objects, optionally supporting update functions called by the mesh
following mesh changes.
Class
Foam::DemandDrivenMeshObject
Description
Templated abstract base-class for demand-driven mesh objects used to
automate their allocation to the mesh database and the mesh-modifier
event-loop.
DemandDrivenMeshObject is templated on the type of mesh it is allocated
to, the type of the mesh object (TopologicalMeshObject, GeometricMeshObject,
MoveableMeshObject, DistributeableMeshObject, UpdateableMeshObject) and the
type of the actual object it is created for example:
\verbatim
class leastSquaresVectors
:
public DemandDrivenMeshObject
<
fvMesh,
MoveableMeshObject,
leastSquaresVectors
>
{
.
.
.
//- Delete the least square vectors when the mesh moves
virtual bool movePoints();
};
\endverbatim
MeshObject types:
- TopologicalMeshObject: mesh object to be deleted on topology change
- GeometricMeshObject: mesh object to be deleted on geometry change
- MoveableMeshObject: mesh object to be updated in movePoints
- UpdateableMeshObject: mesh object to be updated in topoChange or
movePoints
- PatchMeshObject: mesh object to be additionally updated patch changes
DemandDrivenMeshObject should always be constructed and accessed via the New
methods provided so that they are held and maintained by the objectRegistry.
To ensure this use constructors of the concrete derived types should be
private or protected and friendship with the DemandDrivenMeshObject
base-class declared so that the New functions can call the the constructors.
Additionally the mesh-object types (TopologicalMeshObject, GeometricMeshObject,
MoveableMeshObject, DistributeableMeshObject, UpdateableMeshObject) can now be
used as mix-in types for normally allocated objects providing the same interface
to mesh-change update functions, see the Fickian fluid
thermophysicalTransportModel or anisotropic solid thermophysicalTransportModel.
This new approach to adding mesh-update functions to classes will be applied to
other existing classes and future developments to simplify the support and
maintenance of run-time mesh changes, in particular mesh refinement/unrefinement
and mesh-to-mesh mapping.
This commit is contained in:
@ -24,13 +24,14 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "pointFieldReconstructor.H"
|
||||
#include "fvMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::pointFieldReconstructor::pointFieldReconstructor
|
||||
(
|
||||
const pointMesh& completeMesh,
|
||||
const PtrList<pointMesh>& procMeshes,
|
||||
const PtrList<fvMesh>& procMeshes,
|
||||
const labelListList& pointProcAddressing
|
||||
)
|
||||
:
|
||||
@ -46,7 +47,7 @@ Foam::pointFieldReconstructor::pointFieldReconstructor
|
||||
// Create the pointPatch addressing
|
||||
forAll(procMeshes_, proci)
|
||||
{
|
||||
const pointMesh& procMesh = procMeshes_[proci];
|
||||
const pointMesh& procMesh = pointMesh::New(procMeshes_[proci]);
|
||||
|
||||
patchPointAddressing_[proci].setSize(procMesh.boundary().size());
|
||||
|
||||
|
||||
@ -46,6 +46,8 @@ SourceFiles
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class fvMesh;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class pointFieldReconstructor Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -58,7 +60,7 @@ class pointFieldReconstructor
|
||||
const pointMesh& completeMesh_;
|
||||
|
||||
//- List of processor meshes
|
||||
const PtrList<pointMesh>& procMeshes_;
|
||||
const PtrList<fvMesh>& procMeshes_;
|
||||
|
||||
//- List of processor point addressing lists
|
||||
const labelListList& pointProcAddressing_;
|
||||
@ -96,7 +98,7 @@ public:
|
||||
pointFieldReconstructor
|
||||
(
|
||||
const pointMesh& mesh,
|
||||
const PtrList<pointMesh>& procMeshes,
|
||||
const PtrList<fvMesh>& procMeshes,
|
||||
const labelListList& pointProcAddressing
|
||||
);
|
||||
|
||||
|
||||
@ -24,6 +24,7 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "pointFieldReconstructor.H"
|
||||
#include "fvMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
@ -47,12 +48,12 @@ Foam::pointFieldReconstructor::reconstructField(const IOobject& fieldIoObject)
|
||||
IOobject
|
||||
(
|
||||
fieldIoObject.name(),
|
||||
procMeshes_[proci]().time().name(),
|
||||
procMeshes_[proci](),
|
||||
procMeshes_[proci].time().name(),
|
||||
procMeshes_[proci],
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
procMeshes_[proci]
|
||||
pointMesh::New(procMeshes_[proci])
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ -431,20 +431,11 @@ int main(int argc, char *argv[])
|
||||
|
||||
const pointMesh& completePMesh =
|
||||
pointMesh::New(meshes.completeMesh());
|
||||
PtrList<pointMesh> procPMeshes(nProcs);
|
||||
forAll(procPMeshes, proci)
|
||||
{
|
||||
procPMeshes.set
|
||||
(
|
||||
proci,
|
||||
new pointMesh(meshes.procMeshes()[proci])
|
||||
);
|
||||
}
|
||||
|
||||
pointFieldReconstructor pointReconstructor
|
||||
(
|
||||
completePMesh,
|
||||
procPMeshes,
|
||||
meshes.procMeshes(),
|
||||
meshes.procPointAddressing()
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user