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:
Henry Weller
2022-12-13 18:29:20 +00:00
parent 06217ffce0
commit a3681c3428
88 changed files with 1799 additions and 1067 deletions

View File

@ -143,7 +143,10 @@ int main(int argc, char *argv[])
if (args.optionFound("from") || args.optionFound("to"))
{
coordinateSystems::coordinateSystems csLst(runTime);
const coordinateSystems::coordinateSystems& csLst
(
coordinateSystems::coordinateSystems::New(runTime)
);
if (args.optionFound("from"))
{

View File

@ -132,7 +132,10 @@ int main(int argc, char *argv[])
if (args.optionFound("from") || args.optionFound("to"))
{
coordinateSystems::coordinateSystems csLst(runTime);
const coordinateSystems::coordinateSystems& csLst
(
coordinateSystems::coordinateSystems::New(runTime)
);
if (args.optionFound("from"))
{

View File

@ -145,7 +145,10 @@ int main(int argc, char *argv[])
if (args.optionFound("from") || args.optionFound("to"))
{
coordinateSystems::coordinateSystems csLst(runTime);
const coordinateSystems::coordinateSystems& csLst
(
coordinateSystems::coordinateSystems::New(runTime)
);
if (args.optionFound("from"))
{