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_.thermo2().kappa().boundaryField()[patchi]
+ mixture_.thermo2().rho(patchi)*mixture_.thermo2().Cp()
+ mixture_.thermo2().rho(patchi)
*mixture_.thermo2().Cp().boundaryField()[patchi]
*momentumTransport_.momentumTransport2_->nut(patchi)
);
}
else
{
return
mixture_.alpha1()
mixture_.alpha1().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)
)
+ mixture_.alpha2()
+ mixture_.alpha2().boundaryField()[patchi]
*(
mixture_.thermo2().kappa().boundaryField()[patchi]
+ mixture_.thermo2().rho(patchi)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -37,7 +37,7 @@ SourceFiles
#ifndef GAMGAgglomeration_H
#define GAMGAgglomeration_H
#include "MeshObject.H"
#include "DemandDrivenMeshObject.H"
#include "lduPrimitiveMesh.H"
#include "lduInterfacePtrsList.H"
#include "primitiveFields.H"
@ -61,7 +61,12 @@ class GAMGProcAgglomeration;
class GAMGAgglomeration
:
public MeshObject<lduMesh, GeometricMeshObject, GAMGAgglomeration>
public DemandDrivenMeshObject
<
lduMesh,
GeometricMeshObject,
GAMGAgglomeration
>
{
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
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -31,7 +31,12 @@ License
template<class Type>
Foam::Residuals<Type>::Residuals(const polyMesh& mesh)
:
MeshObject<polyMesh, GeometricMeshObject, Residuals<Type>>(mesh),
DemandDrivenMeshObject
<
polyMesh,
GeometricMeshObject,
Residuals<Type>
>(mesh),
prevTimeIndex_(-1)
{}
@ -41,7 +46,12 @@ Foam::Residuals<Type>::Residuals(const polyMesh& mesh)
template<class Type>
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
).HashTable<DynamicList<SolverPerformance<Type>>>::toc();
@ -51,7 +61,12 @@ Foam::List<Foam::word> Foam::Residuals<Type>::fieldNames(const polyMesh& mesh)
template<class Type>
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
).HashTable<DynamicList<SolverPerformance<Type>>>::found(fieldName);
@ -66,7 +81,12 @@ Foam::Residuals<Type>::field
const word& fieldName
)
{
return MeshObject<polyMesh, GeometricMeshObject, Residuals<Type>>::New
return DemandDrivenMeshObject
<
polyMesh,
GeometricMeshObject,
Residuals<Type>
>::New
(
mesh
)[fieldName];
@ -82,7 +102,12 @@ void Foam::Residuals<Type>::append
{
Residuals<Type>& residuals = const_cast<Residuals<Type>&>
(
MeshObject<polyMesh, GeometricMeshObject, Residuals<Type>>::New
DemandDrivenMeshObject
<
polyMesh,
GeometricMeshObject,
Residuals<Type>
>::New
(
mesh
)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,8 +25,8 @@ Class
Foam::Residuals
Description
MeshObject to store the solver performance residuals of all the fields
of the type it is instantiated on.
DemandDrivenMeshObject to store the solver performance residuals of all
the fields of the type it is instantiated on.
SourceFiles
Residuals.C
@ -36,7 +36,7 @@ SourceFiles
#ifndef Residuals_H
#define Residuals_H
#include "MeshObject.H"
#include "DemandDrivenMeshObject.H"
#include "polyMesh.H"
#include "solverPerformance.H"
@ -52,7 +52,12 @@ namespace Foam
template<class Type>
class Residuals
:
public MeshObject<polyMesh, GeometricMeshObject, Residuals<Type>>,
public DemandDrivenMeshObject
<
polyMesh,
GeometricMeshObject,
Residuals<Type>
>,
public HashTable<DynamicList<SolverPerformance<Type>>>
{
// Private Data
@ -61,6 +66,21 @@ class Residuals
mutable label prevTimeIndex_;
protected:
friend class DemandDrivenMeshObject
<
polyMesh,
GeometricMeshObject,
Residuals<Type>
>;
// Protected Constructors
//- Construct for given mesh
explicit Residuals(const polyMesh& mesh);
public:
//- Runtime type information
@ -69,9 +89,6 @@ public:
// Constructors
//- Construct for given mesh
Residuals(const polyMesh& mesh);
//- Disallow default bitwise copy construction
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
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,41 +23,14 @@ License
\*---------------------------------------------------------------------------*/
#include "MeshObject.H"
#include "meshObjects.H"
/* * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * */
namespace Foam
{
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
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
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>
Foam::MeshObject<Mesh, MeshObjectType, Type>::MeshObject(const Mesh& mesh)
:
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))
{
return mesh.thisDb().objectRegistry::template lookupObjectRef<Type>
(
Type::typeName
);
}
else
template<class Mesh>
void Foam::meshObjects::Delete(regIOobject& io)
{
if (meshObjects::debug)
{
Pout<< "MeshObject::New(" << Mesh::typeName
<< "&) : constructing " << Type::typeName
<< " for region " << mesh.name() << endl;
Pout<< " Destroying " << io.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 (io.ownedByRegistry())
{
if (found(mesh))
{
return mesh.thisDb().objectRegistry::template lookupObjectRef<Type>
(
Type::typeName
);
io.checkOut();
}
else
{
if (meshObjects::debug)
{
Pout<< "MeshObject::New(const " << Mesh::typeName
<< "&) : constructing " << Type::typeName
<< " for region " << mesh.name() << endl;
FatalErrorInFunction
<< "Attempt to checkout and delete object " << io.name()
<< " not owned by registry."
<< abort(FatalError);
}
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 * * * * * * * * * * * * * //
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>
void Foam::meshObjects::movePoints(objectRegistry& obr)
{
@ -256,17 +78,13 @@ void Foam::meshObjects::movePoints(objectRegistry& obr)
{
if (meshObjects::debug)
{
Pout<< " Moving " << iter()->name() << endl;
Pout<< " Moving " << iter()->io_.name() << endl;
}
dynamic_cast<MoveableMeshObject<Mesh>*>(iter())->movePoints();
}
else
{
if (meshObjects::debug)
{
Pout<< " Destroying " << iter()->name() << endl;
}
obr.checkOut(*iter());
Delete<Mesh>(iter()->io_);
}
}
}
@ -303,18 +121,14 @@ void Foam::meshObjects::distribute
{
if (meshObjects::debug)
{
Pout<< " Distributing " << iter()->name() << endl;
Pout<< " Distributing " << iter()->io_.name() << endl;
}
dynamic_cast<DistributeableMeshObject<Mesh>*>(iter())
->distribute(map);
}
else
{
if (meshObjects::debug)
{
Pout<< " Destroying " << iter()->name() << endl;
}
obr.checkOut(*iter());
Delete<Mesh>(iter()->io_);
}
}
}
@ -350,17 +164,13 @@ void Foam::meshObjects::topoChange
{
if (meshObjects::debug)
{
Pout<< " Updating " << iter()->name() << endl;
Pout<< " Updating " << iter()->io_.name() << endl;
}
dynamic_cast<UpdateableMeshObject<Mesh>*>(iter())->topoChange(map);
}
else
{
if (meshObjects::debug)
{
Pout<< " Destroying " << iter()->name() << endl;
}
obr.checkOut(*iter());
Delete<Mesh>(iter()->io_);
}
}
}
@ -396,17 +206,13 @@ void Foam::meshObjects::mapMesh
{
if (meshObjects::debug)
{
Pout<< " Updating " << iter()->name() << endl;
Pout<< " Updating " << iter()->io_.name() << endl;
}
dynamic_cast<UpdateableMeshObject<Mesh>*>(iter())->mapMesh(map);
}
else
{
if (meshObjects::debug)
{
Pout<< " Destroying " << iter()->name() << endl;
}
obr.checkOut(*iter());
Delete<Mesh>(iter()->io_);
}
}
}
@ -438,17 +244,13 @@ void Foam::meshObjects::addPatch(objectRegistry& obr, const label patchi)
{
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);
}
else
{
if (meshObjects::debug)
{
Pout<< " Destroying " << iter()->name() << endl;
}
obr.checkOut(*iter());
Delete<Mesh>(iter()->io_);
}
}
}
@ -485,7 +287,7 @@ void Foam::meshObjects::reorderPatches
{
if (meshObjects::debug)
{
Pout<< " Adding patch to " << iter()->name() << endl;
Pout<< " Adding patch to " << iter()->io_.name() << endl;
}
dynamic_cast<PatchMeshObject<Mesh>*>(iter())->reorderPatches
(
@ -495,11 +297,7 @@ void Foam::meshObjects::reorderPatches
}
else
{
if (meshObjects::debug)
{
Pout<< " Destroying " << iter()->name() << endl;
}
obr.checkOut(*iter());
Delete<Mesh>(iter()->io_);
}
}
}
@ -522,11 +320,7 @@ void Foam::meshObjects::clear(objectRegistry& obr)
forAllIter(typename HashTable<MeshObjectType<Mesh>*>, meshObjects, iter)
{
if (meshObjects::debug)
{
Pout<< " Destroying " << iter()->name() << endl;
}
obr.checkOut(*iter());
Delete<Mesh>(iter()->io_);
}
}
@ -555,11 +349,7 @@ void Foam::meshObjects::clearUpto(objectRegistry& obr)
{
if (!isA<ToType<Mesh>>(*iter()))
{
if (meshObjects::debug)
{
Pout<< " Destroying " << iter()->name() << endl;
}
obr.checkOut(*iter());
Delete<Mesh>(iter()->io_);
}
}
}

