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

@ -115,20 +115,22 @@ Foam::compressibleInterPhaseThermophysicalTransportModel::kappaEff
+ mixture_.alpha2().boundaryField()[patchi] + mixture_.alpha2().boundaryField()[patchi]
*( *(
mixture_.thermo2().kappa().boundaryField()[patchi] mixture_.thermo2().kappa().boundaryField()[patchi]
+ mixture_.thermo2().rho(patchi)*mixture_.thermo2().Cp() + mixture_.thermo2().rho(patchi)
*mixture_.thermo2().Cp().boundaryField()[patchi]
*momentumTransport_.momentumTransport2_->nut(patchi) *momentumTransport_.momentumTransport2_->nut(patchi)
); );
} }
else else
{ {
return return
mixture_.alpha1() mixture_.alpha1().boundaryField()[patchi]
*( *(
mixture_.thermo1().kappa().boundaryField()[patchi] mixture_.thermo1().kappa().boundaryField()[patchi]
+ mixture_.thermo1().rho(patchi)*mixture_.thermo1().Cp() + mixture_.thermo1().rho(patchi)
*mixture_.thermo1().Cp().boundaryField()[patchi]
*momentumTransport_.mixtureMomentumTransport_->nut(patchi) *momentumTransport_.mixtureMomentumTransport_->nut(patchi)
) )
+ mixture_.alpha2() + mixture_.alpha2().boundaryField()[patchi]
*( *(
mixture_.thermo2().kappa().boundaryField()[patchi] mixture_.thermo2().kappa().boundaryField()[patchi]
+ mixture_.thermo2().rho(patchi) + mixture_.thermo2().rho(patchi)

View File

@ -663,7 +663,7 @@ int main(int argc, char *argv[])
if (twoDMotion) if (twoDMotion)
{ {
Info<< "Correcting for 2D motion" << endl << endl; Info<< "Correcting for 2D motion" << endl << endl;
correct2DPtr = new twoDPointCorrector(mesh); correct2DPtr = &twoDPointCorrector::New(mesh);
} }
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -40,35 +40,32 @@ const Foam::scalar Foam::edgeStats::edgeTol_ = 1e-3;
Foam::direction Foam::edgeStats::getNormalDir Foam::direction Foam::edgeStats::getNormalDir
( (
const twoDPointCorrector* correct2DPtr const twoDPointCorrector& correct2D
) const ) const
{ {
direction dir = 3; const vector& normal = correct2D.planeNormal();
if (correct2DPtr)
{
const vector& normal = correct2DPtr->planeNormal();
if (mag(normal & vector(1, 0, 0)) > 1-edgeTol_) if (mag(normal & vector(1, 0, 0)) > 1-edgeTol_)
{ {
dir = 0; return 0;
} }
else if (mag(normal & vector(0, 1, 0)) > 1-edgeTol_) else if (mag(normal & vector(0, 1, 0)) > 1-edgeTol_)
{ {
dir = 1; return 1;
} }
else if (mag(normal & vector(0, 0, 1)) > 1-edgeTol_) else if (mag(normal & vector(0, 0, 1)) > 1-edgeTol_)
{ {
dir = 2; return 2;
} }
else
{
return 3;
} }
return dir;
} }
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from mesh
Foam::edgeStats::edgeStats(const polyMesh& mesh) Foam::edgeStats::edgeStats(const polyMesh& mesh)
: :
mesh_(mesh), mesh_(mesh),
@ -95,19 +92,12 @@ Foam::edgeStats::edgeStats(const polyMesh& mesh)
if (twoDMotion) if (twoDMotion)
{ {
Info<< "Correcting for 2D motion" << endl << endl; Info<< "Correcting for 2D motion" << endl << endl;
normalDir_ = getNormalDir(twoDPointCorrector::New(mesh));
autoPtr<twoDPointCorrector> correct2DPtr
(
new twoDPointCorrector(mesh)
);
normalDir_ = getNormalDir(&correct2DPtr());
} }
} }
} }
// Construct from components
Foam::edgeStats::edgeStats Foam::edgeStats::edgeStats
( (
const polyMesh& mesh, const polyMesh& mesh,
@ -115,7 +105,12 @@ Foam::edgeStats::edgeStats
) )
: :
mesh_(mesh), mesh_(mesh),
normalDir_(getNormalDir(correct2DPtr)) normalDir_
(
correct2DPtr
? getNormalDir(*correct2DPtr)
: 3
)
{} {}

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -62,10 +62,11 @@ class edgeStats
//- Component (0,1,2) of normal direction or 3 if 3D case. //- Component (0,1,2) of normal direction or 3 if 3D case.
direction normalDir_; direction normalDir_;
// Private Member Functions // Private Member Functions
//- If 2d get component of normal dir. //- If 2d get component of normal dir.
direction getNormalDir(const twoDPointCorrector*) const; direction getNormalDir(const twoDPointCorrector&) const;
public: public:

View File

@ -51,7 +51,7 @@ int main(int argc, char *argv[])
#include "createTime.H" #include "createTime.H"
#include "createMeshNoChangers.H" #include "createMeshNoChangers.H"
volPointInterpolation pInterp(mesh); const volPointInterpolation& pInterp(volPointInterpolation::New(mesh));
// Get times list // Get times list
instantList Times = runTime.times(); instantList Times = runTime.times();

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -68,7 +68,10 @@ int main(int argc, char *argv[])
point midPoint = gAverage(points); point midPoint = gAverage(points);
twoDPointCorrector twoDCorr(mesh); const twoDPointCorrector& twoDCorr
(
twoDPointCorrector::New(mesh)
);
direction planeNormalCmpt = twoDCorr.normalDir(); direction planeNormalCmpt = twoDCorr.normalDir();

View File

@ -24,13 +24,14 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "pointFieldReconstructor.H" #include "pointFieldReconstructor.H"
#include "fvMesh.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::pointFieldReconstructor::pointFieldReconstructor Foam::pointFieldReconstructor::pointFieldReconstructor
( (
const pointMesh& completeMesh, const pointMesh& completeMesh,
const PtrList<pointMesh>& procMeshes, const PtrList<fvMesh>& procMeshes,
const labelListList& pointProcAddressing const labelListList& pointProcAddressing
) )
: :
@ -46,7 +47,7 @@ Foam::pointFieldReconstructor::pointFieldReconstructor
// Create the pointPatch addressing // Create the pointPatch addressing
forAll(procMeshes_, proci) forAll(procMeshes_, proci)
{ {
const pointMesh& procMesh = procMeshes_[proci]; const pointMesh& procMesh = pointMesh::New(procMeshes_[proci]);
patchPointAddressing_[proci].setSize(procMesh.boundary().size()); patchPointAddressing_[proci].setSize(procMesh.boundary().size());

View File

@ -46,6 +46,8 @@ SourceFiles
namespace Foam namespace Foam
{ {
class fvMesh;
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class pointFieldReconstructor Declaration Class pointFieldReconstructor Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -58,7 +60,7 @@ class pointFieldReconstructor
const pointMesh& completeMesh_; const pointMesh& completeMesh_;
//- List of processor meshes //- List of processor meshes
const PtrList<pointMesh>& procMeshes_; const PtrList<fvMesh>& procMeshes_;
//- List of processor point addressing lists //- List of processor point addressing lists
const labelListList& pointProcAddressing_; const labelListList& pointProcAddressing_;
@ -96,7 +98,7 @@ public:
pointFieldReconstructor pointFieldReconstructor
( (
const pointMesh& mesh, const pointMesh& mesh,
const PtrList<pointMesh>& procMeshes, const PtrList<fvMesh>& procMeshes,
const labelListList& pointProcAddressing const labelListList& pointProcAddressing
); );

View File

@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "pointFieldReconstructor.H" #include "pointFieldReconstructor.H"
#include "fvMesh.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
@ -47,12 +48,12 @@ Foam::pointFieldReconstructor::reconstructField(const IOobject& fieldIoObject)
IOobject IOobject
( (
fieldIoObject.name(), fieldIoObject.name(),
procMeshes_[proci]().time().name(), procMeshes_[proci].time().name(),
procMeshes_[proci](), procMeshes_[proci],
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
procMeshes_[proci] pointMesh::New(procMeshes_[proci])
) )
); );
} }

View File

@ -431,20 +431,11 @@ int main(int argc, char *argv[])
const pointMesh& completePMesh = const pointMesh& completePMesh =
pointMesh::New(meshes.completeMesh()); pointMesh::New(meshes.completeMesh());
PtrList<pointMesh> procPMeshes(nProcs);
forAll(procPMeshes, proci)
{
procPMeshes.set
(
proci,
new pointMesh(meshes.procMeshes()[proci])
);
}
pointFieldReconstructor pointReconstructor pointFieldReconstructor pointReconstructor
( (
completePMesh, completePMesh,
procPMeshes, meshes.procMeshes(),
meshes.procPointAddressing() meshes.procPointAddressing()
); );

View File

@ -789,7 +789,11 @@ int main(int argc, char *argv[])
writer.write(ptf); writer.write(ptf);
// Interpolated volFields // Interpolated volFields
volPointInterpolation pInterp(mesh); const volPointInterpolation& pInterp
(
volPointInterpolation::New(mesh)
);
writer.write(pInterp, vsf); writer.write(pInterp, vsf);
writer.write(pInterp, vvf); writer.write(pInterp, vvf);
writer.write(pInterp, vsptf); writer.write(pInterp, vsptf);

View File

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

View File

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

View File

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

View File

