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_)
182 V0Ptr_->scalarField::operator=(V);
187 V0Ptr_ =
new DimensionedField<scalar, volMesh>
208 curTimeIndex_ = time().timeIndex();
213 <<
" Stored old time volumes V0:" << V0Ptr_->size()
219 <<
" Stored oldold time volumes V00:" << V00Ptr_->size()
296 V0Ptr_ =
new DimensionedField<scalar, volMesh>
340 V0Ptr_ =
new DimensionedField<scalar, volMesh>
377 std::move(allNeighbour),
481 std::move(allNeighbour),
498 static_cast<const
data&>(baseMesh)
548 static_cast<const
data&>(baseMesh)
634 const bool validBoundary
640 <<
" boundary already exists" 644 addPatches(plist, validBoundary);
652 const bool validBoundary
658 addFvPatches(plist, validBoundary);
668 boundary_.setSize(0);
723 <<
"Calculating fvMeshLduAddressing from nFaces:" 745 <<
" nCells:" << nCells()
747 <<
" nFaces:" << nFaces()
758 <<
"mapPolyMesh does not correspond to the old mesh." 759 <<
" nCells:" << nCells()
762 <<
" nFaces:" << nFaces()
769 const fvMeshMapper mapper(*
this, meshMap);
772 MapGeometricFields<scalar, fvPatchField, fvMeshMapper, volMesh>
774 MapGeometricFields<vector, fvPatchField, fvMeshMapper, volMesh>
776 MapGeometricFields<sphericalTensor, fvPatchField, fvMeshMapper, volMesh>
778 MapGeometricFields<symmTensor, fvPatchField, fvMeshMapper, volMesh>
780 MapGeometricFields<tensor, fvPatchField, fvMeshMapper, volMesh>
784 MapGeometricFields<scalar, fvsPatchField, fvMeshMapper, surfaceMesh>
786 MapGeometricFields<vector, fvsPatchField, fvMeshMapper, surfaceMesh>
793 MapGeometricFields<symmTensor, fvsPatchField, fvMeshMapper, surfaceMesh>
795 MapGeometricFields<tensor, fvsPatchField, fvMeshMapper, surfaceMesh>
799 MapDimensionedFields<scalar, fvMeshMapper, volMesh>(mapper);
800 MapDimensionedFields<vector, fvMeshMapper, volMesh>(mapper);
801 MapDimensionedFields<sphericalTensor, fvMeshMapper, volMesh>(mapper);
802 MapDimensionedFields<symmTensor, fvMeshMapper, volMesh>(mapper);
803 MapDimensionedFields<tensor, fvMeshMapper, volMesh>(mapper);
817 V0.setSize(nCells());
823 V0[i] = savedV0[cellMap[i]];
839 label celli = -index-2;
841 V0[celli] += savedV0[oldCelli];
848 <<
"Mapping old time volume V0. Merged " 849 << nMerged <<
" out of " << nCells() <<
" cells" <<
endl;
859 V00.setSize(nCells());
865 V00[i] = savedV00[cellMap[i]];
881 label celli = -index-2;
883 V00[celli] += savedV00[oldCelli];
889 <<
"Mapping old time volume V00. Merged " 890 << nMerged <<
" out of " << nCells() <<
" cells" <<
endl;
933 if (phiPtr_->timeIndex() != time().timeIndex())
948 updateGeomNotOldVol();
951 boundary_.movePoints();
956 meshObject::movePoints<fvMesh>(*this);
957 meshObject::movePoints<lduMesh>(*this);
988 if (VPtr_ && (VPtr_->size() != mpm.
nOldCells()))
991 <<
"V:" << VPtr_->size()
992 <<
" not equal to the number of old cells " 996 if (V0Ptr_ && (V0Ptr_->size() != mpm.
nOldCells()))
999 <<
"V0:" << V0Ptr_->size()
1000 <<
" not equal to the number of old cells " 1004 if (V00Ptr_ && (V00Ptr_->size() != mpm.
nOldCells()))
1007 <<
"V0:" << V00Ptr_->size()
1008 <<
" not equal to the number of old cells " 1039 clearGeomNotOldVol();
1048 clearAddressing(
true);
1050 meshObject::updateMesh<fvMesh>(*
this, mpm);
1051 meshObject::updateMesh<lduMesh>(*
this, mpm);
1064 ok = phiPtr_->write(valid);
1072 ok = V0Ptr_->write(valid);
1087 Foam::fvMesh::validComponents<Foam::sphericalTensor>()
const 1097 return &rhs !=
this;
1103 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.
virtual bool writeObject(IOstreamOption streamOpt, const bool valid) const
Write the underlying polyMesh and other 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.
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...
virtual bool writeObject(IOstreamOption streamOpt, const bool valid) const
Write the objects using stream options.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual bool write(const bool valid=true) const
Write mesh using IO settings from time.
void clearOut()
Clear all geometry and addressing unnecessary for CFD.
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)
autoPtr< fileOperation > fileHandler(std::nullptr_t)
Delete current file handler.
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.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
void setSize(const label n)
Alias for resize()
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.
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.
#define DebugInfo
Report an information message using Foam::Info.
void removeBoundary()
Remove boundary patches.
bool operator==(const fvMesh &rhs) const
Compares addresses.
Foam::fvMeshLduAddressing.
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.
bool isFile(const fileName &name, const bool checkGzip=true, const bool followLink=true)
Does the name exist as a FILE in the file system?
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 ...
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.
virtual readUpdateState readUpdate()
Update the mesh based on the mesh files saved in.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Registry of regIOobjects.
virtual bool write(const bool valid=true) const
Write using setting from DB.
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.
virtual void mapFields(const mapPolyMesh &mpm)
Map all fields in time using given map.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
#define InfoInFunction
Report an information message using Foam::Info.
static constexpr const zero Zero
Global zero (0)