View File

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

View File

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

View File

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

View File

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

View File

@ -53,6 +53,8 @@ Fickian<BasicThermophysicalTransportModel>::Fickian
thermo
),
UpdateableMeshObject(*this, thermo.mesh()),
mixtureDiffusionCoefficients_(true),
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

View File

@ -41,6 +41,7 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#include "Function2.H"
#include "MeshObjects.H"
#ifndef Fickian_H
#define Fickian_H
@ -57,7 +58,8 @@ namespace Foam
template<class BasicThermophysicalTransportModel>
class Fickian
:
public BasicThermophysicalTransportModel
public BasicThermophysicalTransportModel,
public UpdateableMeshObject<fvMesh>
{
// Private data
@ -143,6 +145,21 @@ public:
//- Update the diffusion coefficients
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::
setZonesPatchFaces() const
{
if (!zoneCoordinateSystems_.size()) return;
// Find all the patch faces adjacent to zones
const fvMesh& mesh = thermo().mesh();
@ -114,6 +116,7 @@ Foam::solidThermophysicalTransportModels::anisotropic::anisotropic
)
:
solidThermophysicalTransportModel(typeName, thermo),
UpdateableMeshObject(*this, thermo.mesh()),
coordinateSystem_(coordinateSystem::New(thermo.mesh(), coeffDict())),
boundaryAligned_
(
@ -226,11 +229,6 @@ Foam::solidThermophysicalTransportModels::anisotropic::Kappa() const
const solidThermo& thermo = this->thermo();
const fvMesh& mesh = thermo.mesh();
if (zoneCoordinateSystems_.size() && mesh.topoChanged())
{
setZonesPatchFaces();
}
const volVectorField& materialKappa = thermo.Kappa();
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 "coordinateSystem.H"
#include "PtrDictionary.H"
#include "MeshObjects.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -115,7 +116,8 @@ namespace solidThermophysicalTransportModels
class anisotropic
:
public solidThermophysicalTransportModel
public solidThermophysicalTransportModel,
public UpdateableMeshObject<fvMesh>
{
// Private member data
@ -186,6 +188,21 @@ public:
//- Correct the anisotropic viscosity
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
)
:
MeshObject<fvMesh, Foam::UpdateableMeshObject, fvConstraints>
DemandDrivenMeshObject<fvMesh, Foam::UpdateableMeshObject, fvConstraints>
(
mesh,
createIOobject(mesh)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -67,7 +67,7 @@ void Foam::wallDist::constructn() const
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>()),
patchTypeName_(patchTypeName),
pdm_
@ -114,7 +114,7 @@ Foam::wallDist::wallDist
const word& patchTypeName
)
:
MeshObject<fvMesh, Foam::UpdateableMeshObject, wallDist>(mesh),
DemandDrivenMeshObject<fvMesh, Foam::UpdateableMeshObject, wallDist>(mesh),
patchIDs_(patchIDs),
patchTypeName_(patchTypeName),
pdm_

View File

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

View File

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

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -39,7 +39,7 @@ SourceFiles
#ifndef FitData_H
#define FitData_H
#include "MeshObject.H"
#include "DemandDrivenMeshObject.H"
#include "fvMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -54,7 +54,7 @@ namespace Foam
template<class FitDataType, class ExtendedStencil, class Polynomial>
class FitData
:
public MeshObject<fvMesh, MoveableMeshObject, FitDataType>
public DemandDrivenMeshObject<fvMesh, MoveableMeshObject, FitDataType>
{
// Private Data
@ -82,18 +82,14 @@ class FitData
protected:
//- 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
);
friend class DemandDrivenMeshObject
<
fvMesh,
MoveableMeshObject,
FitDataType
>;
public:
// Constructors
// Protected Constructors
//- Construct from components
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
virtual ~FitData()
{}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -36,7 +36,7 @@ SourceFiles
#ifndef nonConformalBoundary_H
#define nonConformalBoundary_H
#include "MeshObject.H"
#include "DemandDrivenMeshObject.H"
#include "polyMesh.H"
#include "indirectPrimitivePatch.H"
@ -53,7 +53,12 @@ class nonConformalCoupledPolyPatch;
class nonConformalBoundary
:
public MeshObject<polyMesh, MoveableMeshObject, nonConformalBoundary>
public DemandDrivenMeshObject
<
polyMesh,
MoveableMeshObject,
nonConformalBoundary
>
{
// Private Data
@ -104,6 +109,21 @@ class nonConformalBoundary
const vectorField& ownerOrigBoundaryPointNormals0() const;
protected:
friend class DemandDrivenMeshObject
<
polyMesh,
MoveableMeshObject,
nonConformalBoundary
>;
// Protected Constructors
//- Construct from mesh
explicit nonConformalBoundary(const polyMesh& mesh);
public:
//- Runtime type information
@ -112,9 +132,6 @@ public:
// Constructors
//- Construct from a mesh
nonConformalBoundary(const polyMesh& mesh);
//- Disallow default bitwise copy construction
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)
:
MeshObject<polyMesh, Foam::TopologicalMeshObject, regionSplit>(mesh),
labelList(mesh.nCells(), -1)
labelList(mesh.nCells(), -1),
mesh_(mesh)
{
globalNumberingPtr_ = calcRegionSplit
(
@ -414,8 +414,8 @@ Foam::regionSplit::regionSplit
const bool doGlobalRegions
)
:
MeshObject<polyMesh, Foam::TopologicalMeshObject, regionSplit>(mesh),
labelList(mesh.nCells(), -1)
labelList(mesh.nCells(), -1),
mesh_(mesh)
{
globalNumberingPtr_ = calcRegionSplit
(
@ -435,8 +435,8 @@ Foam::regionSplit::regionSplit
const bool doGlobalRegions
)
:
MeshObject<polyMesh, Foam::TopologicalMeshObject, regionSplit>(mesh),
labelList(mesh.nCells(), -1)
labelList(mesh.nCells(), -1),
mesh_(mesh)
{
globalNumberingPtr_ = calcRegionSplit
(

View File

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

View File

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

View File

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