@ -468,7 +468,7 @@ $(cellShape)/cellShapeIOList.C
meshes/Identifiers/patch/patchIdentifier.C meshes/Identifiers/patch/patchIdentifier.C
meshes/Identifiers/patch/coupleGroupIdentifier.C meshes/Identifiers/patch/coupleGroupIdentifier.C
meshes/MeshObject/meshObject.C meshes/meshObjects/meshObjects.C
polyMesh = meshes/polyMesh polyMesh = meshes/polyMesh

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -231,7 +231,12 @@ Foam::GAMGAgglomeration::GAMGAgglomeration
const dictionary& controlDict const dictionary& controlDict
) )
: :
MeshObject<lduMesh, Foam::GeometricMeshObject, GAMGAgglomeration>(mesh), DemandDrivenMeshObject
<
lduMesh,
GeometricMeshObject,
GAMGAgglomeration
>(mesh),
maxLevels_(50), maxLevels_(50),
@ -446,7 +451,7 @@ const Foam::lduMesh& Foam::GAMGAgglomeration::meshLevel
{ {
if (i == 0) if (i == 0)
{ {
return mesh_; return mesh();
} }
else else
{ {

View File

@ -37,7 +37,7 @@ SourceFiles
#ifndef GAMGAgglomeration_H #ifndef GAMGAgglomeration_H
#define GAMGAgglomeration_H #define GAMGAgglomeration_H
#include "MeshObject.H" #include "DemandDrivenMeshObject.H"
#include "lduPrimitiveMesh.H" #include "lduPrimitiveMesh.H"
#include "lduInterfacePtrsList.H" #include "lduInterfacePtrsList.H"
#include "primitiveFields.H" #include "primitiveFields.H"
@ -61,7 +61,12 @@ class GAMGProcAgglomeration;
class GAMGAgglomeration class GAMGAgglomeration
: :
public MeshObject<lduMesh, GeometricMeshObject, GAMGAgglomeration> public DemandDrivenMeshObject
<
lduMesh,
GeometricMeshObject,
GAMGAgglomeration
>
{ {
protected: protected:

View File

@ -1,389 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::MeshObject
Description
Templated abstract base-class for optional mesh objects used to automate
their allocation to the mesh database and the mesh-modifier event-loop.
MeshObject 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 MeshObject<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
Note:
movePoints must be provided for MeshObjects of type MoveableMeshObject
and both movePoints and topoChange functions must exist, provided for
MeshObjects of type UpdateableMeshObject.
SourceFiles
MeshObject.C
\*---------------------------------------------------------------------------*/
#ifndef MeshObject_H
#define MeshObject_H
#include "objectRegistry.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declarations
class polyTopoChangeMap;
class polyMeshMap;
class polyDistributionMap;
/*---------------------------------------------------------------------------*\
Class MeshObject Declaration
\*---------------------------------------------------------------------------*/
template<class Mesh, template<class> class MeshObjectType, class Type>
class MeshObject
:
public MeshObjectType<Mesh>
{
protected:
// Reference to Mesh
const Mesh& mesh_;
public:
// Constructors
explicit MeshObject(const Mesh& mesh);
MeshObject(const Mesh& mesh, const IOobject& io);
static Type& New(Mesh& mesh);
static const Type& New(const Mesh& mesh);
template<class... Args>
static Type& New
(
Mesh& mesh,
const Args&... args
);
template<class... Args>
static const Type& New
(
const Mesh& mesh,
const Args&... args
);
// Destructors
virtual ~MeshObject();
static bool Delete(const Mesh& mesh);
// Member Functions
//- Return true if this MeshObject is found in the mesh registry
static bool found(const Mesh& mesh);
const Mesh& mesh() const
{
return mesh_;
}
virtual bool writeData(Foam::Ostream&) const
{
return true;
}
};
/*---------------------------------------------------------------------------*\
Class typeMeshObject Declaration
\*---------------------------------------------------------------------------*/
class typeMeshObject
:
public regIOobject
{
public:
// Declare name of the class and its debug switch
ClassName("typeMeshObject");
// Constructors
typeMeshObject(const word& typeName, const objectRegistry& obr);
typeMeshObject(const word& typeName, const IOobject& io);
};
/*---------------------------------------------------------------------------*\
Class TopologicalMeshObject Declaration
\*---------------------------------------------------------------------------*/
template<class Mesh>
class TopologicalMeshObject
:
public typeMeshObject
{
public:
TopologicalMeshObject(const word& typeName, const objectRegistry& obr)
:
typeMeshObject(typeName, obr)
{}
TopologicalMeshObject(const word& typeName, const IOobject& io)
:
typeMeshObject(typeName, io)
{}
};
/*---------------------------------------------------------------------------*\
Class GeometricMeshObject Declaration
\*---------------------------------------------------------------------------*/
template<class Mesh>
class GeometricMeshObject
:
public TopologicalMeshObject<Mesh>
{
public:
GeometricMeshObject(const word& typeName, const objectRegistry& obr)
:
TopologicalMeshObject<Mesh>(typeName, obr)
{}
GeometricMeshObject(const word& typeName, const IOobject& io)
:
TopologicalMeshObject<Mesh>(typeName, io)
{}
};
/*---------------------------------------------------------------------------*\
Class MoveableMeshObject Declaration
\*---------------------------------------------------------------------------*/
template<class Mesh>
class MoveableMeshObject
:
public GeometricMeshObject<Mesh>
{
public:
MoveableMeshObject(const word& typeName, const objectRegistry& obr)
:
GeometricMeshObject<Mesh>(typeName, obr)
{}
MoveableMeshObject(const word& typeName, const IOobject& io)
:
GeometricMeshObject<Mesh>(typeName, io)
{}
virtual bool movePoints() = 0;
};
/*---------------------------------------------------------------------------*\
Class DistributeableMeshObject Declaration
\*---------------------------------------------------------------------------*/
template<class Mesh>
class DistributeableMeshObject
:
public MoveableMeshObject<Mesh>
{
public:
DistributeableMeshObject(const word& typeName, const objectRegistry& obr)
:
MoveableMeshObject<Mesh>(typeName, obr)
{}
DistributeableMeshObject(const word& typeName, const IOobject& io)
:
MoveableMeshObject<Mesh>(typeName, io)
{}
virtual void distribute(const polyDistributionMap& map) = 0;
};
/*---------------------------------------------------------------------------*\
Class UpdateableMeshObject Declaration
\*---------------------------------------------------------------------------*/
template<class Mesh>
class UpdateableMeshObject
:
public DistributeableMeshObject<Mesh>
{
public:
UpdateableMeshObject(const word& typeName, const objectRegistry& obr)
:
DistributeableMeshObject<Mesh>(typeName, obr)
{}
UpdateableMeshObject(const word& typeName, const IOobject& io)
:
DistributeableMeshObject<Mesh>(typeName, io)
{}
virtual void topoChange(const polyTopoChangeMap& map) = 0;
virtual void mapMesh(const polyMeshMap& map) = 0;
};
/*---------------------------------------------------------------------------*\
Class PatchMeshObject Declaration
\*---------------------------------------------------------------------------*/
template<class Mesh>
class PatchMeshObject
:
public UpdateableMeshObject<Mesh>
{
public:
PatchMeshObject(const word& typeName, const objectRegistry& obr)
:
UpdateableMeshObject<Mesh>(typeName, obr)
{}
PatchMeshObject(const word& typeName, const IOobject& io)
:
UpdateableMeshObject<Mesh>(typeName, io)
{}
//- Reordered/removed trailing patches. If validBoundary call is parallel
// synced and all add the same patch with same settings
virtual void reorderPatches
(
const labelUList& newToOld,
const bool validBoundary
) = 0;
//- Inserted patch at patchi
virtual void addPatch(const label patchi) = 0;
};
/*---------------------------------------------------------------------------*\
namespace meshObject Declaration
\*---------------------------------------------------------------------------*/
namespace meshObjects
{
NamespaceName("meshObjects");
template<class Mesh>
void movePoints(objectRegistry&);
template<class Mesh>
void topoChange(objectRegistry&, const polyTopoChangeMap&);
template<class Mesh>
void mapMesh(objectRegistry&, const polyMeshMap&);
template<class Mesh>
void distribute(objectRegistry&, const polyDistributionMap&);
template<class Mesh>
void addPatch(objectRegistry&, const label patchi);
template<class Mesh>
void reorderPatches
(
objectRegistry&,
const labelUList& newToOld,
const bool validBoundary
);
template<class Mesh, template<class> class MeshObjectType>
void clear(objectRegistry&);
//- Clear all MeshObject derived from FromType up to (but not including)
// ToType. Used to clear e.g. all non-updateable meshObjects
template
<
class Mesh,
template<class> class FromType,
template<class> class ToType
>
void clearUpto(objectRegistry&);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "MeshObject.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -31,7 +31,12 @@ License
template<class Type> template<class Type>
Foam::Residuals<Type>::Residuals(const polyMesh& mesh) Foam::Residuals<Type>::Residuals(const polyMesh& mesh)
: :
MeshObject<polyMesh, GeometricMeshObject, Residuals<Type>>(mesh), DemandDrivenMeshObject
<
polyMesh,
GeometricMeshObject,
Residuals<Type>
>(mesh),
prevTimeIndex_(-1) prevTimeIndex_(-1)
{} {}
@ -41,7 +46,12 @@ Foam::Residuals<Type>::Residuals(const polyMesh& mesh)
template<class Type> template<class Type>
Foam::List<Foam::word> Foam::Residuals<Type>::fieldNames(const polyMesh& mesh) Foam::List<Foam::word> Foam::Residuals<Type>::fieldNames(const polyMesh& mesh)
{ {
return MeshObject<polyMesh, GeometricMeshObject, Residuals<Type>>::New return DemandDrivenMeshObject
<
polyMesh,
GeometricMeshObject,
Residuals<Type>
>::New
( (
mesh mesh
).HashTable<DynamicList<SolverPerformance<Type>>>::toc(); ).HashTable<DynamicList<SolverPerformance<Type>>>::toc();
@ -51,7 +61,12 @@ Foam::List<Foam::word> Foam::Residuals<Type>::fieldNames(const polyMesh& mesh)
template<class Type> template<class Type>
bool Foam::Residuals<Type>::found(const polyMesh& mesh, const word& fieldName) bool Foam::Residuals<Type>::found(const polyMesh& mesh, const word& fieldName)
{ {
return MeshObject<polyMesh, GeometricMeshObject, Residuals<Type>>::New return DemandDrivenMeshObject
<
polyMesh,
GeometricMeshObject,
Residuals<Type>
>::New
( (
mesh mesh
).HashTable<DynamicList<SolverPerformance<Type>>>::found(fieldName); ).HashTable<DynamicList<SolverPerformance<Type>>>::found(fieldName);
@ -66,7 +81,12 @@ Foam::Residuals<Type>::field
const word& fieldName const word& fieldName
) )
{ {
return MeshObject<polyMesh, GeometricMeshObject, Residuals<Type>>::New return DemandDrivenMeshObject
<
polyMesh,
GeometricMeshObject,
Residuals<Type>
>::New
( (
mesh mesh
)[fieldName]; )[fieldName];
@ -82,7 +102,12 @@ void Foam::Residuals<Type>::append
{ {
Residuals<Type>& residuals = const_cast<Residuals<Type>&> Residuals<Type>& residuals = const_cast<Residuals<Type>&>
( (
MeshObject<polyMesh, GeometricMeshObject, Residuals<Type>>::New DemandDrivenMeshObject
<
polyMesh,
GeometricMeshObject,
Residuals<Type>
>::New
( (
mesh mesh
) )

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,8 +25,8 @@ Class
Foam::Residuals Foam::Residuals
Description Description
MeshObject to store the solver performance residuals of all the fields DemandDrivenMeshObject to store the solver performance residuals of all
of the type it is instantiated on. the fields of the type it is instantiated on.
SourceFiles SourceFiles
Residuals.C Residuals.C
@ -36,7 +36,7 @@ SourceFiles
#ifndef Residuals_H #ifndef Residuals_H
#define Residuals_H #define Residuals_H
#include "MeshObject.H" #include "DemandDrivenMeshObject.H"
#include "polyMesh.H" #include "polyMesh.H"
#include "solverPerformance.H" #include "solverPerformance.H"
@ -52,7 +52,12 @@ namespace Foam
template<class Type> template<class Type>
class Residuals class Residuals
: :
public MeshObject<polyMesh, GeometricMeshObject, Residuals<Type>>, public DemandDrivenMeshObject
<
polyMesh,
GeometricMeshObject,
Residuals<Type>
>,
public HashTable<DynamicList<SolverPerformance<Type>>> public HashTable<DynamicList<SolverPerformance<Type>>>
{ {
// Private Data // Private Data
@ -61,6 +66,21 @@ class Residuals
mutable label prevTimeIndex_; mutable label prevTimeIndex_;
protected:
friend class DemandDrivenMeshObject
<
polyMesh,
GeometricMeshObject,
Residuals<Type>
>;
// Protected Constructors
//- Construct for given mesh
explicit Residuals(const polyMesh& mesh);
public: public:
//- Runtime type information //- Runtime type information
@ -69,9 +89,6 @@ public:
// Constructors // Constructors
//- Construct for given mesh
Residuals(const polyMesh& mesh);
//- Disallow default bitwise copy construction //- Disallow default bitwise copy construction
Residuals(const Residuals<Type>&) = delete; Residuals(const Residuals<Type>&) = delete;

View File

@ -0,0 +1,251 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "DemandDrivenMeshObject.H"
#include "meshObjects.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Mesh, template<class> class MeshObjectType, class Type>
Foam::DemandDrivenMeshObject<Mesh, MeshObjectType, Type>::DemandDrivenMeshObject
(
const Mesh& mesh
)
:
regIOobject
(
IOobject
(
Type::typeName,
mesh.thisDb().instance(),
mesh.thisDb()
)
),
MeshObjectType<Mesh>(*this, mesh),
mesh_(mesh)
{}
template<class Mesh, template<class> class MeshObjectType, class Type>
Foam::DemandDrivenMeshObject<Mesh, MeshObjectType, Type>::DemandDrivenMeshObject
(
const Mesh& mesh,
const IOobject& io
)
:
regIOobject(io),
MeshObjectType<Mesh>(*this, mesh),
mesh_(mesh)
{}
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
template<class Mesh, template<class> class MeshObjectType, class Type>
Type& Foam::DemandDrivenMeshObject<Mesh, MeshObjectType, Type>::New
(
Mesh& mesh
)
{
if (found(mesh))
{
return mesh.thisDb().objectRegistry::template lookupObjectRef<Type>
(
Type::typeName
);
}
else
{
if (meshObjects::debug)
{
Pout<< "DemandDrivenMeshObject::New(" << Mesh::typeName
<< "&) : constructing " << Type::typeName
<< " for region " << mesh.name() << endl;
}
Type* objectPtr = new Type(mesh);
regIOobject::store(objectPtr);
return *objectPtr;
}
}
template<class Mesh, template<class> class MeshObjectType, class Type>
const Type& Foam::DemandDrivenMeshObject<Mesh, MeshObjectType, Type>::New
(
const Mesh& mesh
)
{
if (found(mesh))
{
return mesh.thisDb().objectRegistry::template lookupObjectRef<Type>
(
Type::typeName
);
}
else
{
if (meshObjects::debug)
{
Pout<< "DemandDrivenMeshObject::New(const " << Mesh::typeName
<< "&) : constructing " << Type::typeName
<< " for region " << mesh.name() << endl;
}
Type* objectPtr = new Type(mesh);
regIOobject::store(objectPtr);
return *objectPtr;
}
}
template<class Mesh, template<class> class MeshObjectType, class Type>
template<class... Args>
Type& Foam::DemandDrivenMeshObject<Mesh, MeshObjectType, Type>::New
(
Mesh& mesh,
const Args&... args
)
{
if (found(mesh))
{
return mesh.thisDb().objectRegistry::template lookupObjectRef<Type>
(
Type::typeName
);
}
else
{
if (meshObjects::debug)
{
Pout<< "DemandDrivenMeshObject::New(" << Mesh::typeName
<< "&, const Data1&) : constructing " << Type::typeName
<< " for region " << mesh.name() << endl;
}
Type* objectPtr = new Type(mesh, args...);
regIOobject::store(objectPtr);
return *objectPtr;
}
}
template<class Mesh, template<class> class MeshObjectType, class Type>
template<class... Args>
const Type& Foam::DemandDrivenMeshObject<Mesh, MeshObjectType, Type>::New
(
const Mesh& mesh,
const Args&... args
)
{
if (found(mesh))
{
return mesh.thisDb().objectRegistry::template lookupObject<Type>
(
Type::typeName
);
}
else
{
if (meshObjects::debug)
{
Pout<< "DemandDrivenMeshObject::New(const " << Mesh::typeName
<< "&, const Data1&) : constructing " << Type::typeName
<< " for region " << mesh.name() << endl;
}
Type* objectPtr = new Type(mesh, args...);
regIOobject::store(objectPtr);
return *objectPtr;
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
template<class Mesh, template<class> class MeshObjectType, class Type>
bool Foam::DemandDrivenMeshObject<Mesh, MeshObjectType, Type>::Delete
(
const Mesh& mesh
)
{
if (found(mesh))
{
if (meshObjects::debug)
{
Pout<< "DemandDrivenMeshObject::Delete(const Mesh&) : deleting "
<< Type::typeName << endl;
}
return mesh.thisDb().checkOut
(
const_cast<Type&>
(
mesh.thisDb().objectRegistry::template lookupObject<Type>
(
Type::typeName
)
)
);
}
else
{
return false;
}
}
template<class Mesh, template<class> class MeshObjectType, class Type>
Foam::DemandDrivenMeshObject<Mesh, MeshObjectType, Type>::
~DemandDrivenMeshObject()
{
regIOobject::release();
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Mesh, template<class> class MeshObjectType, class Type>
bool Foam::DemandDrivenMeshObject<Mesh, MeshObjectType, Type>::found
(
const Mesh& mesh
)
{
return mesh.thisDb().objectRegistry::template foundObject<Type>
(
Type::typeName
);
}
// ************************************************************************* //

View File

@ -0,0 +1,177 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
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.
SourceFiles
DemandDrivenMeshObject.C
\*---------------------------------------------------------------------------*/
#ifndef DemandDrivenMeshObject_H
#define DemandDrivenMeshObject_H
#include "MeshObjects.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class DemandDrivenMeshObject Declaration
\*---------------------------------------------------------------------------*/
template<class Mesh, template<class> class MeshObjectType, class Type>
class DemandDrivenMeshObject
:
public regIOobject,
public MeshObjectType<Mesh>
{
// Private member data
// Reference to Mesh
const Mesh& mesh_;
protected:
// Constructors
//- Construct from mesh
// Only derived classes can construct DemandDrivenMeshObject
DemandDrivenMeshObject(const Mesh& mesh);
//- Construct from mesh and IOobject
// Only derived classes can construct DemandDrivenMeshObject
DemandDrivenMeshObject(const Mesh& mesh, const IOobject& io);
public:
// Constructors
static Type& New(Mesh& mesh);
static const Type& New(const Mesh& mesh);
template<class... Args>
static Type& New
(
Mesh& mesh,
const Args&... args
);
template<class... Args>
static const Type& New
(
const Mesh& mesh,
const Args&... args
);
// Destructors
virtual ~DemandDrivenMeshObject();
//- Lookup DemandDrivenMeshObject and delete
static bool Delete(const Mesh& mesh);
// Member Functions
//- Return true if this DemandDrivenMeshObject is found
// in the mesh registry
static bool found(const Mesh& mesh);
const Mesh& mesh() const
{
return mesh_;
}
virtual bool writeData(Foam::Ostream&) const
{
return true;
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "DemandDrivenMeshObject.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,201 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::TopologicalMeshObject
Description
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
\*---------------------------------------------------------------------------*/
#ifndef MeshObjects_H
#define MeshObjects_H
#include "regIOobject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declarations
class polyTopoChangeMap;
class polyMeshMap;
class polyDistributionMap;
class meshObjects;
/*---------------------------------------------------------------------------*\
Class TopologicalMeshObject Declaration
\*---------------------------------------------------------------------------*/
template<class Mesh>
class TopologicalMeshObject
{
//- Reference to the regIOobject of the base-class
regIOobject& io_;
//- The regIOobject reference is used by the meshObjects functions
friend class meshObjects;
public:
TopologicalMeshObject(regIOobject& io, const Mesh& mesh)
:
io_(io)
{}
//- Virtual destructor to make class polymorphic
virtual ~TopologicalMeshObject() = default;
};
/*---------------------------------------------------------------------------*\
Class GeometricMeshObject Declaration
\*---------------------------------------------------------------------------*/
template<class Mesh>
class GeometricMeshObject
:
public TopologicalMeshObject<Mesh>
{
public:
GeometricMeshObject(regIOobject& io, const Mesh& mesh)
:
TopologicalMeshObject<Mesh>(io, mesh)
{}
};
/*---------------------------------------------------------------------------*\
Class MoveableMeshObject Declaration
\*---------------------------------------------------------------------------*/
template<class Mesh>
class MoveableMeshObject
:
public GeometricMeshObject<Mesh>
{
public:
MoveableMeshObject(regIOobject& io, const Mesh& mesh)
:
GeometricMeshObject<Mesh>(io, mesh)
{}
//- Update for mesh motion
virtual bool movePoints() = 0;
};
/*---------------------------------------------------------------------------*\
Class DistributeableMeshObject Declaration
\*---------------------------------------------------------------------------*/
template<class Mesh>
class DistributeableMeshObject
:
public MoveableMeshObject<Mesh>
{
public:
DistributeableMeshObject(regIOobject& io, const Mesh& mesh)
:
MoveableMeshObject<Mesh>(io, mesh)
{}
//- Redistribute or update using the given distribution map
virtual void distribute(const polyDistributionMap& map) = 0;
};
/*---------------------------------------------------------------------------*\
Class UpdateableMeshObject Declaration
\*---------------------------------------------------------------------------*/
template<class Mesh>
class UpdateableMeshObject
:
public DistributeableMeshObject<Mesh>
{
public:
UpdateableMeshObject(regIOobject& io, const Mesh& mesh)
:
DistributeableMeshObject<Mesh>(io, mesh)
{}
//- Update topology using the given map
virtual void topoChange(const polyTopoChangeMap& map) = 0;
//- Update from another mesh using the given map
virtual void mapMesh(const polyMeshMap& map) = 0;
};
/*---------------------------------------------------------------------------*\
Class PatchMeshObject Declaration
\*---------------------------------------------------------------------------*/
template<class Mesh>
class PatchMeshObject
:
public UpdateableMeshObject<Mesh>
{
public:
PatchMeshObject(regIOobject& io, const Mesh& mesh)
:
UpdateableMeshObject<Mesh>(io, mesh)
{}
//- Reordered/removed trailing patches. If validBoundary call is parallel
// synced and all add the same patch with same settings
virtual void reorderPatches
(
const labelUList& newToOld,
const bool validBoundary
) = 0;
//- Inserted patch at patchi
virtual void addPatch(const label patchi) = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -23,41 +23,14 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "MeshObject.H" #include "meshObjects.H"
/* * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * */
namespace Foam namespace Foam
{ {
defineTypeNameAndDebug(meshObjects, 0); defineTypeNameAndDebug(meshObjects, 0);
defineTypeNameAndDebug(typeMeshObject, 0);
} }
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::typeMeshObject::typeMeshObject
(
const word& typeName,
const objectRegistry& obr
)
:
regIOobject
(
IOobject
(
typeName,
obr.instance(),
obr
)
)
{}
Foam::typeMeshObject::typeMeshObject(const word& typeName, const IOobject& io)
:
regIOobject(io)
{}
// ************************************************************************* // // ************************************************************************* //

View File

@ -0,0 +1,154 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::meshObjects
Description
Templated abstract base-class for optional mesh objects used to automate
their allocation to the mesh database and the mesh-modifier event-loop.
MeshObject 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 MeshObject<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
Note:
movePoints must be provided for MeshObjects of type MoveableMeshObject
and both movePoints and topoChange functions must exist, provided for
MeshObjects of type UpdateableMeshObject.
SourceFiles
meshObject.C
meshObjects.C
\*---------------------------------------------------------------------------*/
#ifndef meshObjects_H
#define meshObjects_H
#include "objectRegistry.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declarations
class polyTopoChangeMap;
class polyMeshMap;
class polyDistributionMap;
/*---------------------------------------------------------------------------*\
Class meshObjects Declaration
\*---------------------------------------------------------------------------*/
class meshObjects
{
private:
//- Checkout and delete object if owned by registry
// otherwise error
template<class Mesh>
static void Delete(regIOobject&);
public:
ClassName("meshObjects");
template<class Mesh>
static void movePoints(objectRegistry&);
template<class Mesh>
static void topoChange(objectRegistry&, const polyTopoChangeMap&);
template<class Mesh>
static void mapMesh(objectRegistry&, const polyMeshMap&);
template<class Mesh>
static void distribute(objectRegistry&, const polyDistributionMap&);
template<class Mesh>
static void addPatch(objectRegistry&, const label patchi);
template<class Mesh>
static void reorderPatches
(
objectRegistry&,
const labelUList& newToOld,
const bool validBoundary
);
template<class Mesh, template<class> class MeshObjectType>
static void clear(objectRegistry&);
//- Clear all meshObjects derived from FromType up to (but not including)
// ToType. Used to clear e.g. all non-updateable meshObjects
template
<
class Mesh,
template<class> class FromType,
template<class> class ToType
>
static void clearUpto(objectRegistry&);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "meshObjectsTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -23,213 +23,35 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "MeshObject.H" #include "meshObjects.H"
#include "MeshObjects.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class Mesh, template<class> class MeshObjectType, class Type> template<class Mesh>
Foam::MeshObject<Mesh, MeshObjectType, Type>::MeshObject(const Mesh& mesh) void Foam::meshObjects::Delete(regIOobject& io)
:
MeshObjectType<Mesh>(Type::typeName, mesh.thisDb()),
mesh_(mesh)
{}
template<class Mesh, template<class> class MeshObjectType, class Type>
Foam::MeshObject<Mesh, MeshObjectType, Type>::MeshObject
(
const Mesh& mesh,
const IOobject& io
)
:
MeshObjectType<Mesh>(Type::typeName, io),
mesh_(mesh)
{}
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
template<class Mesh, template<class> class MeshObjectType, class Type>
Type& Foam::MeshObject<Mesh, MeshObjectType, Type>::New
(
Mesh& mesh
)
{ {
if (found(mesh)) if (meshObjects::debug)
{ {
return mesh.thisDb().objectRegistry::template lookupObjectRef<Type> Pout<< " Destroying " << io.name() << endl;
( }
Type::typeName
); if (io.ownedByRegistry())
{
io.checkOut();
} }
else else
{ {
if (meshObjects::debug) FatalErrorInFunction
{ << "Attempt to checkout and delete object " << io.name()
Pout<< "MeshObject::New(" << Mesh::typeName << " not owned by registry."
<< "&) : constructing " << Type::typeName << abort(FatalError);
<< " for region " << mesh.name() << endl;
} }
Type* objectPtr = new Type(mesh);
regIOobject::store(static_cast<MeshObjectType<Mesh>*>(objectPtr));
return *objectPtr;
}
}
template<class Mesh, template<class> class MeshObjectType, class Type>
const Type& Foam::MeshObject<Mesh, MeshObjectType, Type>::New
(
const Mesh& mesh
)
{
if (found(mesh))
{
return mesh.thisDb().objectRegistry::template lookupObjectRef<Type>
(
Type::typeName
);
}
else
{
if (meshObjects::debug)
{
Pout<< "MeshObject::New(const " << Mesh::typeName
<< "&) : constructing " << Type::typeName
<< " for region " << mesh.name() << endl;
}
Type* objectPtr = new Type(mesh);
regIOobject::store(static_cast<MeshObjectType<Mesh>*>(objectPtr));
return *objectPtr;
}
}
template<class Mesh, template<class> class MeshObjectType, class Type>
template<class... Args>
Type& Foam::MeshObject<Mesh, MeshObjectType, Type>::New
(
Mesh& mesh,
const Args&... args
)
{
if (found(mesh))
{
return mesh.thisDb().objectRegistry::template lookupObjectRef<Type>
(
Type::typeName
);
}
else
{
if (meshObjects::debug)
{
Pout<< "MeshObject::New(" << Mesh::typeName
<< "&, const Data1&) : constructing " << Type::typeName
<< " for region " << mesh.name() << endl;
}
Type* objectPtr = new Type(mesh, args...);
regIOobject::store(static_cast<MeshObjectType<Mesh>*>(objectPtr));
return *objectPtr;
}
}
template<class Mesh, template<class> class MeshObjectType, class Type>
template<class... Args>
const Type& Foam::MeshObject<Mesh, MeshObjectType, Type>::New
(
const Mesh& mesh,
const Args&... args
)
{
if (found(mesh))
{
return mesh.thisDb().objectRegistry::template lookupObject<Type>
(
Type::typeName
);
}
else
{
if (meshObjects::debug)
{
Pout<< "MeshObject::New(const " << Mesh::typeName
<< "&, const Data1&) : constructing " << Type::typeName
<< " for region " << mesh.name() << endl;
}
Type* objectPtr = new Type(mesh, args...);
regIOobject::store(static_cast<MeshObjectType<Mesh>*>(objectPtr));
return *objectPtr;
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
template<class Mesh, template<class> class MeshObjectType, class Type>
bool Foam::MeshObject<Mesh, MeshObjectType, Type>::Delete(const Mesh& mesh)
{
if (found(mesh))
{
if (meshObjects::debug)
{
Pout<< "MeshObject::Delete(const Mesh&) : deleting "
<< Type::typeName << endl;
}
return mesh.thisDb().checkOut
(
const_cast<Type&>
(
mesh.thisDb().objectRegistry::template lookupObject<Type>
(
Type::typeName
)
)
);
}
else
{
return false;
}
}
template<class Mesh, template<class> class MeshObjectType, class Type>
Foam::MeshObject<Mesh, MeshObjectType, Type>::~MeshObject()
{
MeshObjectType<Mesh>::release();
} }
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Mesh, template<class> class MeshObjectType, class Type>
bool Foam::MeshObject<Mesh, MeshObjectType, Type>::found
(
const Mesh& mesh
)
{
return mesh.thisDb().objectRegistry::template foundObject<Type>
(
Type::typeName
);
}
template<class Mesh> template<class Mesh>
void Foam::meshObjects::movePoints(objectRegistry& obr) void Foam::meshObjects::movePoints(objectRegistry& obr)
{ {
@ -256,17 +78,13 @@ void Foam::meshObjects::movePoints(objectRegistry& obr)
{ {
if (meshObjects::debug) if (meshObjects::debug)
{ {
Pout<< " Moving " << iter()->name() << endl; Pout<< " Moving " << iter()->io_.name() << endl;
} }
dynamic_cast<MoveableMeshObject<Mesh>*>(iter())->movePoints(); dynamic_cast<MoveableMeshObject<Mesh>*>(iter())->movePoints();
} }
else else
{ {
if (meshObjects::debug) Delete<Mesh>(iter()->io_);
{
Pout<< " Destroying " << iter()->name() << endl;
}
obr.checkOut(*iter());
} }
} }
} }
@ -303,18 +121,14 @@ void Foam::meshObjects::distribute
{ {
if (meshObjects::debug) if (meshObjects::debug)
{ {
Pout<< " Distributing " << iter()->name() << endl; Pout<< " Distributing " << iter()->io_.name() << endl;
} }
dynamic_cast<DistributeableMeshObject<Mesh>*>(iter()) dynamic_cast<DistributeableMeshObject<Mesh>*>(iter())
->distribute(map); ->distribute(map);
} }
else else
{ {
if (meshObjects::debug) Delete<Mesh>(iter()->io_);
{
Pout<< " Destroying " << iter()->name() << endl;
}
obr.checkOut(*iter());
} }
} }
} }
@ -350,17 +164,13 @@ void Foam::meshObjects::topoChange
{ {
if (meshObjects::debug) if (meshObjects::debug)
{ {
Pout<< " Updating " << iter()->name() << endl; Pout<< " Updating " << iter()->io_.name() << endl;
} }
dynamic_cast<UpdateableMeshObject<Mesh>*>(iter())->topoChange(map); dynamic_cast<UpdateableMeshObject<Mesh>*>(iter())->topoChange(map);
} }
else else
{ {
if (meshObjects::debug) Delete<Mesh>(iter()->io_);
{
Pout<< " Destroying " << iter()->name() << endl;
}
obr.checkOut(*iter());
} }
} }
} }
@ -396,17 +206,13 @@ void Foam::meshObjects::mapMesh
{ {
if (meshObjects::debug) if (meshObjects::debug)
{ {
Pout<< " Updating " << iter()->name() << endl; Pout<< " Updating " << iter()->io_.name() << endl;
} }
dynamic_cast<UpdateableMeshObject<Mesh>*>(iter())->mapMesh(map); dynamic_cast<UpdateableMeshObject<Mesh>*>(iter())->mapMesh(map);
} }
else else
{ {
if (meshObjects::debug) Delete<Mesh>(iter()->io_);
{
Pout<< " Destroying " << iter()->name() << endl;
}
obr.checkOut(*iter());
} }
} }
} }
@ -438,17 +244,13 @@ void Foam::meshObjects::addPatch(objectRegistry& obr, const label patchi)
{ {
if (meshObjects::debug) if (meshObjects::debug)
{ {
Pout<< " Adding patch to " << iter()->name() << endl; Pout<< " Adding patch to " << iter()->io_.name() << endl;
} }
dynamic_cast<PatchMeshObject<Mesh>*>(iter())->addPatch(patchi); dynamic_cast<PatchMeshObject<Mesh>*>(iter())->addPatch(patchi);
} }
else else
{ {
if (meshObjects::debug) Delete<Mesh>(iter()->io_);
{
Pout<< " Destroying " << iter()->name() << endl;
}
obr.checkOut(*iter());
} }
} }
} }
@ -485,7 +287,7 @@ void Foam::meshObjects::reorderPatches
{ {
if (meshObjects::debug) if (meshObjects::debug)
{ {
Pout<< " Adding patch to " << iter()->name() << endl; Pout<< " Adding patch to " << iter()->io_.name() << endl;
} }
dynamic_cast<PatchMeshObject<Mesh>*>(iter())->reorderPatches dynamic_cast<PatchMeshObject<Mesh>*>(iter())->reorderPatches
( (
@ -495,11 +297,7 @@ void Foam::meshObjects::reorderPatches
} }
else else
{ {
if (meshObjects::debug) Delete<Mesh>(iter()->io_);
{
Pout<< " Destroying " << iter()->name() << endl;
}
obr.checkOut(*iter());
} }
} }
} }
@ -522,11 +320,7 @@ void Foam::meshObjects::clear(objectRegistry& obr)
forAllIter(typename HashTable<MeshObjectType<Mesh>*>, meshObjects, iter) forAllIter(typename HashTable<MeshObjectType<Mesh>*>, meshObjects, iter)
{ {
if (meshObjects::debug) Delete<Mesh>(iter()->io_);
{
Pout<< " Destroying " << iter()->name() << endl;
}
obr.checkOut(*iter());
} }
} }
@ -555,11 +349,7 @@ void Foam::meshObjects::clearUpto(objectRegistry& obr)
{ {
if (!isA<ToType<Mesh>>(*iter())) if (!isA<ToType<Mesh>>(*iter()))
{ {
if (meshObjects::debug) Delete<Mesh>(iter()->io_);
{
Pout<< " Destroying " << iter()->name() << endl;
}
obr.checkOut(*iter());
} }
} }
} }

View File

@ -41,7 +41,7 @@ namespace Foam
Foam::pointMesh::pointMesh(const polyMesh& pMesh) Foam::pointMesh::pointMesh(const polyMesh& pMesh)
: :
MeshObject<polyMesh, Foam::PatchMeshObject, pointMesh>(pMesh), DemandDrivenMeshObject<polyMesh, PatchMeshObject, pointMesh>(pMesh),
GeoMesh<polyMesh>(pMesh), GeoMesh<polyMesh>(pMesh),
boundary_(*this, pMesh.boundaryMesh()) boundary_(*this, pMesh.boundaryMesh())
{ {

View File

@ -33,7 +33,7 @@ Description
#define pointMesh_H #define pointMesh_H
#include "GeoMesh.H" #include "GeoMesh.H"
#include "MeshObject.H" #include "DemandDrivenMeshObject.H"
#include "polyMesh.H" #include "polyMesh.H"
#include "pointBoundaryMesh.H" #include "pointBoundaryMesh.H"
@ -48,7 +48,7 @@ namespace Foam
class pointMesh class pointMesh
: :
public MeshObject<polyMesh, PatchMeshObject, pointMesh>, public DemandDrivenMeshObject<polyMesh, PatchMeshObject, pointMesh>,
public GeoMesh<polyMesh> public GeoMesh<polyMesh>
{ {
// Permanent data // Permanent data
@ -57,6 +57,16 @@ class pointMesh
pointBoundaryMesh boundary_; pointBoundaryMesh boundary_;
protected:
friend class DemandDrivenMeshObject<polyMesh, PatchMeshObject, pointMesh>;
// Protected Constructors
//- Construct from polyMesh
explicit pointMesh(const polyMesh& pMesh);
public: public:
// Declare name of the class and its debug switch // Declare name of the class and its debug switch
@ -69,9 +79,6 @@ public:
// Constructors // Constructors
//- Construct from polyMesh
explicit pointMesh(const polyMesh& pMesh);
//- Disallow default bitwise copy construction //- Disallow default bitwise copy construction
pointMesh(const pointMesh&) = delete; pointMesh(const pointMesh&) = delete;

View File

@ -33,7 +33,7 @@ License
#include "polyMeshTetDecomposition.H" #include "polyMeshTetDecomposition.H"
#include "indexedOctree.H" #include "indexedOctree.H"
#include "treeDataCell.H" #include "treeDataCell.H"
#include "MeshObject.H" #include "meshObjects.H"
#include "pointMesh.H" #include "pointMesh.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

View File

@ -26,7 +26,7 @@ License
#include "polyMesh.H" #include "polyMesh.H"
#include "primitiveMesh.H" #include "primitiveMesh.H"
#include "globalMeshData.H" #include "globalMeshData.H"
#include "MeshObject.H" #include "meshObjects.H"
#include "indexedOctree.H" #include "indexedOctree.H"
#include "treeDataCell.H" #include "treeDataCell.H"
#include "pointMesh.H" #include "pointMesh.H"

View File

@ -53,6 +53,8 @@ Fickian<BasicThermophysicalTransportModel>::Fickian
thermo thermo
), ),
UpdateableMeshObject(*this, thermo.mesh()),
mixtureDiffusionCoefficients_(true), mixtureDiffusionCoefficients_(true),
DFuncs_(this->thermo().composition().species().size()), DFuncs_(this->thermo().composition().species().size()),
@ -504,6 +506,43 @@ void Fickian<BasicThermophysicalTransportModel>::correct()
} }
template<class BasicThermophysicalTransportModel>
bool Fickian<BasicThermophysicalTransportModel>::movePoints()
{
return true;
}
template<class BasicThermophysicalTransportModel>
void Fickian<BasicThermophysicalTransportModel>::topoChange
(
const polyTopoChangeMap& map
)
{
correct();
}
template<class BasicThermophysicalTransportModel>
void Fickian<BasicThermophysicalTransportModel>::mapMesh
(
const polyMeshMap& map
)
{
correct();
}
template<class BasicThermophysicalTransportModel>
void Fickian<BasicThermophysicalTransportModel>::distribute
(
const polyDistributionMap& map
)
{
correct();
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam } // End namespace Foam

View File

@ -41,6 +41,7 @@ SourceFiles
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "Function2.H" #include "Function2.H"
#include "MeshObjects.H"
#ifndef Fickian_H #ifndef Fickian_H
#define Fickian_H #define Fickian_H
@ -57,7 +58,8 @@ namespace Foam
template<class BasicThermophysicalTransportModel> template<class BasicThermophysicalTransportModel>
class Fickian class Fickian
: :
public BasicThermophysicalTransportModel public BasicThermophysicalTransportModel,
public UpdateableMeshObject<fvMesh>
{ {
// Private data // Private data
@ -143,6 +145,21 @@ public:
//- Update the diffusion coefficients //- Update the diffusion coefficients
virtual void correct(); virtual void correct();
// Mesh changes
//- Update for mesh motion
virtual bool movePoints();
//- Update topology using the given map
virtual void topoChange(const polyTopoChangeMap& map);
//- Update from another mesh using the given map
virtual void mapMesh(const polyMeshMap& map);
//- Redistribute or update using the given distribution map
virtual void distribute(const polyDistributionMap& map);
}; };

View File

@ -51,6 +51,8 @@ namespace solidThermophysicalTransportModels
void Foam::solidThermophysicalTransportModels::anisotropic:: void Foam::solidThermophysicalTransportModels::anisotropic::
setZonesPatchFaces() const setZonesPatchFaces() const
{ {
if (!zoneCoordinateSystems_.size()) return;
// Find all the patch faces adjacent to zones // Find all the patch faces adjacent to zones
const fvMesh& mesh = thermo().mesh(); const fvMesh& mesh = thermo().mesh();
@ -114,6 +116,7 @@ Foam::solidThermophysicalTransportModels::anisotropic::anisotropic
) )
: :
solidThermophysicalTransportModel(typeName, thermo), solidThermophysicalTransportModel(typeName, thermo),
UpdateableMeshObject(*this, thermo.mesh()),
coordinateSystem_(coordinateSystem::New(thermo.mesh(), coeffDict())), coordinateSystem_(coordinateSystem::New(thermo.mesh(), coeffDict())),
boundaryAligned_ boundaryAligned_
( (
@ -226,11 +229,6 @@ Foam::solidThermophysicalTransportModels::anisotropic::Kappa() const
const solidThermo& thermo = this->thermo(); const solidThermo& thermo = this->thermo();
const fvMesh& mesh = thermo.mesh(); const fvMesh& mesh = thermo.mesh();
if (zoneCoordinateSystems_.size() && mesh.topoChanged())
{
setZonesPatchFaces();
}
const volVectorField& materialKappa = thermo.Kappa(); const volVectorField& materialKappa = thermo.Kappa();
tmp<volSymmTensorField> tKappa tmp<volSymmTensorField> tKappa
@ -442,4 +440,37 @@ void Foam::solidThermophysicalTransportModels::anisotropic::correct()
} }
bool Foam::solidThermophysicalTransportModels::anisotropic::movePoints()
{
return true;
}
void Foam::solidThermophysicalTransportModels::anisotropic::topoChange
(
const polyTopoChangeMap& map
)
{
setZonesPatchFaces();
}
void Foam::solidThermophysicalTransportModels::anisotropic::mapMesh
(
const polyMeshMap& map
)
{
setZonesPatchFaces();
}
void Foam::solidThermophysicalTransportModels::anisotropic::distribute
(
const polyDistributionMap& map
)
{
setZonesPatchFaces();
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -101,6 +101,7 @@ SourceFiles
#include "solidThermophysicalTransportModel.H" #include "solidThermophysicalTransportModel.H"
#include "coordinateSystem.H" #include "coordinateSystem.H"
#include "PtrDictionary.H" #include "PtrDictionary.H"
#include "MeshObjects.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -115,7 +116,8 @@ namespace solidThermophysicalTransportModels
class anisotropic class anisotropic
: :
public solidThermophysicalTransportModel public solidThermophysicalTransportModel,
public UpdateableMeshObject<fvMesh>
{ {
// Private member data // Private member data
@ -186,6 +188,21 @@ public:
//- Correct the anisotropic viscosity //- Correct the anisotropic viscosity
virtual void correct(); virtual void correct();
// Mesh changes
//- Update for mesh motion
virtual bool movePoints();
//- Update topology using the given map
virtual void topoChange(const polyTopoChangeMap& map);
//- Update from another mesh using the given map
virtual void mapMesh(const polyMeshMap& map);
//- Redistribute or update using the given distribution map
virtual void distribute(const polyDistributionMap& map);
}; };

View File

@ -140,7 +140,7 @@ Foam::fvConstraints::fvConstraints
const fvMesh& mesh const fvMesh& mesh
) )
: :
MeshObject<fvMesh, Foam::UpdateableMeshObject, fvConstraints> DemandDrivenMeshObject<fvMesh, Foam::UpdateableMeshObject, fvConstraints>
( (
mesh, mesh,
createIOobject(mesh) createIOobject(mesh)

View File

@ -37,7 +37,7 @@ SourceFiles
#include "fvConstraint.H" #include "fvConstraint.H"
#include "PtrListDictionary.H" #include "PtrListDictionary.H"
#include "MeshObject.H" #include "DemandDrivenMeshObject.H"
#include "HashSet.H" #include "HashSet.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -57,7 +57,7 @@ Ostream& operator<<(Ostream& os, const fvConstraints& constraints);
class fvConstraints class fvConstraints
: :
public MeshObject<fvMesh, UpdateableMeshObject, fvConstraints>, public DemandDrivenMeshObject<fvMesh, UpdateableMeshObject, fvConstraints>,
public dictionary, public dictionary,
public PtrListDictionary<fvConstraint> public PtrListDictionary<fvConstraint>
{ {
@ -94,7 +94,12 @@ public:
fvConstraints(const fvConstraints&) = delete; fvConstraints(const fvConstraints&) = delete;
//- Inherit the base New method //- Inherit the base New method
using MeshObject<fvMesh, UpdateableMeshObject, fvConstraints>::New; using DemandDrivenMeshObject
<
fvMesh,
UpdateableMeshObject,
fvConstraints
>::New;
//- Destructor //- Destructor

View File

@ -41,7 +41,6 @@ SourceFiles
#include "dimensionSet.H" #include "dimensionSet.H"
#include "fvModelM.H" #include "fvModelM.H"
#include "geometricOneField.H" #include "geometricOneField.H"
#include "MeshObject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -140,7 +140,7 @@ Foam::fvModels::fvModels
const fvMesh& mesh const fvMesh& mesh
) )
: :
MeshObject<fvMesh, Foam::UpdateableMeshObject, fvModels> DemandDrivenMeshObject<fvMesh, Foam::UpdateableMeshObject, fvModels>
( (
mesh, mesh,
createIOobject(mesh) createIOobject(mesh)

View File

@ -37,7 +37,7 @@ SourceFiles
#include "fvModel.H" #include "fvModel.H"
#include "PtrListDictionary.H" #include "PtrListDictionary.H"
#include "MeshObject.H" #include "DemandDrivenMeshObject.H"
#include "HashSet.H" #include "HashSet.H"
#include "volFields.H" #include "volFields.H"
#include "geometricOneField.H" #include "geometricOneField.H"
@ -60,7 +60,7 @@ Ostream& operator<<(Ostream& os, const fvModels& models);
class fvModels class fvModels
: :
public MeshObject<fvMesh, UpdateableMeshObject, fvModels>, public DemandDrivenMeshObject<fvMesh, UpdateableMeshObject, fvModels>,
public dictionary, public dictionary,
public PtrListDictionary<fvModel> public PtrListDictionary<fvModel>
{ {
@ -92,6 +92,17 @@ class fvModels
) const; ) const;
protected:
friend class DemandDrivenMeshObject<fvMesh, UpdateableMeshObject, fvModels>;
// Protected Constructors
//- Construct from components with list of field names
explicit fvModels(const fvMesh& mesh);
public: public:
//- Runtime type information //- Runtime type information
@ -100,14 +111,16 @@ public:
// Constructors // Constructors
//- Construct from components with list of field names
fvModels(const fvMesh& mesh);
//- Disallow default bitwise copy construction //- Disallow default bitwise copy construction
fvModels(const fvModels&) = delete; fvModels(const fvModels&) = delete;
//- Inherit the base New method //- Inherit the base New method
using MeshObject<fvMesh, UpdateableMeshObject, fvModels>::New; using DemandDrivenMeshObject
<
fvMesh,
UpdateableMeshObject,
fvModels
>::New;
//- Destructor //- Destructor

View File

@ -166,13 +166,13 @@ Foam::tmp<Foam::fvMatrix<Type>> Foam::fvModels::source
IOobject IOobject
( (
"one", "one",
this->mesh_.time().name(), this->mesh().time().name(),
this->mesh_, this->mesh(),
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false false
), ),
this->mesh_, this->mesh(),
dimensionedScalar(dimless, 1.0) dimensionedScalar(dimless, 1.0)
); );

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -33,7 +33,12 @@ Foam::fv::LeastSquaresVectors<Stencil>::LeastSquaresVectors
const fvMesh& mesh const fvMesh& mesh
) )
: :
MeshObject<fvMesh, Foam::MoveableMeshObject, LeastSquaresVectors>(mesh), DemandDrivenMeshObject
<
fvMesh,
MoveableMeshObject,
LeastSquaresVectors
>(mesh),
vectors_(mesh.nCells()) vectors_(mesh.nCells())
{ {
calcLeastSquaresVectors(); calcLeastSquaresVectors();
@ -57,7 +62,7 @@ void Foam::fv::LeastSquaresVectors<Stencil>::calcLeastSquaresVectors()
InfoInFunction << "Calculating least square gradient vectors" << endl; InfoInFunction << "Calculating least square gradient vectors" << endl;
} }
const fvMesh& mesh = this->mesh_; const fvMesh& mesh = this->mesh();
const extendedCentredCellToCellStencil& stencil = this->stencil(); const extendedCentredCellToCellStencil& stencil = this->stencil();
stencil.collectData(mesh.C(), vectors_); stencil.collectData(mesh.C(), vectors_);

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -39,7 +39,7 @@ SourceFiles
#define LeastSquaresVectors_H #define LeastSquaresVectors_H
#include "extendedCentredCellToCellStencil.H" #include "extendedCentredCellToCellStencil.H"
#include "MeshObject.H" #include "DemandDrivenMeshObject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -58,7 +58,12 @@ namespace fv
template<class Stencil> template<class Stencil>
class LeastSquaresVectors class LeastSquaresVectors
: :
public MeshObject<fvMesh, MoveableMeshObject, LeastSquaresVectors<Stencil>> public DemandDrivenMeshObject
<
fvMesh,
MoveableMeshObject,
LeastSquaresVectors<Stencil>
>
{ {
// Private Data // Private Data
@ -72,13 +77,16 @@ class LeastSquaresVectors
void calcLeastSquaresVectors(); void calcLeastSquaresVectors();
public: protected:
// Declare name of the class and its debug switch friend class DemandDrivenMeshObject
TypeName("LeastSquaresVectors"); <
fvMesh,
MoveableMeshObject,
LeastSquaresVectors<Stencil>
>;
// Protected Constructors
// Constructors
//- Construct given an fvMesh and the minimum determinant criterion //- Construct given an fvMesh and the minimum determinant criterion
LeastSquaresVectors LeastSquaresVectors
@ -87,6 +95,12 @@ public:
); );
public:
// Declare name of the class and its debug switch
TypeName("LeastSquaresVectors");
//- Destructor //- Destructor
virtual ~LeastSquaresVectors(); virtual ~LeastSquaresVectors();
@ -96,7 +110,7 @@ public:
//- Return reference to the stencil //- Return reference to the stencil
const extendedCentredCellToCellStencil& stencil() const const extendedCentredCellToCellStencil& stencil() const
{ {
return Stencil::New(this->mesh_); return Stencil::New(this->mesh());
} }
//- Return reference to the least square vectors //- Return reference to the least square vectors

View File

@ -38,19 +38,24 @@ namespace Foam
Foam::leastSquaresVectors::leastSquaresVectors(const fvMesh& mesh) Foam::leastSquaresVectors::leastSquaresVectors(const fvMesh& mesh)
: :
MeshObject<fvMesh, Foam::MoveableMeshObject, leastSquaresVectors>(mesh), DemandDrivenMeshObject
<
fvMesh,
MoveableMeshObject,
leastSquaresVectors
>(mesh),
pVectors_ pVectors_
( (
IOobject IOobject
( (
"LeastSquaresP", "LeastSquaresP",
mesh_.pointsInstance(), mesh.pointsInstance(),
mesh_, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false false
), ),
mesh_, mesh,
dimensionedVector(dimless/dimLength, Zero) dimensionedVector(dimless/dimLength, Zero)
), ),
nVectors_ nVectors_
@ -58,13 +63,13 @@ Foam::leastSquaresVectors::leastSquaresVectors(const fvMesh& mesh)
IOobject IOobject
( (
"LeastSquaresN", "LeastSquaresN",
mesh_.pointsInstance(), mesh.pointsInstance(),
mesh_, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false false
), ),
mesh_, mesh,
dimensionedVector(dimless/dimLength, Zero) dimensionedVector(dimless/dimLength, Zero)
) )
{ {
@ -87,11 +92,11 @@ void Foam::leastSquaresVectors::calcLeastSquaresVectors()
InfoInFunction << "Calculating least square gradient vectors" << endl; InfoInFunction << "Calculating least square gradient vectors" << endl;
} }
const fvMesh& mesh = mesh_; const fvMesh& mesh = this->mesh();
// Set local references to mesh data // Set local references to mesh data
const labelUList& owner = mesh_.owner(); const labelUList& owner = mesh.owner();
const labelUList& neighbour = mesh_.neighbour(); const labelUList& neighbour = mesh.neighbour();
const volVectorField& C = mesh.C(); const volVectorField& C = mesh.C();
const surfaceScalarField& w = mesh.weights(); const surfaceScalarField& w = mesh.weights();
@ -99,7 +104,7 @@ void Foam::leastSquaresVectors::calcLeastSquaresVectors()
// Set up temporary storage for the dd tensor (before inversion) // Set up temporary storage for the dd tensor (before inversion)
symmTensorField dd(mesh_.nCells(), Zero); symmTensorField dd(mesh().nCells(), Zero);
forAll(owner, facei) forAll(owner, facei)
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -35,7 +35,7 @@ SourceFiles
#ifndef leastSquaresVectors_H #ifndef leastSquaresVectors_H
#define leastSquaresVectors_H #define leastSquaresVectors_H
#include "MeshObject.H" #include "DemandDrivenMeshObject.H"
#include "fvMesh.H" #include "fvMesh.H"
#include "surfaceFields.H" #include "surfaceFields.H"
@ -50,7 +50,12 @@ namespace Foam
class leastSquaresVectors class leastSquaresVectors
: :
public MeshObject<fvMesh, MoveableMeshObject, leastSquaresVectors> public DemandDrivenMeshObject
<
fvMesh,
MoveableMeshObject,
leastSquaresVectors
>
{ {
// Private Data // Private Data
@ -65,18 +70,27 @@ class leastSquaresVectors
void calcLeastSquaresVectors(); void calcLeastSquaresVectors();
protected:
friend class DemandDrivenMeshObject
<
fvMesh,
MoveableMeshObject,
leastSquaresVectors
>;
// Protected Constructors
//- Construct given an fvMesh
explicit leastSquaresVectors(const fvMesh&);
public: public:
// Declare name of the class and its debug switch // Declare name of the class and its debug switch
TypeName("leastSquaresVectors"); TypeName("leastSquaresVectors");
// Constructors
//- Construct given an fvMesh
explicit leastSquaresVectors(const fvMesh&);
//- Destructor //- Destructor
virtual ~leastSquaresVectors(); virtual ~leastSquaresVectors();

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -35,7 +35,7 @@ SourceFiles
#include "extendedCentredCellToCellStencil.H" #include "extendedCentredCellToCellStencil.H"
#include "CECCellToCellStencil.H" #include "CECCellToCellStencil.H"
#include "MeshObject.H" #include "DemandDrivenMeshObject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -48,7 +48,7 @@ namespace Foam
class centredCECCellToCellStencilObject class centredCECCellToCellStencilObject
: :
public MeshObject public DemandDrivenMeshObject
< <
fvMesh, fvMesh,
TopologicalMeshObject, TopologicalMeshObject,
@ -57,11 +57,16 @@ class centredCECCellToCellStencilObject
public extendedCentredCellToCellStencil public extendedCentredCellToCellStencil
{ {
public: protected:
TypeName("centredCECCellToCellStencil"); friend class DemandDrivenMeshObject
<
fvMesh,
TopologicalMeshObject,
centredCECCellToCellStencilObject
>;
// Constructors // Protected Constructors
//- Construct from uncompacted cell stencil //- Construct from uncompacted cell stencil
explicit centredCECCellToCellStencilObject explicit centredCECCellToCellStencilObject
@ -69,16 +74,20 @@ public:
const fvMesh& mesh const fvMesh& mesh
) )
: :
MeshObject DemandDrivenMeshObject
< <
fvMesh, fvMesh,
Foam::TopologicalMeshObject, TopologicalMeshObject,
centredCECCellToCellStencilObject centredCECCellToCellStencilObject
>(mesh), >(mesh),
extendedCentredCellToCellStencil(CECCellToCellStencil(mesh)) extendedCentredCellToCellStencil(CECCellToCellStencil(mesh))
{} {}
public:
TypeName("centredCECCellToCellStencil");
//- Destructor //- Destructor
virtual ~centredCECCellToCellStencilObject() virtual ~centredCECCellToCellStencilObject()
{} {}

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -35,7 +35,7 @@ SourceFiles
#include "extendedCentredCellToCellStencil.H" #include "extendedCentredCellToCellStencil.H"
#include "CFCCellToCellStencil.H" #include "CFCCellToCellStencil.H"
#include "MeshObject.H" #include "DemandDrivenMeshObject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -48,7 +48,7 @@ namespace Foam
class centredCFCCellToCellStencilObject class centredCFCCellToCellStencilObject
: :
public MeshObject public DemandDrivenMeshObject
< <
fvMesh, fvMesh,
TopologicalMeshObject, TopologicalMeshObject,
@ -57,11 +57,16 @@ class centredCFCCellToCellStencilObject
public extendedCentredCellToCellStencil public extendedCentredCellToCellStencil
{ {
public: protected:
TypeName("centredCFCCellToCellStencil"); friend class DemandDrivenMeshObject
<
fvMesh,
TopologicalMeshObject,
centredCFCCellToCellStencilObject
>;
// Constructors // Protected Constructors
//- Construct from uncompacted cell stencil //- Construct from uncompacted cell stencil
explicit centredCFCCellToCellStencilObject explicit centredCFCCellToCellStencilObject
@ -69,15 +74,18 @@ public:
const fvMesh& mesh const fvMesh& mesh
) )
: :
MeshObject DemandDrivenMeshObject
< <
fvMesh, fvMesh,
Foam::TopologicalMeshObject, TopologicalMeshObject,
centredCFCCellToCellStencilObject centredCFCCellToCellStencilObject
>(mesh), >(mesh),
extendedCentredCellToCellStencil(CFCCellToCellStencil(mesh)) extendedCentredCellToCellStencil(CFCCellToCellStencil(mesh))
{} {}
public:
TypeName("centredCFCCellToCellStencil");
//- Destructor //- Destructor
virtual ~centredCFCCellToCellStencilObject() virtual ~centredCFCCellToCellStencilObject()

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -35,7 +35,7 @@ SourceFiles
#include "extendedCentredCellToCellStencil.H" #include "extendedCentredCellToCellStencil.H"
#include "CPCCellToCellStencil.H" #include "CPCCellToCellStencil.H"
#include "MeshObject.H" #include "DemandDrivenMeshObject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -48,7 +48,7 @@ namespace Foam
class centredCPCCellToCellStencilObject class centredCPCCellToCellStencilObject
: :
public MeshObject public DemandDrivenMeshObject
< <
fvMesh, fvMesh,
TopologicalMeshObject, TopologicalMeshObject,
@ -57,11 +57,16 @@ class centredCPCCellToCellStencilObject
public extendedCentredCellToCellStencil public extendedCentredCellToCellStencil
{ {
public: protected:
TypeName("centredCPCCellToCellStencil"); friend class DemandDrivenMeshObject
<
fvMesh,
TopologicalMeshObject,
centredCPCCellToCellStencilObject
>;
// Constructors // Protected Constructors
//- Construct from uncompacted cell stencil //- Construct from uncompacted cell stencil
explicit centredCPCCellToCellStencilObject explicit centredCPCCellToCellStencilObject
@ -69,16 +74,20 @@ public:
const fvMesh& mesh const fvMesh& mesh
) )
: :
MeshObject DemandDrivenMeshObject
< <
fvMesh, fvMesh,
Foam::TopologicalMeshObject, TopologicalMeshObject,
centredCPCCellToCellStencilObject centredCPCCellToCellStencilObject
>(mesh), >(mesh),
extendedCentredCellToCellStencil(CPCCellToCellStencil(mesh)) extendedCentredCellToCellStencil(CPCCellToCellStencil(mesh))
{} {}
public:
TypeName("centredCPCCellToCellStencil");
//- Destructor //- Destructor
virtual ~centredCPCCellToCellStencilObject() virtual ~centredCPCCellToCellStencilObject()
{} {}

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -35,7 +35,7 @@ SourceFiles
#include "extendedCentredCellToFaceStencil.H" #include "extendedCentredCellToFaceStencil.H"
#include "CECCellToFaceStencil.H" #include "CECCellToFaceStencil.H"
#include "MeshObject.H" #include "DemandDrivenMeshObject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -48,7 +48,7 @@ namespace Foam
class centredCECCellToFaceStencilObject class centredCECCellToFaceStencilObject
: :
public MeshObject public DemandDrivenMeshObject
< <
fvMesh, fvMesh,
TopologicalMeshObject, TopologicalMeshObject,
@ -57,11 +57,16 @@ class centredCECCellToFaceStencilObject
public extendedCentredCellToFaceStencil public extendedCentredCellToFaceStencil
{ {
public: protected:
TypeName("centredCECCellToFaceStencil"); friend class DemandDrivenMeshObject
<
fvMesh,
TopologicalMeshObject,
centredCECCellToFaceStencilObject
>;
// Constructors // Protected Constructors
//- Construct from uncompacted face stencil //- Construct from uncompacted face stencil
explicit centredCECCellToFaceStencilObject explicit centredCECCellToFaceStencilObject
@ -69,10 +74,10 @@ public:
const fvMesh& mesh const fvMesh& mesh
) )
: :
MeshObject DemandDrivenMeshObject
< <
fvMesh, fvMesh,
Foam::TopologicalMeshObject, TopologicalMeshObject,
centredCECCellToFaceStencilObject centredCECCellToFaceStencilObject
>(mesh), >(mesh),
extendedCentredCellToFaceStencil(CECCellToFaceStencil(mesh)) extendedCentredCellToFaceStencil(CECCellToFaceStencil(mesh))
@ -86,6 +91,10 @@ public:
} }
public:
TypeName("centredCECCellToFaceStencil");
//- Destructor //- Destructor
virtual ~centredCECCellToFaceStencilObject() virtual ~centredCECCellToFaceStencilObject()
{} {}

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -35,7 +35,7 @@ SourceFiles
#include "extendedCentredCellToFaceStencil.H" #include "extendedCentredCellToFaceStencil.H"
#include "CFCCellToFaceStencil.H" #include "CFCCellToFaceStencil.H"
#include "MeshObject.H" #include "DemandDrivenMeshObject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -48,7 +48,7 @@ namespace Foam
class centredCFCCellToFaceStencilObject class centredCFCCellToFaceStencilObject
: :
public MeshObject public DemandDrivenMeshObject
< <
fvMesh, fvMesh,
TopologicalMeshObject, TopologicalMeshObject,
@ -57,11 +57,16 @@ class centredCFCCellToFaceStencilObject
public extendedCentredCellToFaceStencil public extendedCentredCellToFaceStencil
{ {
public: protected:
TypeName("centredCFCCellToFaceStencil"); friend class DemandDrivenMeshObject
<
fvMesh,
TopologicalMeshObject,
centredCFCCellToFaceStencilObject
>;
// Constructors // Protected Constructors
//- Construct from uncompacted face stencil //- Construct from uncompacted face stencil
explicit centredCFCCellToFaceStencilObject explicit centredCFCCellToFaceStencilObject
@ -69,10 +74,10 @@ public:
const fvMesh& mesh const fvMesh& mesh
) )
: :
MeshObject DemandDrivenMeshObject
< <
fvMesh, fvMesh,
Foam::TopologicalMeshObject, TopologicalMeshObject,
centredCFCCellToFaceStencilObject centredCFCCellToFaceStencilObject
>(mesh), >(mesh),
extendedCentredCellToFaceStencil(CFCCellToFaceStencil(mesh)) extendedCentredCellToFaceStencil(CFCCellToFaceStencil(mesh))
@ -86,6 +91,10 @@ public:
} }
public:
TypeName("centredCFCCellToFaceStencil");
//- Destructor //- Destructor
virtual ~centredCFCCellToFaceStencilObject() virtual ~centredCFCCellToFaceStencilObject()
{} {}

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -35,7 +35,7 @@ SourceFiles
#include "extendedCentredCellToFaceStencil.H" #include "extendedCentredCellToFaceStencil.H"
#include "CPCCellToFaceStencil.H" #include "CPCCellToFaceStencil.H"
#include "MeshObject.H" #include "DemandDrivenMeshObject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -48,7 +48,7 @@ namespace Foam
class centredCPCCellToFaceStencilObject class centredCPCCellToFaceStencilObject
: :
public MeshObject public DemandDrivenMeshObject
< <
fvMesh, fvMesh,
TopologicalMeshObject, TopologicalMeshObject,
@ -57,11 +57,16 @@ class centredCPCCellToFaceStencilObject
public extendedCentredCellToFaceStencil public extendedCentredCellToFaceStencil
{ {
public: protected:
TypeName("centredCPCCellToFaceStencil"); friend class DemandDrivenMeshObject
<
fvMesh,
TopologicalMeshObject,
centredCPCCellToFaceStencilObject
>;
// Constructors // Protected Constructors
//- Construct from uncompacted face stencil //- Construct from uncompacted face stencil
explicit centredCPCCellToFaceStencilObject explicit centredCPCCellToFaceStencilObject
@ -69,10 +74,10 @@ public:
const fvMesh& mesh const fvMesh& mesh
) )
: :
MeshObject DemandDrivenMeshObject
< <
fvMesh, fvMesh,
Foam::TopologicalMeshObject, TopologicalMeshObject,
centredCPCCellToFaceStencilObject centredCPCCellToFaceStencilObject
>(mesh), >(mesh),
extendedCentredCellToFaceStencil(CPCCellToFaceStencil(mesh)) extendedCentredCellToFaceStencil(CPCCellToFaceStencil(mesh))
@ -86,6 +91,10 @@ public:
} }
public:
TypeName("centredCPCCellToFaceStencil");
//- Destructor //- Destructor
virtual ~centredCPCCellToFaceStencilObject() virtual ~centredCPCCellToFaceStencilObject()
{} {}

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -35,7 +35,7 @@ SourceFiles
#include "extendedCentredCellToFaceStencil.H" #include "extendedCentredCellToFaceStencil.H"
#include "FECCellToFaceStencil.H" #include "FECCellToFaceStencil.H"
#include "MeshObject.H" #include "DemandDrivenMeshObject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -48,7 +48,7 @@ namespace Foam
class centredFECCellToFaceStencilObject class centredFECCellToFaceStencilObject
: :
public MeshObject public DemandDrivenMeshObject
< <
fvMesh, fvMesh,
TopologicalMeshObject, TopologicalMeshObject,
@ -57,11 +57,16 @@ class centredFECCellToFaceStencilObject
public extendedCentredCellToFaceStencil public extendedCentredCellToFaceStencil
{ {
public: protected:
TypeName("centredFECCellToFaceStencil"); friend class DemandDrivenMeshObject
<
fvMesh,
TopologicalMeshObject,
centredFECCellToFaceStencilObject
>;
// Constructors // Protected Constructors
//- Construct from uncompacted face stencil //- Construct from uncompacted face stencil
explicit centredFECCellToFaceStencilObject explicit centredFECCellToFaceStencilObject
@ -69,10 +74,10 @@ public:
const fvMesh& mesh const fvMesh& mesh
) )
: :
MeshObject DemandDrivenMeshObject
< <
fvMesh, fvMesh,
Foam::TopologicalMeshObject, TopologicalMeshObject,
centredFECCellToFaceStencilObject centredFECCellToFaceStencilObject
>(mesh), >(mesh),
extendedCentredCellToFaceStencil(FECCellToFaceStencil(mesh)) extendedCentredCellToFaceStencil(FECCellToFaceStencil(mesh))
@ -86,6 +91,10 @@ public:
} }
public:
TypeName("centredFECCellToFaceStencil");
//- Destructor //- Destructor
virtual ~centredFECCellToFaceStencilObject() virtual ~centredFECCellToFaceStencilObject()
{} {}

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -35,7 +35,7 @@ SourceFiles
#include "extendedUpwindCellToFaceStencil.H" #include "extendedUpwindCellToFaceStencil.H"
#include "CFCCellToFaceStencil.H" #include "CFCCellToFaceStencil.H"
#include "MeshObject.H" #include "DemandDrivenMeshObject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -48,7 +48,7 @@ namespace Foam
class pureUpwindCFCCellToFaceStencilObject class pureUpwindCFCCellToFaceStencilObject
: :
public MeshObject public DemandDrivenMeshObject
< <
fvMesh, fvMesh,
TopologicalMeshObject, TopologicalMeshObject,
@ -57,11 +57,16 @@ class pureUpwindCFCCellToFaceStencilObject
public extendedUpwindCellToFaceStencil public extendedUpwindCellToFaceStencil
{ {
public: protected:
TypeName("pureUpwindCFCCellToFaceStencil"); friend class DemandDrivenMeshObject
<
fvMesh,
TopologicalMeshObject,
pureUpwindCFCCellToFaceStencilObject
>;
// Constructors // Protected Constructors
//- Construct from uncompacted face stencil //- Construct from uncompacted face stencil
explicit pureUpwindCFCCellToFaceStencilObject explicit pureUpwindCFCCellToFaceStencilObject
@ -69,10 +74,10 @@ public:
const fvMesh& mesh const fvMesh& mesh
) )
: :
MeshObject DemandDrivenMeshObject
< <
fvMesh, fvMesh,
Foam::TopologicalMeshObject, TopologicalMeshObject,
pureUpwindCFCCellToFaceStencilObject pureUpwindCFCCellToFaceStencilObject
>(mesh), >(mesh),
extendedUpwindCellToFaceStencil(CFCCellToFaceStencil(mesh)) extendedUpwindCellToFaceStencil(CFCCellToFaceStencil(mesh))
@ -86,6 +91,10 @@ public:
} }
public:
TypeName("pureUpwindCFCCellToFaceStencil");
//- Destructor //- Destructor
virtual ~pureUpwindCFCCellToFaceStencilObject() virtual ~pureUpwindCFCCellToFaceStencilObject()
{} {}

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -35,7 +35,7 @@ SourceFiles
#include "extendedUpwindCellToFaceStencil.H" #include "extendedUpwindCellToFaceStencil.H"
#include "CECCellToFaceStencil.H" #include "CECCellToFaceStencil.H"
#include "MeshObject.H" #include "DemandDrivenMeshObject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -48,7 +48,7 @@ namespace Foam
class upwindCECCellToFaceStencilObject class upwindCECCellToFaceStencilObject
: :
public MeshObject public DemandDrivenMeshObject
< <
fvMesh, fvMesh,
TopologicalMeshObject, TopologicalMeshObject,
@ -57,11 +57,16 @@ class upwindCECCellToFaceStencilObject
public extendedUpwindCellToFaceStencil public extendedUpwindCellToFaceStencil
{ {
public: protected:
TypeName("upwindCECCellToFaceStencil"); friend class DemandDrivenMeshObject
<
fvMesh,
TopologicalMeshObject,
upwindCECCellToFaceStencilObject
>;
// Constructors // Protected Constructors
//- Construct from uncompacted face stencil //- Construct from uncompacted face stencil
upwindCECCellToFaceStencilObject upwindCECCellToFaceStencilObject
@ -71,10 +76,10 @@ public:
const scalar minOpposedness const scalar minOpposedness
) )
: :
MeshObject DemandDrivenMeshObject
< <
fvMesh, fvMesh,
Foam::TopologicalMeshObject, TopologicalMeshObject,
upwindCECCellToFaceStencilObject upwindCECCellToFaceStencilObject
>(mesh), >(mesh),
extendedUpwindCellToFaceStencil extendedUpwindCellToFaceStencil
@ -93,6 +98,10 @@ public:
} }
public:
TypeName("upwindCECCellToFaceStencil");
//- Destructor //- Destructor
virtual ~upwindCECCellToFaceStencilObject() virtual ~upwindCECCellToFaceStencilObject()
{} {}

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -35,7 +35,7 @@ SourceFiles
#include "extendedUpwindCellToFaceStencil.H" #include "extendedUpwindCellToFaceStencil.H"
#include "CFCCellToFaceStencil.H" #include "CFCCellToFaceStencil.H"
#include "MeshObject.H" #include "DemandDrivenMeshObject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -48,7 +48,7 @@ namespace Foam
class upwindCFCCellToFaceStencilObject class upwindCFCCellToFaceStencilObject
: :
public MeshObject public DemandDrivenMeshObject
< <
fvMesh, fvMesh,
TopologicalMeshObject, TopologicalMeshObject,
@ -57,11 +57,16 @@ class upwindCFCCellToFaceStencilObject
public extendedUpwindCellToFaceStencil public extendedUpwindCellToFaceStencil
{ {
public: protected:
TypeName("upwindCFCCellToFaceStencil"); friend class DemandDrivenMeshObject
<
fvMesh,
TopologicalMeshObject,
upwindCFCCellToFaceStencilObject
>;
// Constructors // Protected Constructors
//- Construct from uncompacted face stencil //- Construct from uncompacted face stencil
upwindCFCCellToFaceStencilObject upwindCFCCellToFaceStencilObject
@ -71,10 +76,10 @@ public:
const scalar minOpposedness const scalar minOpposedness
) )
: :
MeshObject DemandDrivenMeshObject
< <
fvMesh, fvMesh,
Foam::TopologicalMeshObject, TopologicalMeshObject,
upwindCFCCellToFaceStencilObject upwindCFCCellToFaceStencilObject
>(mesh), >(mesh),
extendedUpwindCellToFaceStencil extendedUpwindCellToFaceStencil
@ -93,6 +98,10 @@ public:
} }
public:
TypeName("upwindCFCCellToFaceStencil");
//- Destructor //- Destructor
virtual ~upwindCFCCellToFaceStencilObject() virtual ~upwindCFCCellToFaceStencilObject()
{} {}

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -35,7 +35,7 @@ SourceFiles
#include "extendedUpwindCellToFaceStencil.H" #include "extendedUpwindCellToFaceStencil.H"
#include "CPCCellToFaceStencil.H" #include "CPCCellToFaceStencil.H"
#include "MeshObject.H" #include "DemandDrivenMeshObject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -48,7 +48,7 @@ namespace Foam
class upwindCPCCellToFaceStencilObject class upwindCPCCellToFaceStencilObject
: :
public MeshObject public DemandDrivenMeshObject
< <
fvMesh, fvMesh,
TopologicalMeshObject, TopologicalMeshObject,
@ -57,11 +57,16 @@ class upwindCPCCellToFaceStencilObject
public extendedUpwindCellToFaceStencil public extendedUpwindCellToFaceStencil
{ {
public: protected:
TypeName("upwindCPCCellToFaceStencil"); friend class DemandDrivenMeshObject
<
fvMesh,
TopologicalMeshObject,
upwindCPCCellToFaceStencilObject
>;
// Constructors // Protected Constructors
//- Construct from uncompacted face stencil //- Construct from uncompacted face stencil
upwindCPCCellToFaceStencilObject upwindCPCCellToFaceStencilObject
@ -71,10 +76,10 @@ public:
const scalar minOpposedness const scalar minOpposedness
) )
: :
MeshObject DemandDrivenMeshObject
< <
fvMesh, fvMesh,
Foam::TopologicalMeshObject, TopologicalMeshObject,
upwindCPCCellToFaceStencilObject upwindCPCCellToFaceStencilObject
>(mesh), >(mesh),
extendedUpwindCellToFaceStencil extendedUpwindCellToFaceStencil
@ -93,6 +98,10 @@ public:
} }
public:
TypeName("upwindCPCCellToFaceStencil");
//- Destructor //- Destructor
virtual ~upwindCPCCellToFaceStencilObject() virtual ~upwindCPCCellToFaceStencilObject()
{} {}

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -35,7 +35,7 @@ SourceFiles
#include "extendedUpwindCellToFaceStencil.H" #include "extendedUpwindCellToFaceStencil.H"
#include "FECCellToFaceStencil.H" #include "FECCellToFaceStencil.H"
#include "MeshObject.H" #include "DemandDrivenMeshObject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -48,7 +48,7 @@ namespace Foam
class upwindFECCellToFaceStencilObject class upwindFECCellToFaceStencilObject
: :
public MeshObject public DemandDrivenMeshObject
< <
fvMesh, fvMesh,
TopologicalMeshObject, TopologicalMeshObject,
@ -57,11 +57,16 @@ class upwindFECCellToFaceStencilObject
public extendedUpwindCellToFaceStencil public extendedUpwindCellToFaceStencil
{ {
public: protected:
TypeName("upwindFECCellToFaceStencil"); friend class DemandDrivenMeshObject
<
fvMesh,
TopologicalMeshObject,
upwindFECCellToFaceStencilObject
>;
// Constructors // Protected Constructors
//- Construct from uncompacted face stencil //- Construct from uncompacted face stencil
upwindFECCellToFaceStencilObject upwindFECCellToFaceStencilObject
@ -71,10 +76,10 @@ public:
const scalar minOpposedness const scalar minOpposedness
) )
: :
MeshObject DemandDrivenMeshObject
< <
fvMesh, fvMesh,
Foam::TopologicalMeshObject, TopologicalMeshObject,
upwindFECCellToFaceStencilObject upwindFECCellToFaceStencilObject
>(mesh), >(mesh),
extendedUpwindCellToFaceStencil extendedUpwindCellToFaceStencil
@ -92,6 +97,9 @@ public:
} }
} }
public:
TypeName("upwindFECCellToFaceStencil");
//- Destructor //- Destructor
virtual ~upwindFECCellToFaceStencilObject() virtual ~upwindFECCellToFaceStencilObject()

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -35,7 +35,7 @@ SourceFiles
#include "extendedCentredFaceToCellStencil.H" #include "extendedCentredFaceToCellStencil.H"
#include "CFCFaceToCellStencil.H" #include "CFCFaceToCellStencil.H"
#include "MeshObject.H" #include "DemandDrivenMeshObject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -48,7 +48,7 @@ namespace Foam
class centredCFCFaceToCellStencilObject class centredCFCFaceToCellStencilObject
: :
public MeshObject public DemandDrivenMeshObject
< <
fvMesh, fvMesh,
TopologicalMeshObject, TopologicalMeshObject,
@ -57,11 +57,16 @@ class centredCFCFaceToCellStencilObject
public extendedCentredFaceToCellStencil public extendedCentredFaceToCellStencil
{ {
public: protected:
TypeName("centredCFCFaceToCellStencil"); friend class DemandDrivenMeshObject
<
fvMesh,
TopologicalMeshObject,
centredCFCFaceToCellStencilObject
>;
// Constructors // Protected Constructors
//- Construct from uncompacted face stencil //- Construct from uncompacted face stencil
explicit centredCFCFaceToCellStencilObject explicit centredCFCFaceToCellStencilObject
@ -69,16 +74,20 @@ public:
const fvMesh& mesh const fvMesh& mesh
) )
: :
MeshObject DemandDrivenMeshObject
< <
fvMesh, fvMesh,
Foam::TopologicalMeshObject, TopologicalMeshObject,
centredCFCFaceToCellStencilObject centredCFCFaceToCellStencilObject
>(mesh), >(mesh),
extendedCentredFaceToCellStencil(CFCFaceToCellStencil(mesh)) extendedCentredFaceToCellStencil(CFCFaceToCellStencil(mesh))
{} {}
public:
TypeName("centredCFCFaceToCellStencil");
//- Destructor //- Destructor
virtual ~centredCFCFaceToCellStencilObject() virtual ~centredCFCFaceToCellStencilObject()
{} {}

