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()
299 rio.resetHeader(
"V0");
303 <<
"Detected V0: " << rio.objectRelPath() <<
nl;
305 V0Ptr_ =
new DimensionedField<scalar, volMesh>
321 rio.resetHeader(
"meshPhi");
325 <<
"Detected meshPhi: " << rio.objectRelPath() <<
nl;
343 V0Ptr_ =
new DimensionedField<scalar, volMesh>
380 std::move(allNeighbour),
482 std::move(allNeighbour),
489 static_cast<const
dictionary*>(baseMesh.hasSchemes())
496 static_cast<const
dictionary*>(baseMesh.hasSolution())
539 static_cast<const
dictionary*>(baseMesh.hasSchemes())
546 static_cast<const
dictionary*>(baseMesh.hasSolution())
579 return static_cast<const fvSchemes*
>(
this);
591 return static_cast<const fvSchemes&
>(*this);
671 const bool validBoundary
677 <<
" boundary already exists" 681 addPatches(plist, validBoundary);
689 const bool validBoundary
695 addFvPatches(plist, validBoundary);
753 <<
"Calculating fvMeshLduAddressing from nFaces:" 756 lduPtr_ =
new fvMeshLduAddressing(*
this);
775 <<
" nCells:" << nCells()
777 <<
" nFaces:" << nFaces()
788 <<
"mapPolyMesh does not correspond to the old mesh." 789 <<
" nCells:" << nCells()
792 <<
" nFaces:" << nFaces()
799 const fvMeshMapper mapper(*
this, meshMap);
802 MapGeometricFields<scalar, fvPatchField, fvMeshMapper, volMesh>
804 MapGeometricFields<vector, fvPatchField, fvMeshMapper, volMesh>
806 MapGeometricFields<sphericalTensor, fvPatchField, fvMeshMapper, volMesh>
808 MapGeometricFields<symmTensor, fvPatchField, fvMeshMapper, volMesh>
810 MapGeometricFields<tensor, fvPatchField, fvMeshMapper, volMesh>
814 MapGeometricFields<scalar, fvsPatchField, fvMeshMapper, surfaceMesh>
816 MapGeometricFields<vector, fvsPatchField, fvMeshMapper, surfaceMesh>
823 MapGeometricFields<symmTensor, fvsPatchField, fvMeshMapper, surfaceMesh>
825 MapGeometricFields<tensor, fvsPatchField, fvMeshMapper, surfaceMesh>
829 MapDimensionedFields<scalar, fvMeshMapper, volMesh>(mapper);
830 MapDimensionedFields<vector, fvMeshMapper, volMesh>(mapper);
831 MapDimensionedFields<sphericalTensor, fvMeshMapper, volMesh>(mapper);
832 MapDimensionedFields<symmTensor, fvMeshMapper, volMesh>(mapper);
833 MapDimensionedFields<tensor, fvMeshMapper, volMesh>(mapper);
847 V0.resize_nocopy(nCells());
853 V0[i] = savedV0[cellMap[i]];
869 label celli = -index-2;
871 V0[celli] += savedV0[oldCelli];
878 <<
"Mapping old time volume V0. Merged " 879 << nMerged <<
" out of " << nCells() <<
" cells" <<
endl;
889 V00.resize_nocopy(nCells());
895 V00[i] = savedV00[cellMap[i]];
911 label celli = -index-2;
913 V00[celli] += savedV00[oldCelli];
919 <<
"Mapping old time volume V00. Merged " 920 << nMerged <<
" out of " << nCells() <<
" cells" <<
endl;
963 if (phiPtr_->timeIndex() != time().timeIndex())
978 updateGeomNotOldVol();
981 boundary_.movePoints();
986 meshObject::movePoints<fvMesh>(*this);
987 meshObject::movePoints<lduMesh>(*this);
1018 if (VPtr_ && (VPtr_->size() != mpm.
nOldCells()))
1021 <<
"V:" << VPtr_->size()
1022 <<
" not equal to the number of old cells " 1026 if (V0Ptr_ && (V0Ptr_->size() != mpm.
nOldCells()))
1029 <<
"V0:" << V0Ptr_->size()
1030 <<
" not equal to the number of old cells " 1034 if (V00Ptr_ && (V00Ptr_->size() != mpm.
nOldCells()))
1037 <<
"V0:" << V00Ptr_->size()
1038 <<
" not equal to the number of old cells " 1069 clearGeomNotOldVol();
1078 clearAddressing(
true);
1080 meshObject::updateMesh<fvMesh>(*
this, mpm);
1081 meshObject::updateMesh<lduMesh>(*
this, mpm);
1088 const bool writeOnProc
1094 ok = phiPtr_->write(writeOnProc);
1102 ok = V0Ptr_->write(writeOnProc);
1117 Foam::fvMesh::validComponents<Foam::sphericalTensor>()
const 1127 return &rhs !=
this;
1133 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.
const fvSchemes & schemes() const
Read-access to the fvSchemes controls.
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 and vector-space.
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)
virtual const meshState & data() const noexcept
Const reference to the mesh and solver state data.
const dimensionSet dimVol(dimVolume)
Older spelling for dimVolume.
const fvSolution & solution() const
Read-access to the fvSolution controls.
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.
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.
void reset(const meshState &ms)
Reset the dictionary.
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)
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 fvSchemes * hasSchemes() const
Non-null if fvSchemes exists (can test as bool).
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.
const fvSolution * hasSolution() const
Non-null if fvSolution exists (can test as bool).
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)
virtual bool writeObject(IOstreamOption streamOpt, const bool writeOnProc=true) const
Write items held in the objectRegistry. Normally includes mesh components (points, faces, etc) and any registered fields.