50 void Foam::fvMesh::clearGeomNotOldVol()
78 void Foam::fvMesh::updateGeomNotOldVol()
80 bool haveV = (VPtr_ !=
nullptr);
81 bool haveSf = (SfPtr_ !=
nullptr);
82 bool haveMagSf = (magSfPtr_ !=
nullptr);
83 bool haveCP = (CPtr_ !=
nullptr);
84 bool haveCf = (CfPtr_ !=
nullptr);
112 void Foam::fvMesh::clearGeom()
114 clearGeomNotOldVol();
138 TopologicalMeshObject,
147 TopologicalMeshObject,
156 meshObject::clear<fvMesh, TopologicalMeshObject>(*this);
157 meshObject::clear<lduMesh, TopologicalMeshObject>(*this);
163 void Foam::fvMesh::storeOldVol(
const scalarField& V)
170 <<
" Storing old time volumes since from time " << curTimeIndex_
171 <<
" and time now " << time().timeIndex()
177 if (V00Ptr_ && V0Ptr_)
186 V0Ptr_->scalarField::operator=(V);
191 V0Ptr_ =
new DimensionedField<scalar, volMesh>
212 curTimeIndex_ = time().timeIndex();
217 <<
" Stored old time volumes V0:" << V0Ptr_->size()
222 <<
" Stored oldold time volumes V00:" << V00Ptr_->size()
342 const word& defaultBoundaryPatchName,
343 const word& defaultBoundaryPatchType,
355 defaultBoundaryPatchName,
356 defaultBoundaryPatchType,
360 fvSchemes(static_cast<const objectRegistry&>(*
this)),
361 fvSolution(static_cast<const objectRegistry&>(*
this)),
362 data(static_cast<const objectRegistry&>(*
this)),
392 polyMesh(io, points, faces, allOwner, allNeighbour, syncPar),
394 fvSchemes(static_cast<const objectRegistry&>(*
this)),
395 fvSolution(static_cast<const objectRegistry&>(*
this)),
396 data(static_cast<const objectRegistry&>(*
this)),
425 polyMesh(io, points, faces, cells, syncPar),
427 fvSchemes(static_cast<const objectRegistry&>(*
this)),
428 fvSolution(static_cast<const objectRegistry&>(*
this)),
429 data(static_cast<const objectRegistry&>(*
this)),
462 const bool validBoundary
468 <<
" boundary already exists" 507 Info<<
"Boundary and topological update" <<
endl;
519 Info<<
"Topological update" <<
endl;
528 Info<<
"Point motion update" <<
endl;
583 <<
"mapPolyMesh does not correspond to the old mesh." 597 MapGeometricFields<scalar, fvPatchField, fvMeshMapper, volMesh>
599 MapGeometricFields<vector, fvPatchField, fvMeshMapper, volMesh>
601 MapGeometricFields<sphericalTensor, fvPatchField, fvMeshMapper, volMesh>
603 MapGeometricFields<symmTensor, fvPatchField, fvMeshMapper, volMesh>
605 MapGeometricFields<tensor, fvPatchField, fvMeshMapper, volMesh>
609 MapGeometricFields<scalar, fvsPatchField, fvMeshMapper, surfaceMesh>
611 MapGeometricFields<vector, fvsPatchField, fvMeshMapper, surfaceMesh>
613 MapGeometricFields<symmTensor, fvsPatchField, fvMeshMapper, surfaceMesh>
615 MapGeometricFields<symmTensor, fvsPatchField, fvMeshMapper, surfaceMesh>
617 MapGeometricFields<tensor, fvsPatchField, fvMeshMapper, surfaceMesh>
621 MapDimensionedFields<scalar, fvMeshMapper, volMesh>(mapper);
622 MapDimensionedFields<vector, fvMeshMapper, volMesh>(mapper);
623 MapDimensionedFields<sphericalTensor, fvMeshMapper, volMesh>(mapper);
624 MapDimensionedFields<symmTensor, fvMeshMapper, volMesh>(mapper);
625 MapDimensionedFields<tensor, fvMeshMapper, volMesh>(mapper);
645 V0[i] = savedV0[cellMap[i]];
661 label celli = -index-2;
663 V0[celli] += savedV0[oldCelli];
671 Info<<
"Mapping old time volume V0. Merged " 672 << nMerged <<
" out of " <<
nCells() <<
" cells" <<
endl;
689 V00[i] = savedV00[cellMap[i]];
705 label celli = -index-2;
707 V00[celli] += savedV00[oldCelli];
714 Info<<
"Mapping old time volume V00. Merged " 715 << nMerged <<
" out of " <<
nCells() <<
" cells" <<
endl;
786 updateGeomNotOldVol();
793 meshObject::movePoints<fvMesh>(*this);
794 meshObject::movePoints<lduMesh>(*this);
815 <<
"V:" <<
V().size()
816 <<
" not equal to the number of old cells " 820 if (V0Ptr_ && (V0Ptr_->size() != mpm.
nOldCells()))
823 <<
"V0:" << V0Ptr_->size()
824 <<
" not equal to the number of old cells " 828 if (V00Ptr_ && (V00Ptr_->size() != mpm.
nOldCells()))
831 <<
"V0:" << V00Ptr_->size()
832 <<
" not equal to the number of old cells " 843 clearGeomNotOldVol();
854 meshObject::updateMesh<fvMesh>(*
this, mpm);
855 meshObject::updateMesh<lduMesh>(*
this, mpm);
870 ok = phiPtr_->
write(valid);
885 Foam::fvMesh::validComponents<Foam::sphericalTensor>()
const
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
A simple container for copying or transferring objects of type <T>.
void clearOut()
Clear all geometry and addressing.
virtual tmp< scalarField > movePoints(const pointField &)
Move points, returns volumes swept by faces in motion.
#define forAll(list, i)
Loop across all elements in list.
void clearAddressing()
Clear topological data.
const GeometricField< Type, PatchField, GeoMesh > & oldTime() const
Return old time field.
void removeFvBoundary()
Remove boundary patches. Warning: fvPatchFields hold ref to.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
virtual bool writeObject(IOstream::streamFormat fmt, IOstream::versionNumber ver, IOstream::compressionType cmp, const bool valid) const
Write the objects.
label nOldCells() const
Number of old cells.
const labelList & cellMap() const
Old cell map.
bool moving() const
Is mesh moving.
errorManipArg< error, int > exit(error &err, const int errNo=1)
void mapClouds(const objectRegistry &db, const mapPolyMesh &mapper)
Generic Geometric field mapper.
void addFvPatches(const List< polyPatch *> &, const bool validBoundary=true)
Add boundary patches. Constructor helper.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static int debug
Debug switch.
label nInternalFaces() const
virtual bool write(const bool valid=true) const
Write mesh using IO settings from time.
T & ref() const
Return non-const reference or generate a fatal error.
void clearOut()
Clear all geometry and addressing unnecessary for CFD.
void size(const label)
Override size to be inconsistent with allocated storage.
IOobject(const word &name, const fileName &instance, const objectRegistry ®istry, readOption r=NO_READ, writeOption w=NO_WRITE, bool registerObject=true)
Construct from name, instance, registry, io options.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface...
const surfaceScalarField & phi() const
Return cell face motion fluxes.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Traits class for primitives.
bool movePoints()
Do what is neccessary if the mesh has moved.
const DimensionedField< scalar, volMesh > & V00() const
Return old-old-time cell volumes.
Cell to surface interpolation scheme. Included in fvMesh.
const Time & time() const
Return the top-level database.
const DimensionedField< scalar, volMesh > & V() const
Return cell volumes.
DimensionedField< Type, GeoMesh > Internal
Type of the internal field from which this GeometricField is derived.
Class holds all the necessary information for mapping fields associated with fvMesh.
label size() const
Return number of elements in table.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
virtual ~fvMesh()
Destructor.
void readUpdate(const polyBoundaryMesh &)
Update boundary based on new polyBoundaryMesh.
bool operator!=(const fvMesh &) const
const dimensionSet dimVolume(pow3(dimLength))
virtual void updateMesh(const mapPolyMesh &mpm)
Update mesh corresponding to the given map.
virtual readUpdateState readUpdate()
Update the mesh based on the mesh files saved in time.
virtual bool writeObject(IOstream::streamFormat fmt, IOstream::versionNumber ver, IOstream::compressionType cmp, const bool valid) const
Write the underlying polyMesh and other data.
virtual void updateMesh(const mapPolyMesh &mpm)
Update the mesh corresponding to given map.
surfaceInterpolation(const fvMesh &)
Construct given an fvMesh.
A class for handling words, derived from string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
virtual const lduAddressing & lduAddr() const
Return ldu addressing.
static void clearUpto(objectRegistry &)
Clear all meshObject derived from FromType up to (but not including)
scalar deltaTValue() const
Return time step value.
streamFormat
Enumeration for the format of data in the stream.
const fileOperation & fileHandler()
Get current file handler.
errorManip< error > abort(error &err)
void addPatches(const List< polyPatch *> &, const bool validBoundary=true)
Add boundary patches.
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
compressionType
Enumeration for the format of data in the stream.
void removeBoundary()
Remove boundary patches.
bool isFile(const fileName &, const bool checkGzip=true, const bool followLink=true)
Does the name exist as a FILE in the file system?
Foam::fvMeshLduAddressing.
Internal::FieldType & primitiveFieldRef()
Return a reference to the internal field.
const labelList & reverseCellMap() const
Reverse cell map.
defineTypeNameAndDebug(combustionModel, 0)
Database for solution data, solver performance and other reduced data.
const labelList & faceMap() const
Old face map.
Generic Geometric field mapper. For "real" mapping, add template specialisations for mapping of inter...
label timeIndex() const
Return the time index of the field.
void setSize(const label)
Reset size of List.
Template functions to aid in the implementation of demand driven data.
label timeIndex() const
Return current time index.
const scalarField & oldCellVolumes() const
Boundary & boundaryFieldRef()
Return a reference to the boundary field.
Selector class for finite volume solution solution. fvMesh is derived from fvSolution so that all fie...
void clearOut()
Clear all geometry and addressing.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
bool operator==(const fvMesh &) const
Selector class for finite volume differencing schemes. fvMesh is derived from fvShemes so that all fi...
Mesh data needed to do the Finite Volume discretisation.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
void movePoints()
Correct patches after moving points.
void clear()
Clear the PtrList, i.e. set size to zero deleting all the.
SubField< scalar > subField
Declare type of subField.
The class contains the addressing required by the lduMatrix: upper, lower and losort.
Mesh consisting of general polyhedral cells.
readUpdateState
Enumeration defining the state of the mesh after a read update.
A class for managing temporary objects.
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)
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
label nOldFaces() const
Number of old faces.
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.