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()
344 std::move(allNeighbour),
478 const bool validBoundary
484 <<
" boundary already exists"
488 addPatches(plist, validBoundary);
496 const bool validBoundary
502 addFvPatches(plist, validBoundary);
512 boundary_.setSize(0);
566 <<
"Calculating fvMeshLduAddressing from nFaces:"
580 <<
" nCells:" << nCells()
582 <<
" nFaces:" << nFaces()
588 meshMap.
cellMap().size() != nCells()
589 || meshMap.
faceMap().size() != nFaces()
593 <<
"mapPolyMesh does not correspond to the old mesh."
594 <<
" nCells:" << nCells()
595 <<
" cellMap:" << meshMap.
cellMap().size()
597 <<
" nFaces:" << nFaces()
598 <<
" faceMap:" << meshMap.
faceMap().size()
607 MapGeometricFields<scalar, fvPatchField, fvMeshMapper, volMesh>
609 MapGeometricFields<vector, fvPatchField, fvMeshMapper, volMesh>
611 MapGeometricFields<sphericalTensor, fvPatchField, fvMeshMapper, volMesh>
613 MapGeometricFields<symmTensor, fvPatchField, fvMeshMapper, volMesh>
615 MapGeometricFields<tensor, fvPatchField, fvMeshMapper, volMesh>
619 MapGeometricFields<scalar, fvsPatchField, fvMeshMapper, surfaceMesh>
621 MapGeometricFields<vector, fvsPatchField, fvMeshMapper, surfaceMesh>
623 MapGeometricFields<symmTensor, fvsPatchField, fvMeshMapper, surfaceMesh>
625 MapGeometricFields<symmTensor, fvsPatchField, fvMeshMapper, surfaceMesh>
627 MapGeometricFields<tensor, fvsPatchField, fvMeshMapper, surfaceMesh>
631 MapDimensionedFields<scalar, fvMeshMapper, volMesh>(mapper);
632 MapDimensionedFields<vector, fvMeshMapper, volMesh>(mapper);
633 MapDimensionedFields<sphericalTensor, fvMeshMapper, volMesh>(mapper);
634 MapDimensionedFields<symmTensor, fvMeshMapper, volMesh>(mapper);
635 MapDimensionedFields<tensor, fvMeshMapper, volMesh>(mapper);
649 V0.setSize(nCells());
655 V0[i] = savedV0[cellMap[i]];
671 label celli = -index-2;
673 V0[celli] += savedV0[oldCelli];
680 <<
"Mapping old time volume V0. Merged "
681 << nMerged <<
" out of " << nCells() <<
" cells" <<
endl;
691 V00.setSize(nCells());
697 V00[i] = savedV00[cellMap[i]];
713 label celli = -index-2;
715 V00[celli] += savedV00[oldCelli];
721 <<
"Mapping old time volume V00. Merged "
722 << nMerged <<
" out of " << nCells() <<
" cells" <<
endl;
741 scalar rDeltaT = 1.0/time().deltaTValue();
767 if (phiPtr_->timeIndex() != time().timeIndex())
783 phibf[patchi] =
patches[patchi].patchSlice(sweptVols);
784 phibf[patchi] *= rDeltaT;
793 updateGeomNotOldVol();
797 boundary_.movePoints();
800 meshObject::movePoints<fvMesh>(*
this);
801 meshObject::movePoints<lduMesh>(*
this);
824 if (VPtr_ && (V().size() != mpm.
nOldCells()))
827 <<
"V:" << V().size()
828 <<
" not equal to the number of old cells "
832 if (V0Ptr_ && (V0Ptr_->size() != mpm.
nOldCells()))
835 <<
"V0:" << V0Ptr_->size()
836 <<
" not equal to the number of old cells "
840 if (V00Ptr_ && (V00Ptr_->size() != mpm.
nOldCells()))
843 <<
"V0:" << V00Ptr_->size()
844 <<
" not equal to the number of old cells "
855 clearGeomNotOldVol();
864 clearAddressing(
true);
866 meshObject::updateMesh<fvMesh>(*
this, mpm);
867 meshObject::updateMesh<lduMesh>(*
this, mpm);
880 ok = phiPtr_->write(valid);
888 ok = V0Ptr_->write(valid);
903 Foam::fvMesh::validComponents<Foam::sphericalTensor>()
const
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.
SolverPerformance< Type > solveSegregatedOrCoupled(const dictionary &)
Solve segregated or coupled returning the solution statistics.
Selector class for finite volume differencing schemes. fvMesh is derived from fvShemes so that all fi...
Template functions to aid in the implementation of demand driven data.
bool moving() const
Is mesh moving.
virtual const fileName & dbDir() const
Override the objectRegistry dbDir for a single-region case.
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 geometry.
label nOldFaces() const
Number of old faces.
void removeFvBoundary()
Remove boundary patches. Warning: fvPatchFields hold ref to.
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.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool operator!=(const fvMesh &rhs) const
Compares addresses.
const DimensionedField< scalar, volMesh > & V00() const
Return old-old-time cell volumes.
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
DimensionedField< scalar, volMesh > * V0Ptr_
Cell volumes old time level.
slicedSurfaceVectorField * CfPtr_
Face centres.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
virtual bool write(const bool valid=true) const
Write using setting from DB.
#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.
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.
#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.
Traits class 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)
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.
const Time & time() const
Return the top-level database.
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.
const DimensionedField< scalar, volMesh > & V() const
Return cell volumes.
surfaceScalarField * phiPtr_
Face motion fluxes.
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.