View File

@ -44,7 +44,7 @@ License
#include "pointMesh.H" #include "pointMesh.H"
#include "pointMeshMapper.H" #include "pointMeshMapper.H"
#include "MapPointField.H" #include "MapPointField.H"
#include "MeshObject.H" #include "meshObjects.H"
#include "HashPtrTable.H" #include "HashPtrTable.H"
#include "CompactListList.H" #include "CompactListList.H"

View File

@ -26,7 +26,7 @@ License
#include "fvMeshStitcher.H" #include "fvMeshStitcher.H"
#include "globalIndex.H" #include "globalIndex.H"
#include "fvcSurfaceIntegrate.H" #include "fvcSurfaceIntegrate.H"
#include "MeshObject.H" #include "meshObjects.H"
#include "syncTools.H" #include "syncTools.H"
#include "surfaceToVolVelocity.H" #include "surfaceToVolVelocity.H"

View File

@ -85,7 +85,12 @@ void Foam::nearWallDist::correct()
Foam::nearWallDist::nearWallDist(const Foam::fvMesh& mesh) Foam::nearWallDist::nearWallDist(const Foam::fvMesh& mesh)
: :
MeshObject<fvMesh, Foam::UpdateableMeshObject, nearWallDist>(mesh), DemandDrivenMeshObject
<
fvMesh,
UpdateableMeshObject,
nearWallDist
>(mesh),
y_ y_
( (
mesh.boundary(), mesh.boundary(),

View File

@ -36,7 +36,7 @@ SourceFiles
#ifndef nearWallDist_H #ifndef nearWallDist_H
#define nearWallDist_H #define nearWallDist_H
#include "MeshObject.H" #include "DemandDrivenMeshObject.H"
#include "volFields.H" #include "volFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -52,7 +52,7 @@ class fvMesh;
class nearWallDist class nearWallDist
: :
public MeshObject<fvMesh, UpdateableMeshObject, nearWallDist> public DemandDrivenMeshObject<fvMesh, UpdateableMeshObject, nearWallDist>
{ {
// Private Data // Private Data
@ -69,6 +69,21 @@ class nearWallDist
void correct(); void correct();
protected:
friend class DemandDrivenMeshObject
<
fvMesh,
UpdateableMeshObject,
nearWallDist
>;
// Protected Constructors
//- Construct from mesh
explicit nearWallDist(const fvMesh& mesh);
public: public:
// Declare name of the class and its debug switch // Declare name of the class and its debug switch
@ -77,9 +92,6 @@ public:
// Constructors // Constructors
//- Construct from components
nearWallDist(const fvMesh& mesh);
//- Disallow default bitwise copy construction //- Disallow default bitwise copy construction
nearWallDist(const nearWallDist&) = delete; nearWallDist(const nearWallDist&) = delete;

View File

@ -67,7 +67,7 @@ void Foam::wallDist::constructn() const
Foam::wallDist::wallDist(const fvMesh& mesh, const word& patchTypeName) Foam::wallDist::wallDist(const fvMesh& mesh, const word& patchTypeName)
: :
MeshObject<fvMesh, Foam::UpdateableMeshObject, wallDist>(mesh), DemandDrivenMeshObject<fvMesh, Foam::UpdateableMeshObject, wallDist>(mesh),
patchIDs_(mesh.boundaryMesh().findPatchIDs<wallPolyPatch>()), patchIDs_(mesh.boundaryMesh().findPatchIDs<wallPolyPatch>()),
patchTypeName_(patchTypeName), patchTypeName_(patchTypeName),
pdm_ pdm_
@ -114,7 +114,7 @@ Foam::wallDist::wallDist
const word& patchTypeName const word& patchTypeName
) )
: :
MeshObject<fvMesh, Foam::UpdateableMeshObject, wallDist>(mesh), DemandDrivenMeshObject<fvMesh, Foam::UpdateableMeshObject, wallDist>(mesh),
patchIDs_(patchIDs), patchIDs_(patchIDs),
patchTypeName_(patchTypeName), patchTypeName_(patchTypeName),
pdm_ pdm_

View File

@ -53,7 +53,7 @@ SourceFiles
#ifndef wallDist_H #ifndef wallDist_H
#define wallDist_H #define wallDist_H
#include "MeshObject.H" #include "DemandDrivenMeshObject.H"
#include "patchDistMethod.H" #include "patchDistMethod.H"
#include "volFields.H" #include "volFields.H"
@ -68,7 +68,7 @@ namespace Foam
class wallDist class wallDist
: :
public MeshObject<fvMesh, UpdateableMeshObject, wallDist> public DemandDrivenMeshObject<fvMesh, UpdateableMeshObject, wallDist>
{ {
// Private Data // Private Data
@ -97,13 +97,16 @@ class wallDist
void constructn() const; void constructn() const;
public: protected:
// Declare name of the class and its debug switch friend class DemandDrivenMeshObject
ClassName("wallDist"); <
fvMesh,
UpdateableMeshObject,
wallDist
>;
// Protected Constructors
// Constructors
//- Construct from mesh and optional patch type name //- Construct from mesh and optional patch type name
wallDist wallDist
@ -120,6 +123,15 @@ public:
const word& patchTypeName = "patch" const word& patchTypeName = "patch"
); );
public:
// Declare name of the class and its debug switch
ClassName("wallDist");
// Constructors
//- Disallow default bitwise copy construction //- Disallow default bitwise copy construction
wallDist(const wallDist&) = delete; wallDist(const wallDist&) = delete;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -40,7 +40,7 @@ Foam::FitData<Form, ExtendedStencil, Polynomial>::FitData
const scalar centralWeight const scalar centralWeight
) )
: :
MeshObject<fvMesh, Foam::MoveableMeshObject, Form>(mesh), DemandDrivenMeshObject<fvMesh, Foam::MoveableMeshObject, Form>(mesh),
stencil_(stencil), stencil_(stencil),
linearCorrection_(linearCorrection), linearCorrection_(linearCorrection),
linearLimitFactor_(linearLimitFactor), linearLimitFactor_(linearLimitFactor),

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -39,7 +39,7 @@ SourceFiles
#ifndef FitData_H #ifndef FitData_H
#define FitData_H #define FitData_H
#include "MeshObject.H" #include "DemandDrivenMeshObject.H"
#include "fvMesh.H" #include "fvMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -54,7 +54,7 @@ namespace Foam
template<class FitDataType, class ExtendedStencil, class Polynomial> template<class FitDataType, class ExtendedStencil, class Polynomial>
class FitData class FitData
: :
public MeshObject<fvMesh, MoveableMeshObject, FitDataType> public DemandDrivenMeshObject<fvMesh, MoveableMeshObject, FitDataType>
{ {
// Private Data // Private Data
@ -82,18 +82,14 @@ class FitData
protected: protected:
//- Find the normal direction (i) and j and k directions for face faci friend class DemandDrivenMeshObject
void findFaceDirs <
( fvMesh,
vector& idir, // value changed in return MoveableMeshObject,
vector& jdir, // value changed in return FitDataType
vector& kdir, // value changed in return >;
const label faci
);
public: // Protected Constructors
// Constructors
//- Construct from components //- Construct from components
FitData FitData
@ -106,6 +102,19 @@ public:
); );
// Protected Member Functions
//- Find the normal direction (i) and j and k directions for face faci
void findFaceDirs
(
vector& idir, // value changed in return
vector& jdir, // value changed in return
vector& kdir, // value changed in return
const label faci
);
public:
//- Destructor //- Destructor
virtual ~FitData() virtual ~FitData()
{} {}

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -38,20 +38,25 @@ namespace Foam
Foam::skewCorrectionVectors::skewCorrectionVectors(const fvMesh& mesh) Foam::skewCorrectionVectors::skewCorrectionVectors(const fvMesh& mesh)
: :
MeshObject<fvMesh, Foam::MoveableMeshObject, skewCorrectionVectors>(mesh), DemandDrivenMeshObject
<
fvMesh,
MoveableMeshObject,
skewCorrectionVectors
>(mesh),
skew_(false), skew_(false),
skewCorrectionVectors_ skewCorrectionVectors_
( (
IOobject IOobject
( (
"skewCorrectionVectors", "skewCorrectionVectors",
mesh_.pointsInstance(), mesh.pointsInstance(),
mesh_, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false false
), ),
mesh_, mesh,
dimless dimless
) )
{ {
@ -71,12 +76,12 @@ void Foam::skewCorrectionVectors::calcSkewCorrectionVectors()
} }
// Set local references to mesh data // Set local references to mesh data
const volVectorField& C = mesh_.C(); const volVectorField& C = mesh().C();
const surfaceVectorField& Cf = mesh_.Cf(); const surfaceVectorField& Cf = mesh().Cf();
const surfaceVectorField& Sf = mesh_.Sf(); const surfaceVectorField& Sf = mesh().Sf();
const labelUList& owner = mesh_.owner(); const labelUList& owner = mesh().owner();
const labelUList& neighbour = mesh_.neighbour(); const labelUList& neighbour = mesh().neighbour();
forAll(owner, facei) forAll(owner, facei)
{ {
@ -129,7 +134,7 @@ void Foam::skewCorrectionVectors::calcSkewCorrectionVectors()
if (Sf.primitiveField().size()) if (Sf.primitiveField().size())
{ {
skewCoeff = skewCoeff =
max(mag(skewCorrectionVectors_)*mesh_.deltaCoeffs()).value(); max(mag(skewCorrectionVectors_)*mesh().deltaCoeffs()).value();
} }
if (debug) if (debug)

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -35,7 +35,7 @@ SourceFiles
#ifndef skewCorrectionVectors_H #ifndef skewCorrectionVectors_H
#define skewCorrectionVectors_H #define skewCorrectionVectors_H
#include "MeshObject.H" #include "DemandDrivenMeshObject.H"
#include "fvMesh.H" #include "fvMesh.H"
#include "surfaceFields.H" #include "surfaceFields.H"
@ -52,7 +52,12 @@ class fvMesh;
class skewCorrectionVectors class skewCorrectionVectors
: :
public MeshObject<fvMesh, MoveableMeshObject, skewCorrectionVectors> public DemandDrivenMeshObject
<
fvMesh,
MoveableMeshObject,
skewCorrectionVectors
>
{ {
// Private Data // Private Data
@ -66,16 +71,25 @@ class skewCorrectionVectors
void calcSkewCorrectionVectors(); void calcSkewCorrectionVectors();
protected:
friend class DemandDrivenMeshObject
<
fvMesh,
MoveableMeshObject,
skewCorrectionVectors
>;
// Protected Constructors
explicit skewCorrectionVectors(const fvMesh& mesh);
public: public:
TypeName("skewCorrectionVectors"); TypeName("skewCorrectionVectors");
// Constructors
explicit skewCorrectionVectors(const fvMesh& mesh);
//- Destructor //- Destructor
virtual ~skewCorrectionVectors(); virtual ~skewCorrectionVectors();

View File

@ -333,7 +333,12 @@ void Foam::pointConstraints::makePatchPatchAddressing()
Foam::pointConstraints::pointConstraints(const pointMesh& pm) Foam::pointConstraints::pointConstraints(const pointMesh& pm)
: :
MeshObject<pointMesh, Foam::UpdateableMeshObject, pointConstraints>(pm) DemandDrivenMeshObject
<
pointMesh,
UpdateableMeshObject,
pointConstraints
>(pm)
{ {
if (debug) if (debug)
{ {

View File

@ -43,7 +43,7 @@ SourceFiles
#ifndef pointConstraints_H #ifndef pointConstraints_H
#define pointConstraints_H #define pointConstraints_H
#include "MeshObject.H" #include "DemandDrivenMeshObject.H"
#include "tensorField.H" #include "tensorField.H"
#include "pointFieldsFwd.H" #include "pointFieldsFwd.H"
#include "pointConstraint.H" #include "pointConstraint.H"
@ -61,7 +61,12 @@ class polyMesh;
class pointConstraints class pointConstraints
: :
public MeshObject<pointMesh, UpdateableMeshObject, pointConstraints> public DemandDrivenMeshObject
<
pointMesh,
UpdateableMeshObject,
pointConstraints
>
{ {
// Private Data // Private Data
@ -81,6 +86,21 @@ class pointConstraints
void makePatchPatchAddressing(); void makePatchPatchAddressing();
protected:
friend class DemandDrivenMeshObject
<
pointMesh,
UpdateableMeshObject,
pointConstraints
>;
// Protected Constructors
//- Constructor from pointMesh.
explicit pointConstraints(const pointMesh&);
public: public:
// Declare name of the class and its debug switch // Declare name of the class and its debug switch
@ -89,9 +109,6 @@ public:
// Constructors // Constructors
//- Constructor from pointMesh.
explicit pointConstraints(const pointMesh&);
//- Disallow default bitwise copy construction //- Disallow default bitwise copy construction
pointConstraints(const pointConstraints&) = delete; pointConstraints(const pointConstraints&) = delete;

View File

@ -324,7 +324,12 @@ void Foam::volPointInterpolation::makeWeights()
Foam::volPointInterpolation::volPointInterpolation(const fvMesh& vm) Foam::volPointInterpolation::volPointInterpolation(const fvMesh& vm)
: :
MeshObject<fvMesh, Foam::UpdateableMeshObject, volPointInterpolation>(vm) DemandDrivenMeshObject
<
fvMesh,
UpdateableMeshObject,
volPointInterpolation
>(vm)
{ {
makeWeights(); makeWeights();
} }

View File

@ -37,7 +37,7 @@ SourceFiles
#ifndef volPointInterpolation_H #ifndef volPointInterpolation_H
#define volPointInterpolation_H #define volPointInterpolation_H
#include "MeshObject.H" #include "DemandDrivenMeshObject.H"
#include "scalarList.H" #include "scalarList.H"
#include "volFields.H" #include "volFields.H"
#include "pointFields.H" #include "pointFields.H"
@ -53,7 +53,12 @@ namespace Foam
class volPointInterpolation class volPointInterpolation
: :
public MeshObject<fvMesh, UpdateableMeshObject, volPointInterpolation> public DemandDrivenMeshObject
<
fvMesh,
UpdateableMeshObject,
volPointInterpolation
>
{ {
// Private Data // Private Data
@ -76,6 +81,21 @@ class volPointInterpolation
void makeWeights(); void makeWeights();
protected:
friend class DemandDrivenMeshObject
<
fvMesh,
UpdateableMeshObject,
volPointInterpolation
>;
// Protected Constructors
//- Constructor given fvMesh
explicit volPointInterpolation(const fvMesh&);
public: public:
// Declare name of the class and its debug switch // Declare name of the class and its debug switch
@ -84,9 +104,6 @@ public:
// Constructors // Constructors
//- Constructor given fvMesh and pointMesh.
explicit volPointInterpolation(const fvMesh&);
//- Disallow default bitwise copy construction //- Disallow default bitwise copy construction
volPointInterpolation(const volPointInterpolation&) = delete; volPointInterpolation(const volPointInterpolation&) = delete;

View File

@ -36,7 +36,7 @@ Foam::parcelClouds::parcelClouds
const dimensionedVector& g const dimensionedVector& g
) )
: :
MeshObject<fvMesh, UpdateableMeshObject, parcelClouds>(mesh), DemandDrivenMeshObject<fvMesh, UpdateableMeshObject, parcelClouds>(mesh),
parcelCloudList(rho, U, mu, g) parcelCloudList(rho, U, mu, g)
{} {}
@ -50,7 +50,7 @@ Foam::parcelClouds::parcelClouds
const fluidThermo& carrierThermo const fluidThermo& carrierThermo
) )
: :
MeshObject<fvMesh, UpdateableMeshObject, parcelClouds>(mesh), DemandDrivenMeshObject<fvMesh, UpdateableMeshObject, parcelClouds>(mesh),
parcelCloudList(rho, U, g, carrierThermo) parcelCloudList(rho, U, g, carrierThermo)
{} {}

View File

@ -41,7 +41,7 @@ SourceFiles
#ifndef parcelClouds_H #ifndef parcelClouds_H
#define parcelClouds_H #define parcelClouds_H
#include "MeshObject.H" #include "DemandDrivenMeshObject.H"
#include "parcelCloudList.H" #include "parcelCloudList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -56,12 +56,19 @@ namespace Foam
class parcelClouds class parcelClouds
: :
public MeshObject<fvMesh, UpdateableMeshObject, parcelClouds>, public DemandDrivenMeshObject<fvMesh, UpdateableMeshObject, parcelClouds>,
public parcelCloudList public parcelCloudList
{ {
private: protected:
// Private Constructors friend class DemandDrivenMeshObject
<
fvMesh,
UpdateableMeshObject,
parcelClouds
>;
// Protected Constructors
//- Construct with given mesh and carrier fields //- Construct with given mesh and carrier fields
parcelClouds parcelClouds
@ -83,9 +90,6 @@ private:
const fluidThermo& carrierThermo const fluidThermo& carrierThermo
); );
//- Let Private Cesh object call the private constructors
friend class MeshObject<fvMesh, UpdateableMeshObject, parcelClouds>;
public: public:
@ -95,7 +99,12 @@ public:
parcelClouds(const parcelClouds&) = delete; parcelClouds(const parcelClouds&) = delete;
//- Inherit the base New method //- Inherit the base New method
using MeshObject<fvMesh, UpdateableMeshObject, parcelClouds>::New; using DemandDrivenMeshObject
<
fvMesh,
UpdateableMeshObject,
parcelClouds
>::New;
//- Destructor //- Destructor

View File

@ -146,7 +146,7 @@ bool Foam::AveragingMethod<Type>::writeData(Ostream& os) const
template<class Type> template<class Type>
bool Foam::AveragingMethod<Type>::write(const bool write) const bool Foam::AveragingMethod<Type>::write(const bool write) const
{ {
const pointMesh pointMesh_(mesh_); const pointMesh& pointMesh_(pointMesh::New(mesh_));
// point volumes // point volumes
Field<scalar> pointVolume(mesh_.nPoints(), 0); Field<scalar> pointVolume(mesh_.nPoints(), 0);

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -44,7 +44,12 @@ Foam::coordinateSystems::coordinateSystems::coordinateSystems
const objectRegistry& obr const objectRegistry& obr
) )
: :
MeshObject<objectRegistry, GeometricMeshObject, coordinateSystems> DemandDrivenMeshObject
<
objectRegistry,
GeometricMeshObject,
coordinateSystems
>
( (
obr, obr,
IOobject IOobject

View File

@ -82,7 +82,7 @@ SourceFiles
#include "coordinateSystem.H" #include "coordinateSystem.H"
#include "PtrDictionary.H" #include "PtrDictionary.H"
#include "MeshObject.H" #include "DemandDrivenMeshObject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -97,9 +97,29 @@ namespace coordinateSystems
class coordinateSystems class coordinateSystems
: :
public MeshObject<objectRegistry, GeometricMeshObject, coordinateSystems>, public DemandDrivenMeshObject
<
objectRegistry,
GeometricMeshObject,
coordinateSystems
>,
public PtrDictionary<coordinateSystem> public PtrDictionary<coordinateSystem>
{ {
protected:
friend class DemandDrivenMeshObject
<
objectRegistry,
GeometricMeshObject,
coordinateSystems
>;
// Protected Constructors
//- Read construct from objectRegistry
explicit coordinateSystems(const objectRegistry& obr);
public: public:
//- Runtime type information //- Runtime type information
@ -108,13 +128,10 @@ public:
// Constructors // Constructors
//- Read construct from objectRegistry
explicit coordinateSystems(const objectRegistry& obr);
//- Disallow default bitwise copy construction //- Disallow default bitwise copy construction
coordinateSystems(const coordinateSystems&) = delete; coordinateSystems(const coordinateSystems&) = delete;
using MeshObject using DemandDrivenMeshObject
< <
objectRegistry, objectRegistry,
GeometricMeshObject, GeometricMeshObject,
@ -158,7 +175,7 @@ public:
template<> template<>
struct typeGlobal struct typeGlobal
< <
MeshObject DemandDrivenMeshObject
< <
objectRegistry, objectRegistry,
GeometricMeshObject, GeometricMeshObject,

View File

@ -156,7 +156,12 @@ Foam::cellEdgeAddressing::cellEdgeAddressing
Foam::cellEdgeAddressingList::cellEdgeAddressingList(const polyMesh& mesh) Foam::cellEdgeAddressingList::cellEdgeAddressingList(const polyMesh& mesh)
: :
MeshObject<polyMesh, UpdateableMeshObject, cellEdgeAddressingList>(mesh), DemandDrivenMeshObject
<
polyMesh,
UpdateableMeshObject,
cellEdgeAddressingList
>(mesh),
list_(mesh.nCells()) list_(mesh.nCells())
{} {}

View File

@ -37,7 +37,7 @@ SourceFiles
#ifndef cellEdgeAddressing_H #ifndef cellEdgeAddressing_H
#define cellEdgeAddressing_H #define cellEdgeAddressing_H
#include "MeshObject.H" #include "DemandDrivenMeshObject.H"
#include "polyMesh.H" #include "polyMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -108,24 +108,36 @@ public:
class cellEdgeAddressingList class cellEdgeAddressingList
: :
public MeshObject<polyMesh, UpdateableMeshObject, cellEdgeAddressingList> public DemandDrivenMeshObject
<
polyMesh,
UpdateableMeshObject,
cellEdgeAddressingList
>
{ {
private:
// Private Data // Private Data
//- Edge addressing for each cell //- Edge addressing for each cell
mutable PtrList<cellEdgeAddressing> list_; mutable PtrList<cellEdgeAddressing> list_;
public: protected:
// Constructors friend class DemandDrivenMeshObject
<
polyMesh,
UpdateableMeshObject,
cellEdgeAddressingList
>;
// Protected Constructors
//- Construct for a mesh //- Construct for a mesh
cellEdgeAddressingList(const polyMesh& mesh); cellEdgeAddressingList(const polyMesh& mesh);
public:
// Member Functions // Member Functions
//- Update following mesh motion //- Update following mesh motion

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -35,15 +35,16 @@ namespace Foam
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::meshSearchFACE_CENTRE_TRISMeshObject::meshSearchFACE_CENTRE_TRISMeshObject Foam::meshSearchFACE_CENTRE_TRISMeshObject::
meshSearchFACE_CENTRE_TRISMeshObject
( (
const polyMesh& mesh const polyMesh& mesh
) )
: :
MeshObject DemandDrivenMeshObject
< <
polyMesh, polyMesh,
Foam::GeometricMeshObject, GeometricMeshObject,
meshSearchFACE_CENTRE_TRISMeshObject meshSearchFACE_CENTRE_TRISMeshObject
>(mesh), >(mesh),
meshSearch(mesh, polyMesh::FACE_CENTRE_TRIS) meshSearch(mesh, polyMesh::FACE_CENTRE_TRIS)

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,7 +25,8 @@ Class
Foam::meshSearchFACE_CENTRE_TRISMeshObject Foam::meshSearchFACE_CENTRE_TRISMeshObject
Description Description
MeshObject wrapper around meshSearch(mesh, polyMesh::FACE_CENTRE_TRIS). DemandDrivenMeshObject wrapper around
meshSearch(mesh, polyMesh::FACE_CENTRE_TRIS).
SourceFiles SourceFiles
@ -34,7 +35,7 @@ SourceFiles
#ifndef meshSearchFACE_CENTRE_TRISMeshObject_H #ifndef meshSearchFACE_CENTRE_TRISMeshObject_H
#define meshSearchFACE_CENTRE_TRISMeshObject_H #define meshSearchFACE_CENTRE_TRISMeshObject_H
#include "MeshObject.H" #include "DemandDrivenMeshObject.H"
#include "meshSearch.H" #include "meshSearch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -48,7 +49,7 @@ namespace Foam
class meshSearchFACE_CENTRE_TRISMeshObject class meshSearchFACE_CENTRE_TRISMeshObject
: :
public MeshObject public DemandDrivenMeshObject
< <
polyMesh, polyMesh,
GeometricMeshObject, GeometricMeshObject,
@ -57,17 +58,26 @@ class meshSearchFACE_CENTRE_TRISMeshObject
public meshSearch public meshSearch
{ {
protected:
friend class DemandDrivenMeshObject
<
polyMesh,
GeometricMeshObject,
meshSearchFACE_CENTRE_TRISMeshObject
>;
// Protected Constructors
//- Constructor given polyMesh
explicit meshSearchFACE_CENTRE_TRISMeshObject(const polyMesh& mesh);
public: public:
// Declare name of the class and its debug switch // Declare name of the class and its debug switch
TypeName("meshSearchFACE_CENTRE_TRISMeshObject"); TypeName("meshSearchFACE_CENTRE_TRISMeshObject");
// Constructors
//- Constructor given polyMesh
explicit meshSearchFACE_CENTRE_TRISMeshObject(const polyMesh& mesh);
//- Destructor //- Destructor
virtual ~meshSearchFACE_CENTRE_TRISMeshObject() virtual ~meshSearchFACE_CENTRE_TRISMeshObject()
{} {}

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -37,7 +37,12 @@ namespace Foam
Foam::meshSearchMeshObject::meshSearchMeshObject(const polyMesh& mesh) Foam::meshSearchMeshObject::meshSearchMeshObject(const polyMesh& mesh)
: :
MeshObject<polyMesh, Foam::GeometricMeshObject, meshSearchMeshObject>(mesh), DemandDrivenMeshObject
<
polyMesh,
GeometricMeshObject,
meshSearchMeshObject
>(mesh),
meshSearch(mesh) meshSearch(mesh)
{} {}

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,7 +25,7 @@ Class
Foam::meshSearchMeshObject Foam::meshSearchMeshObject
Description Description
MeshObject wrapper around meshSearch(mesh). DemandDrivenMeshObject wrapper around meshSearch(mesh).
SourceFiles SourceFiles
@ -34,7 +34,7 @@ SourceFiles
#ifndef meshSearchMeshObject_H #ifndef meshSearchMeshObject_H
#define meshSearchMeshObject_H #define meshSearchMeshObject_H
#include "MeshObject.H" #include "DemandDrivenMeshObject.H"
#include "meshSearch.H" #include "meshSearch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -48,21 +48,35 @@ namespace Foam
class meshSearchMeshObject class meshSearchMeshObject
: :
public MeshObject<polyMesh, GeometricMeshObject, meshSearchMeshObject>, public DemandDrivenMeshObject
<
polyMesh,
GeometricMeshObject,
meshSearchMeshObject
>,
public meshSearch public meshSearch
{ {
protected:
friend class DemandDrivenMeshObject
<
polyMesh,
GeometricMeshObject,
meshSearchMeshObject
>;
// Protected Constructors
//- Constructor from polyMesh
explicit meshSearchMeshObject(const polyMesh& mesh);
public: public:
// Declare name of the class and its debug switch // Declare name of the class and its debug switch
TypeName("meshSearchMeshObject"); TypeName("meshSearchMeshObject");
// Constructors
//- Constructor given polyMesh
explicit meshSearchMeshObject(const polyMesh& mesh);
//- Destructor //- Destructor
virtual ~meshSearchMeshObject() virtual ~meshSearchMeshObject()
{} {}

View File

@ -66,7 +66,7 @@ Foam::nonConformalBoundary::boundary(const labelList& patches) const
DynamicList<label> faces; DynamicList<label> faces;
forAll(patches, i) forAll(patches, i)
{ {
const polyPatch& pp = mesh_.boundaryMesh()[patches[i]]; const polyPatch& pp = mesh().boundaryMesh()[patches[i]];
faces.append(identity(pp.size()) + pp.start()); faces.append(identity(pp.size()) + pp.start());
} }
@ -74,8 +74,8 @@ Foam::nonConformalBoundary::boundary(const labelList& patches) const
return return
indirectPrimitivePatch indirectPrimitivePatch
( (
IndirectList<face>(mesh_.faces(), faces), IndirectList<face>(mesh().faces(), faces),
mesh_.points() mesh().points()
); );
} }
@ -87,7 +87,7 @@ Foam::nonConformalBoundary::meshPointOwnerOrigBoundaryPoint() const
{ {
meshPointOwnerOrigBoundaryPointPtr_.set meshPointOwnerOrigBoundaryPointPtr_.set
( (
new labelList(mesh_.nPoints(), -1) new labelList(mesh().nPoints(), -1)
); );
forAll(ownerOrigBoundary_.meshPoints(), ownerOrigBoundaryPointi) forAll(ownerOrigBoundary_.meshPoints(), ownerOrigBoundaryPointi)
@ -122,7 +122,7 @@ Foam::nonConformalBoundary::ownerOrigBoundaryPointNormals() const
syncTools::syncPointList syncTools::syncPointList
( (
mesh_, mesh(),
ownerOrigBoundary_.meshPoints(), ownerOrigBoundary_.meshPoints(),
pointNormals, pointNormals,
plusEqOp<vector>(), plusEqOp<vector>(),
@ -153,13 +153,13 @@ Foam::nonConformalBoundary::ownerOrigBoundaryPointNormals0() const
forAll(faces[facei], facePointi) forAll(faces[facei], facePointi)
{ {
pointNormals[faces[facei][facePointi]] += pointNormals[faces[facei][facePointi]] +=
faces[facei].normal(mesh_.oldPoints()); faces[facei].normal(mesh().oldPoints());
} }
} }
syncTools::syncPointList syncTools::syncPointList
( (
mesh_, mesh(),
ownerOrigBoundary_.meshPoints(), ownerOrigBoundary_.meshPoints(),
pointNormals, pointNormals,
plusEqOp<vector>(), plusEqOp<vector>(),
@ -180,7 +180,12 @@ Foam::nonConformalBoundary::ownerOrigBoundaryPointNormals0() const
Foam::nonConformalBoundary::nonConformalBoundary(const polyMesh& mesh) Foam::nonConformalBoundary::nonConformalBoundary(const polyMesh& mesh)
: :
MeshObject<polyMesh, MoveableMeshObject, nonConformalBoundary>(mesh), DemandDrivenMeshObject
<
polyMesh,
MoveableMeshObject,
nonConformalBoundary
>(mesh),
ownerOrigBoundary_(boundary(ownerOrigPatchIDs())), ownerOrigBoundary_(boundary(ownerOrigPatchIDs())),
meshPointOwnerOrigBoundaryPointPtr_(nullptr), meshPointOwnerOrigBoundaryPointPtr_(nullptr),
ownerOrigBoundaryPointMeshPointPtr_(nullptr), ownerOrigBoundaryPointMeshPointPtr_(nullptr),
@ -218,7 +223,7 @@ Foam::labelList Foam::nonConformalBoundary::nonConformalNonCoupledPatchIDs
label (nonConformalCoupledPolyPatch::*method)() const label (nonConformalCoupledPolyPatch::*method)() const
) const ) const
{ {
const polyBoundaryMesh& pbm = mesh_.boundaryMesh(); const polyBoundaryMesh& pbm = mesh().boundaryMesh();
labelHashSet origPatchIDTable; labelHashSet origPatchIDTable;
DynamicList<label> nonCoupledPatchIDs(pbm.size()); DynamicList<label> nonCoupledPatchIDs(pbm.size());
@ -306,7 +311,7 @@ Foam::nonConformalBoundary::ownerOrigBoundaryPointMeshPoint() const
const label meshEdgei = const label meshEdgei =
ownerOrigBoundaryEdgeMeshEdge()[ownerOrigBoundaryEdgei]; ownerOrigBoundaryEdgeMeshEdge()[ownerOrigBoundaryEdgei];
const edge& e = mesh_.edges()[meshEdgei]; const edge& e = mesh().edges()[meshEdgei];
forAll(e, i) forAll(e, i)
{ {
@ -335,9 +340,9 @@ Foam::nonConformalBoundary::ownerOrigBoundaryEdgeMeshEdge() const
{ {
// Create boundary of all owner-orig and proc patches // Create boundary of all owner-orig and proc patches
labelList ownerOrigAndProcPatchIDs = this->ownerOrigPatchIDs(); labelList ownerOrigAndProcPatchIDs = this->ownerOrigPatchIDs();
forAll(mesh_.boundaryMesh(), patchi) forAll(mesh().boundaryMesh(), patchi)
{ {
if (isA<processorPolyPatch>(mesh_.boundaryMesh()[patchi])) if (isA<processorPolyPatch>(mesh().boundaryMesh()[patchi]))
{ {
ownerOrigAndProcPatchIDs.append(patchi); ownerOrigAndProcPatchIDs.append(patchi);
} }
@ -352,8 +357,8 @@ Foam::nonConformalBoundary::ownerOrigBoundaryEdgeMeshEdge() const
( (
ownerOrigAndProcBoundary.meshEdges ownerOrigAndProcBoundary.meshEdges
( (
mesh_.edges(), mesh().edges(),
mesh_.pointEdges() mesh().pointEdges()
) )
); );
@ -396,7 +401,7 @@ Foam::nonConformalBoundary::ownerOrigBoundaryEdgeMeshEdge() const
// Synchronise // Synchronise
syncTools::syncEdgeList syncTools::syncEdgeList
( (
mesh_, mesh(),
ownerOrigAndProcBoundaryMeshEdges, ownerOrigAndProcBoundaryMeshEdges,
rMap, rMap,
maxEqOp<label>(), maxEqOp<label>(),
@ -451,7 +456,7 @@ Foam::nonConformalBoundary::ownerOrigBoundaryEdges() const
const label meshEdgei = const label meshEdgei =
ownerOrigBoundaryEdgeMeshEdge()[ownerOrigBoundaryEdgei]; ownerOrigBoundaryEdgeMeshEdge()[ownerOrigBoundaryEdgei];
const edge& e = mesh_.edges()[meshEdgei]; const edge& e = mesh().edges()[meshEdgei];
remoteEdges.append(edge(map[e.start()], map[e.end()])); remoteEdges.append(edge(map[e.start()], map[e.end()]));
} }
@ -501,7 +506,7 @@ Foam::nonConformalBoundary::patchPointOwnerOrigBoundaryPoints
{ {
if (!patchPointOwnerOrigBoundaryPointsPtr_.set(patchi)) if (!patchPointOwnerOrigBoundaryPointsPtr_.set(patchi))
{ {
const polyPatch& pp = mesh_.boundaryMesh()[patchi]; const polyPatch& pp = mesh().boundaryMesh()[patchi];
const faceList patchOwnerOrigBoundaryLocalFaces const faceList patchOwnerOrigBoundaryLocalFaces
( (

View File

@ -36,7 +36,7 @@ SourceFiles
#ifndef nonConformalBoundary_H #ifndef nonConformalBoundary_H
#define nonConformalBoundary_H #define nonConformalBoundary_H
#include "MeshObject.H" #include "DemandDrivenMeshObject.H"
#include "polyMesh.H" #include "polyMesh.H"
#include "indirectPrimitivePatch.H" #include "indirectPrimitivePatch.H"
@ -53,7 +53,12 @@ class nonConformalCoupledPolyPatch;
class nonConformalBoundary class nonConformalBoundary
: :
public MeshObject<polyMesh, MoveableMeshObject, nonConformalBoundary> public DemandDrivenMeshObject
<
polyMesh,
MoveableMeshObject,
nonConformalBoundary
>
{ {
// Private Data // Private Data
@ -104,6 +109,21 @@ class nonConformalBoundary
const vectorField& ownerOrigBoundaryPointNormals0() const; const vectorField& ownerOrigBoundaryPointNormals0() const;
protected:
friend class DemandDrivenMeshObject
<
polyMesh,
MoveableMeshObject,
nonConformalBoundary
>;
// Protected Constructors
//- Construct from mesh
explicit nonConformalBoundary(const polyMesh& mesh);
public: public:
//- Runtime type information //- Runtime type information
@ -112,9 +132,6 @@ public:
// Constructors // Constructors
//- Construct from a mesh
nonConformalBoundary(const polyMesh& mesh);
//- Disallow default bitwise copy construction //- Disallow default bitwise copy construction
nonConformalBoundary(const nonConformalBoundary&) = delete; nonConformalBoundary(const nonConformalBoundary&) = delete;

View File

@ -394,8 +394,8 @@ Foam::autoPtr<Foam::globalIndex> Foam::regionSplit::calcRegionSplit
Foam::regionSplit::regionSplit(const polyMesh& mesh, const bool doGlobalRegions) Foam::regionSplit::regionSplit(const polyMesh& mesh, const bool doGlobalRegions)
: :
MeshObject<polyMesh, Foam::TopologicalMeshObject, regionSplit>(mesh), labelList(mesh.nCells(), -1),
labelList(mesh.nCells(), -1) mesh_(mesh)
{ {
globalNumberingPtr_ = calcRegionSplit globalNumberingPtr_ = calcRegionSplit
( (
@ -414,8 +414,8 @@ Foam::regionSplit::regionSplit
const bool doGlobalRegions const bool doGlobalRegions
) )
: :
MeshObject<polyMesh, Foam::TopologicalMeshObject, regionSplit>(mesh), labelList(mesh.nCells(), -1),
labelList(mesh.nCells(), -1) mesh_(mesh)
{ {
globalNumberingPtr_ = calcRegionSplit globalNumberingPtr_ = calcRegionSplit
( (
@ -435,8 +435,8 @@ Foam::regionSplit::regionSplit
const bool doGlobalRegions const bool doGlobalRegions
) )
: :
MeshObject<polyMesh, Foam::TopologicalMeshObject, regionSplit>(mesh), labelList(mesh.nCells(), -1),
labelList(mesh.nCells(), -1) mesh_(mesh)
{ {
globalNumberingPtr_ = calcRegionSplit globalNumberingPtr_ = calcRegionSplit
( (

View File

@ -101,7 +101,6 @@ SourceFiles
#include "globalIndex.H" #include "globalIndex.H"
#include "labelPair.H" #include "labelPair.H"
#include "boolList.H" #include "boolList.H"
#include "MeshObject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -116,11 +115,13 @@ class polyMesh;
class regionSplit class regionSplit
: :
public MeshObject<polyMesh, TopologicalMeshObject, regionSplit>,
public labelList public labelList
{ {
// Private Data // Private Data
//- Reference to the polyMesh
const polyMesh& mesh_;
mutable autoPtr<globalIndex> globalNumberingPtr_; mutable autoPtr<globalIndex> globalNumberingPtr_;
@ -180,9 +181,18 @@ public:
const bool doGlobalRegions = Pstream::parRun() const bool doGlobalRegions = Pstream::parRun()
); );
//- Disallow default bitwise copy construction
regionSplit(const regionSplit&) = delete;
// Member Functions // Member Functions
//- Return reference to the polyMesh
const polyMesh& mesh() const
{
return mesh_;
}
//- Return global region numbering //- Return global region numbering
const globalIndex& globalNumbering() const const globalIndex& globalNumbering() const
{ {

View File

@ -55,7 +55,7 @@ void Foam::twoDPointCorrector::calcAddressing() const
// error. // error.
// Try and find a wedge patch // Try and find a wedge patch
const polyBoundaryMesh& patches = mesh_.boundaryMesh(); const polyBoundaryMesh& patches = mesh().boundaryMesh();
forAll(patches, patchi) forAll(patches, patchi)
{ {
@ -117,12 +117,12 @@ void Foam::twoDPointCorrector::calcAddressing() const
} }
// Select edges to be included in check. // Select edges to be included in check.
normalEdgeIndicesPtr_ = new labelList(mesh_.nEdges()); normalEdgeIndicesPtr_ = new labelList(mesh().nEdges());
labelList& neIndices = *normalEdgeIndicesPtr_; labelList& neIndices = *normalEdgeIndicesPtr_;
const edgeList& meshEdges = mesh_.edges(); const edgeList& meshEdges = mesh().edges();
const pointField& meshPoints = mesh_.points(); const pointField& meshPoints = mesh().points();
label nNormalEdges = 0; label nNormalEdges = 0;
@ -196,8 +196,13 @@ void Foam::twoDPointCorrector::snapToWedge
Foam::twoDPointCorrector::twoDPointCorrector(const polyMesh& mesh) Foam::twoDPointCorrector::twoDPointCorrector(const polyMesh& mesh)
: :
MeshObject<polyMesh, Foam::UpdateableMeshObject, twoDPointCorrector>(mesh), DemandDrivenMeshObject
required_(mesh_.nGeometricD() == 2), <
polyMesh,
UpdateableMeshObject,
twoDPointCorrector
>(mesh),
required_(mesh.nGeometricD() == 2),
planeNormalPtr_(nullptr), planeNormalPtr_(nullptr),
normalEdgeIndicesPtr_(nullptr), normalEdgeIndicesPtr_(nullptr),
isWedge_(false), isWedge_(false),
@ -277,7 +282,7 @@ void Foam::twoDPointCorrector::correctPoints(pointField& p) const
// such that vectors AP and planeNormal are parallel // such that vectors AP and planeNormal are parallel
// Get reference to edges // Get reference to edges
const edgeList& meshEdges = mesh_.edges(); const edgeList& meshEdges = mesh().edges();
const labelList& neIndices = normalEdgeIndices(); const labelList& neIndices = normalEdgeIndices();
const vector& pn = planeNormal(); const vector& pn = planeNormal();
@ -290,7 +295,7 @@ void Foam::twoDPointCorrector::correctPoints(pointField& p) const
// calculate average point position // calculate average point position
point A = 0.5*(pStart + pEnd); point A = 0.5*(pStart + pEnd);
meshTools::constrainToMeshCentre(mesh_, A); meshTools::constrainToMeshCentre(mesh(), A);
if (isWedge_) if (isWedge_)
{ {
@ -321,7 +326,7 @@ void Foam::twoDPointCorrector::correctDisplacement
// such that vectors AP and planeNormal are parallel // such that vectors AP and planeNormal are parallel
// Get reference to edges // Get reference to edges
const edgeList& meshEdges = mesh_.edges(); const edgeList& meshEdges = mesh().edges();
const labelList& neIndices = normalEdgeIndices(); const labelList& neIndices = normalEdgeIndices();
const vector& pn = planeNormal(); const vector& pn = planeNormal();
@ -338,7 +343,7 @@ void Foam::twoDPointCorrector::correctDisplacement
// calculate average point position // calculate average point position
point A = 0.5*(pStart + pEnd); point A = 0.5*(pStart + pEnd);
meshTools::constrainToMeshCentre(mesh_, A); meshTools::constrainToMeshCentre(mesh(), A);
if (isWedge_) if (isWedge_)
{ {

View File

@ -42,7 +42,7 @@ SourceFiles
#ifndef twoDPointCorrector_H #ifndef twoDPointCorrector_H
#define twoDPointCorrector_H #define twoDPointCorrector_H
#include "MeshObject.H" #include "DemandDrivenMeshObject.H"
#include "pointField.H" #include "pointField.H"
#include "labelList.H" #include "labelList.H"
#include "vector.H" #include "vector.H"
@ -61,7 +61,12 @@ class polyMesh;
class twoDPointCorrector class twoDPointCorrector
: :
public MeshObject<polyMesh, UpdateableMeshObject, twoDPointCorrector> public DemandDrivenMeshObject
<
polyMesh,
UpdateableMeshObject,
twoDPointCorrector
>
{ {
// Private Data // Private Data
@ -102,6 +107,21 @@ class twoDPointCorrector
static const scalar edgeOrthogonalityTol; static const scalar edgeOrthogonalityTol;
protected:
friend class DemandDrivenMeshObject
<
polyMesh,
UpdateableMeshObject,
twoDPointCorrector
>;
// Protected Constructors
//- Construct from mesh
explicit twoDPointCorrector(const polyMesh& mesh);
public: public:
// Declare name of the class and its debug switch // Declare name of the class and its debug switch
@ -110,9 +130,6 @@ public:
// Constructors // Constructors
//- Construct from components
twoDPointCorrector(const polyMesh& mesh);
//- Disallow default bitwise copy construction //- Disallow default bitwise copy construction
twoDPointCorrector(const twoDPointCorrector&) = delete; twoDPointCorrector(const twoDPointCorrector&) = delete;