80 const bool haveV = (VPtr_ !=
nullptr);
81 const bool haveSf = (SfPtr_ !=
nullptr);
82 const bool haveMagSf = (magSfPtr_ !=
nullptr);
83 const bool haveCP = (CPtr_ !=
nullptr);
84 const bool haveCf = (CfPtr_ !=
nullptr);
118 clearGeomNotOldVol();
157 meshObject::clear<fvMesh, TopologicalMeshObject>(*this);
158 meshObject::clear<lduMesh, TopologicalMeshObject>(*this);
169 <<
" Storing old time volumes since from time " << curTimeIndex_
170 <<
" and time now " << time().timeIndex()
171 <<
" V:" << V.size() <<
endl;
173 if (V00Ptr_ && V0Ptr_)
181 V0Ptr_ =
new DimensionedField<scalar, volMesh>
197 V0Ptr_->scalarField::resize_nocopy(V.size());
201 V0Ptr_->scalarField::operator=(V);
203 curTimeIndex_ = time().timeIndex();
208 <<
" Stored old time volumes V0:" << V0Ptr_->size()
214 <<
" Stored oldold time volumes V00:" << V00Ptr_->size()
300 rio.resetHeader(
"V0");
304 <<
"Detected V0: " << rio.objectRelPath() <<
nl;
306 V0Ptr_ =
new DimensionedField<scalar, volMesh>
322 rio.resetHeader(
"meshPhi");
326 <<
"Detected meshPhi: " << rio.objectRelPath() <<
nl;
344 V0Ptr_ =
new DimensionedField<scalar, volMesh>
381 std::move(allNeighbour),
485 std::move(allNeighbour),
502 static_cast<const
data&>(baseMesh)
552 static_cast<const
data&>(baseMesh)
638 const bool validBoundary
644 <<
" boundary already exists" 648 addPatches(plist, validBoundary);
656 const bool validBoundary
662 addFvPatches(plist, validBoundary);
720 <<
"Calculating fvMeshLduAddressing from nFaces:" 723 lduPtr_ =
new fvMeshLduAddressing(*
this);
742 <<
" nCells:" << nCells()
744 <<
" nFaces:" << nFaces()
755 <<
"mapPolyMesh does not correspond to the old mesh." 756 <<
" nCells:" << nCells()
759 <<
" nFaces:" << nFaces()
766 const fvMeshMapper mapper(*
this, meshMap);
769 MapGeometricFields<scalar, fvPatchField, fvMeshMapper, volMesh>
771 MapGeometricFields<vector, fvPatchField, fvMeshMapper, volMesh>
773 MapGeometricFields<sphericalTensor, fvPatchField, fvMeshMapper, volMesh>
775 MapGeometricFields<symmTensor, fvPatchField, fvMeshMapper, volMesh>
777 MapGeometricFields<tensor, fvPatchField, fvMeshMapper, volMesh>
781 MapGeometricFields<scalar, fvsPatchField, fvMeshMapper, surfaceMesh>
783 MapGeometricFields<vector, fvsPatchField, fvMeshMapper, surfaceMesh>
790 MapGeometricFields<symmTensor, fvsPatchField, fvMeshMapper, surfaceMesh>
792 MapGeometricFields<tensor, fvsPatchField, fvMeshMapper, surfaceMesh>
796 MapDimensionedFields<scalar, fvMeshMapper, volMesh>(mapper);
797 MapDimensionedFields<vector, fvMeshMapper, volMesh>(mapper);
798 MapDimensionedFields<sphericalTensor, fvMeshMapper, volMesh>(mapper);
799 MapDimensionedFields<symmTensor, fvMeshMapper, volMesh>(mapper);
800 MapDimensionedFields<tensor, fvMeshMapper, volMesh>(mapper);
814 V0.resize_nocopy(nCells());
820 V0[i] = savedV0[cellMap[i]];
836 label celli = -index-2;
838 V0[celli] += savedV0[oldCelli];
845 <<
"Mapping old time volume V0. Merged " 846 << nMerged <<
" out of " << nCells() <<
" cells" <<
endl;
856 V00.resize_nocopy(nCells());
862 V00[i] = savedV00[cellMap[i]];
878 label celli = -index-2;
880 V00[celli] += savedV00[oldCelli];
886 <<
"Mapping old time volume V00. Merged " 887 << nMerged <<
" out of " << nCells() <<
" cells" <<
endl;
930 if (phiPtr_->timeIndex() != time().timeIndex())
945 updateGeomNotOldVol();
948 boundary_.movePoints();
953 meshObject::movePoints<fvMesh>(*this);
954 meshObject::movePoints<lduMesh>(*this);
985 if (VPtr_ && (VPtr_->size() != mpm.
nOldCells()))
988 <<
"V:" << VPtr_->size()
989 <<
" not equal to the number of old cells " 993 if (V0Ptr_ && (V0Ptr_->size() != mpm.
nOldCells()))
996 <<
"V0:" << V0Ptr_->size()
997 <<
" not equal to the number of old cells " 1001 if (V00Ptr_ && (V00Ptr_->size() != mpm.
nOldCells()))
1004 <<
"V0:" << V00Ptr_->size()
1005 <<
" not equal to the number of old cells " 1036 clearGeomNotOldVol();
1045 clearAddressing(
true);
1047 meshObject::updateMesh<fvMesh>(*
this, mpm);
1048 meshObject::updateMesh<lduMesh>(*
this, mpm);
1055 const bool writeOnProc
1061 ok = phiPtr_->write(writeOnProc);
1069 ok = V0Ptr_->write(writeOnProc);
1084 Foam::fvMesh::validComponents<Foam::sphericalTensor>()
const 1094 return &rhs !=
this;
1100 return &rhs ==
this;
void clearOut()
Clear all geometry and addressing.
void size(const label n)
Older name for setAddressableSize.
slicedVolVectorField * CPtr_
Cell centres.
void clearAddressing()
Clear topological data.
void removeFvBoundary()
Remove boundary patches. Warning: fvPatchFields hold ref to these fvPatches.
virtual bool init(const bool doInit)
Initialise all non-demand-driven data.
label nOldCells() const
Number of old cells.
const labelList & cellMap() const
Old cell map.
errorManipArg< error, int > exit(error &err, const int errNo=1)
virtual void movePoints(const pointField &)
Move points.
virtual bool writeObject(IOstreamOption streamOpt, const bool writeOnProc) const
Write the underlying polyMesh and other data.
static void clearUpto(objectRegistry &obr)
Clear all meshObject derived from FromType up to (but not including) ToType.
void mapClouds(const objectRegistry &db, const mapPolyMesh &mapper)
Generic Geometric field mapper.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void clearOut()
Clear all geometry and addressing unnecessary for CFD.
constexpr char nl
The newline '\n' character (0x0a)
void clearOutLocal()
Clear local-only storage (geometry, addressing etc)
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface...
Ostream & endl(Ostream &os)
Add newline and flush stream.
A traits class, which is primarily used for primitives.
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
virtual bool movePoints()
Do what is necessary if the mesh has moved.
void storeOldVol(const scalarField &)
Preserve old volume(s)
const dimensionSet dimVol(dimVolume)
Older spelling for dimVolume.
A simple container for options an IOstream can normally have.
Cell to surface interpolation scheme. Included in fvMesh.
Ignore writing from objectRegistry::writeObject()
SolverPerformance< Type > solveSegregatedOrCoupled(const dictionary &)
Solve segregated or coupled returning the solution statistics.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
void MapGeometricFields(const MeshMapper &mapper)
Generic Geometric field mapper.
#define forAll(list, i)
Loop across all elements in list.
virtual bool writeObject(IOstreamOption streamOpt, const bool writeOnProc) const
Write the objects using stream options.
void clearGeomNotOldVol()
Clear geometry but not the old-time cell volumes.
virtual ~fvMesh()
Destructor.
const dimensionSet dimVolume(pow3(dimLength))
vectorField pointField
pointField is a vectorField.
virtual void updateMesh(const mapPolyMesh &mpm)
Update mesh corresponding to the given map.
virtual void updateGeom()
Update all geometric data.
virtual readUpdateState readUpdate()
Update the mesh based on the mesh files saved in time.
virtual void updateMesh(const mapPolyMesh &mpm)
Update the mesh corresponding to given map.
virtual void updateMesh(const mapPolyMesh &mpm)
Update mesh for topology changes.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
bool operator!=(const fvMesh &rhs) const
Compares addresses.
#define DebugInFunction
Report an information message using Foam::Info.
virtual const lduAddressing & lduAddr() const
Return ldu addressing.
virtual bool write(const bool writeOnProc=true) const
Write using setting from DB.
void clearGeom()
Clear local geometry.
A special matrix type and solver, designed for finite volume solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise.
virtual SolverPerformance< scalar > solve(fvMatrix< scalar > &, const dictionary &) const
Solve returning the solution statistics given convergence tolerance. Use the given solver controls...
errorManip< error > abort(error &err)
fvMesh(const fvMesh &)=delete
No copy construct.
virtual bool write(const bool writeOnProc=true) const
Write mesh using IO settings from time.
#define DebugInfo
Report an information message using Foam::Info.
void removeBoundary()
Remove boundary patches.
bool operator==(const fvMesh &rhs) const
Compares addresses.
const labelList & reverseCellMap() const
Reverse cell map.
int debug
Static debugging option.
defineTypeNameAndDebug(combustionModel, 0)
Database for solution data, solver performance and other reduced data.
void addFvPatches(polyPatchList &plist, const bool validBoundary=true)
Add boundary patches. Constructor helper.
const labelList & faceMap() const
Old face map.
Generic Geometric field mapper. For "real" mapping, add template specialisations for mapping of inter...
surfaceScalarField * magSfPtr_
Mag face area vectors.
Template functions to aid in the implementation of demand driven data.
const scalarField & oldCellVolumes() const
virtual lduInterfacePtrsList interfaces() const
Return a list of pointers for each patch.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Selector class for finite volume solution solution. fvMesh is derived from fvSolution so that all fie...
void clearOut()
Clear all geometry and addressing.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
Selector class for finite volume differencing schemes. fvMesh is derived from fvSchemes so that all f...
Mesh data needed to do the Finite Volume discretisation.
virtual bool init(const bool doInit)
Initialise all non-demand-driven data.
Automatically write from objectRegistry::writeObject()
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
slicedSurfaceVectorField * SfPtr_
Face area vectors.
void updateGeomNotOldVol()
Clear geometry like clearGeomNotOldVol but recreate any.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Reading is optional [identical to READ_IF_PRESENT].
virtual void updateGeom()
Update all geometric data. This gets redirected up from primitiveMesh level.
The class contains the addressing required by the lduMatrix: upper, lower and losort.
SlicedDimensionedField< scalar, volMesh > * VPtr_
Cell volumes.
Mesh consisting of general polyhedral cells.
SphericalTensor< scalar > sphericalTensor
SphericalTensor of scalars, i.e. SphericalTensor<scalar>.
readUpdateState
Enumeration defining the state of the mesh after a read update.
List< label > labelList
A List of labels.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
virtual readUpdateState readUpdate()
Update the mesh based on the mesh files saved in.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Registry of regIOobjects.
bool returnReduceOr(const bool value, const label comm=UPstream::worldComm)
Perform logical (or) MPI Allreduce on a copy. Uses UPstream::reduceOr.
void deleteDemandDrivenData(DataPtr &dataPtr)
Defines the attributes of an object for which implicit objectRegistry management is supported...
label nOldFaces() const
Number of old faces.
slicedSurfaceVectorField * CfPtr_
Face centres.
Do not request registration (bool: false)
virtual void mapFields(const mapPolyMesh &mpm)
Map all fields in time using given map.
#define InfoInFunction
Report an information message using Foam::Info.
static constexpr const zero Zero
Global zero (0)