Go to the documentation of this file.
84 bool haveV = (VPtr_ !=
nullptr);
85 bool haveSf = (SfPtr_ !=
nullptr);
86 bool haveMagSf = (magSfPtr_ !=
nullptr);
87 bool haveCP = (CPtr_ !=
nullptr);
88 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);
204 V0.setSize(V.size());
208 curTimeIndex_ = time().timeIndex();
213 <<
" Stored old time volumes V0:" << V0Ptr_->size()
219 <<
" Stored oldold time volumes V00:" << V00Ptr_->size()
371 std::move(allNeighbour),
454 std::move(allNeighbour),
471 static_cast<const data&
>(baseMesh)
521 static_cast<const data&
>(baseMesh)
607 const bool validBoundary
613 <<
" boundary already exists"
617 addPatches(plist, validBoundary);
625 const bool validBoundary
631 addFvPatches(plist, validBoundary);
641 boundary_.setSize(0);
696 <<
"Calculating fvMeshLduAddressing from nFaces:"
718 <<
" nCells:" << nCells()
720 <<
" nFaces:" << nFaces()
726 meshMap.
cellMap().size() != nCells()
727 || meshMap.
faceMap().size() != nFaces()
731 <<
"mapPolyMesh does not correspond to the old mesh."
732 <<
" nCells:" << nCells()
733 <<
" cellMap:" << meshMap.
cellMap().size()
735 <<
" nFaces:" << nFaces()
736 <<
" faceMap:" << meshMap.
faceMap().size()
745 MapGeometricFields<scalar, fvPatchField, fvMeshMapper, volMesh>
747 MapGeometricFields<vector, fvPatchField, fvMeshMapper, volMesh>
749 MapGeometricFields<sphericalTensor, fvPatchField, fvMeshMapper, volMesh>
751 MapGeometricFields<symmTensor, fvPatchField, fvMeshMapper, volMesh>
753 MapGeometricFields<tensor, fvPatchField, fvMeshMapper, volMesh>
757 MapGeometricFields<scalar, fvsPatchField, fvMeshMapper, surfaceMesh>
759 MapGeometricFields<vector, fvsPatchField, fvMeshMapper, surfaceMesh>
761 MapGeometricFields<symmTensor, fvsPatchField, fvMeshMapper, surfaceMesh>
763 MapGeometricFields<symmTensor, fvsPatchField, fvMeshMapper, surfaceMesh>
765 MapGeometricFields<tensor, fvsPatchField, fvMeshMapper, surfaceMesh>
769 MapDimensionedFields<scalar, fvMeshMapper, volMesh>(mapper);
770 MapDimensionedFields<vector, fvMeshMapper, volMesh>(mapper);
771 MapDimensionedFields<sphericalTensor, fvMeshMapper, volMesh>(mapper);
772 MapDimensionedFields<symmTensor, fvMeshMapper, volMesh>(mapper);
773 MapDimensionedFields<tensor, fvMeshMapper, volMesh>(mapper);
787 V0.setSize(nCells());
793 V0[i] = savedV0[cellMap[i]];
809 label celli = -index-2;
811 V0[celli] += savedV0[oldCelli];
818 <<
"Mapping old time volume V0. Merged "
819 << nMerged <<
" out of " << nCells() <<
" cells" <<
endl;
829 V00.setSize(nCells());
835 V00[i] = savedV00[cellMap[i]];
851 label celli = -index-2;
853 V00[celli] += savedV00[oldCelli];
859 <<
"Mapping old time volume V00. Merged "
860 << nMerged <<
" out of " << nCells() <<
" cells" <<
endl;
879 scalar rDeltaT = 1.0/time().deltaTValue();
905 if (phiPtr_->timeIndex() != time().timeIndex())
921 phibf[patchi] =
patches[patchi].patchSlice(sweptVols);
922 phibf[patchi] *= rDeltaT;
931 updateGeomNotOldVol();
935 boundary_.movePoints();
938 meshObject::movePoints<fvMesh>(*
this);
939 meshObject::movePoints<lduMesh>(*
this);
970 if (VPtr_ && (V().size() != mpm.
nOldCells()))
973 <<
"V:" << V().size()
974 <<
" not equal to the number of old cells "
978 if (V0Ptr_ && (V0Ptr_->size() != mpm.
nOldCells()))
981 <<
"V0:" << V0Ptr_->size()
982 <<
" not equal to the number of old cells "
986 if (V00Ptr_ && (V00Ptr_->size() != mpm.
nOldCells()))
989 <<
"V0:" << V00Ptr_->size()
990 <<
" not equal to the number of old cells "
1001 clearGeomNotOldVol();
1010 clearAddressing(
true);
1012 meshObject::updateMesh<fvMesh>(*
this, mpm);
1013 meshObject::updateMesh<lduMesh>(*
this, mpm);
1026 ok = phiPtr_->write(valid);
1034 ok = V0Ptr_->write(valid);
1049 Foam::fvMesh::validComponents<Foam::sphericalTensor>()
const
1059 return &rhs !=
this;
1065 return &rhs ==
this;
int debug
Static debugging option.
The class contains the addressing required by the lduMatrix: upper, lower and losort.
void clearOut()
Clear all geometry and addressing.
void storeOldVol(const scalarField &)
Preserve old volume(s)
virtual ~fvMesh()
Destructor.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
#define InfoInFunction
Report an information message using Foam::Info.
virtual bool write(const bool valid=true) const
Write mesh using IO settings from time.
void clearAddressing()
Clear topological data.
A class for managing temporary objects.
void updateGeomNotOldVol()
Clear geometry like clearGeomNotOldVol but recreate any.
virtual tmp< scalarField > movePoints(const pointField &)
Move points, returns volumes swept by faces in motion.
void clearOutLocal()
Clear local-only storage (geometry, addressing etc)
SolverPerformance< Type > solveSegregatedOrCoupled(const dictionary &)
Solve segregated or coupled returning the solution statistics.
Selector class for finite volume differencing schemes. fvMesh is derived from fvSchemes so that all f...
Template functions to aid in the implementation of demand driven data.
void * VPtr_
Cell volumes old time level.
virtual void mapFields(const mapPolyMesh &mpm)
Map all fields in time using given map.
void clearGeomNotOldVol()
Clear geometry but not the old-time cell volumes.
void clearGeom()
Clear local geometry.
label nOldFaces() const
Number of old faces.
bool isFile(const fileName &name, const bool checkGzip=true, const bool followLink=true)
Does the name exist as a FILE in the file system?
const fileOperation & fileHandler()
Get current file handler.
void clearOut()
Clear all geometry and addressing unnecessary for CFD.
virtual bool init(const bool doInit)
Initialise all non-demand-driven data.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool operator!=(const fvMesh &rhs) const
Compares addresses.
bool operator==(const fvMesh &rhs) const
Compares addresses.
Mesh consisting of general polyhedral cells.
#define forAll(list, i)
Loop across all elements in list.
Generic Geometric field mapper. For "real" mapping, add template specialisations for mapping of inter...
Foam::fvMeshLduAddressing.
surfaceScalarField * magSfPtr_
Mag face area vectors.
slicedSurfaceVectorField * SfPtr_
Face area vectors.
Registry of regIOobjects.
virtual readUpdateState readUpdate()
Update the mesh based on the mesh files saved in time.
void deleteDemandDrivenData(DataPtr &dataPtr)
virtual SolverPerformance< scalar > solve(fvMatrix< scalar > &, const dictionary &) const
slicedSurfaceVectorField * CfPtr_
Face centres.
virtual void updateGeom()
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
virtual bool write(const bool valid=true) const
Write using setting from DB.
virtual lduInterfacePtrsList interfaces() const
Return a list of pointers for each patch.
#define DebugInFunction
Report an information message using Foam::Info.
virtual const lduAddressing & lduAddr() const
Return ldu addressing.
virtual void updateMesh(const mapPolyMesh &mpm)
Update the mesh corresponding to given map.
Selector class for finite volume solution solution. fvMesh is derived from fvSolution so that all fie...
The IOstreamOption is a simple container for options an IOstream can normally have.
virtual void updateMesh(const mapPolyMesh &mpm)
Update mesh corresponding to the given map.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
virtual bool writeObject(IOstreamOption streamOpt, const bool valid) const
Write the objects using stream options.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
void addFvPatches(PtrList< polyPatch > &plist, const bool validBoundary=true)
Add boundary patches. Constructor helper.
virtual bool movePoints()
Do what is necessary if the mesh has moved.
Mesh data needed to do the Finite Volume discretisation.
errorManip< error > abort(error &err)
fvMesh(const fvMesh &)=delete
No copy construct.
const scalarField & oldCellVolumes() const
errorManipArg< error, int > exit(error &err, const int errNo=1)
void removeBoundary()
Remove boundary patches.
Internal::FieldType & primitiveFieldRef(const bool updateAccessTime=true)
Return a reference to the internal field.
readUpdateState
Enumeration defining the state of the mesh after a read update.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
slicedVolVectorField * CPtr_
Cell centres.
const labelList & reverseCellMap() const
Reverse cell map.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual bool init(const bool doInit)
Initialise all non-demand-driven data.
#define DebugInfo
Report an information message using Foam::Info.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Class holds all the necessary information for mapping fields associated with fvMesh.
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
A traits class, which is primarily used for primitives.
void mapClouds(const objectRegistry &db, const mapPolyMesh &mapper)
Generic Geometric field mapper.
label nOldCells() const
Number of old cells.
static void clearUpto(objectRegistry &obr)
virtual void updateGeom()
Update all geometric data.
const polyBoundaryMesh & patches
const labelList & faceMap() const
Old face map.
Cell to surface interpolation scheme. Included in fvMesh.
The internalField of a SlicedGeometricField.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
SubField< scalar > subField
Declare type of subField.
const dimensionSet dimVolume(pow3(dimLength))
defineTypeNameAndDebug(combustionModel, 0)
Database for solution data, solver performance and other reduced data.
const labelList & cellMap() const
Old cell map.
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
void clearOut()
Clear all geometry and addressing.
virtual readUpdateState readUpdate()
Update the mesh based on the mesh files saved in.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
virtual bool writeObject(IOstreamOption streamOpt, const bool valid) const
Write the underlying polyMesh and other data.