50 void Foam::fvMesh::clearGeomNotOldVol()
83 void Foam::fvMesh::updateGeomNotOldVol()
85 bool haveV = (VPtr_ !=
nullptr);
86 bool haveSf = (SfPtr_ !=
nullptr);
87 bool haveMagSf = (magSfPtr_ !=
nullptr);
88 bool haveCP = (CPtr_ !=
nullptr);
89 bool haveCf = (CfPtr_ !=
nullptr);
117 void Foam::fvMesh::clearGeom()
124 clearGeomNotOldVol();
148 TopologicalMeshObject,
157 TopologicalMeshObject,
166 meshObject::clear<fvMesh, TopologicalMeshObject>(*this);
167 meshObject::clear<lduMesh, TopologicalMeshObject>(*this);
173 void Foam::fvMesh::storeOldVol(
const scalarField& V)
180 <<
" Storing old time volumes since from time " << curTimeIndex_
181 <<
" and time now " << time().timeIndex()
187 if (V00Ptr_ && V0Ptr_)
196 V0Ptr_->scalarField::operator=(V);
201 V0Ptr_ =
new DimensionedField<scalar, volMesh>
222 curTimeIndex_ = time().timeIndex();
227 <<
" Stored old time volumes V0:" << V0Ptr_->size()
232 <<
" Stored oldold time volumes V00:" << V00Ptr_->size()
263 boundary_(*this, boundaryMesh()),
329 const word& defaultBoundaryPatchName,
330 const word& defaultBoundaryPatchType,
342 defaultBoundaryPatchName,
343 defaultBoundaryPatchType,
347 fvSchemes(static_cast<const objectRegistry&>(*
this)),
348 fvSolution(static_cast<const objectRegistry&>(*
this)),
349 data(static_cast<const objectRegistry&>(*
this)),
389 fvSchemes(static_cast<const objectRegistry&>(*
this)),
390 fvSolution(static_cast<const objectRegistry&>(*
this)),
391 data(static_cast<const objectRegistry&>(*
this)),
422 fvSchemes(static_cast<const objectRegistry&>(*
this)),
423 fvSolution(static_cast<const objectRegistry&>(*
this)),
424 data(static_cast<const objectRegistry&>(*
this)),
457 const bool validBoundary
463 <<
" boundary already exists" 502 Info<<
"Boundary and topological update" <<
endl;
514 Info<<
"Topological update" <<
endl;
523 Info<<
"Point motion update" <<
endl;
578 <<
"mapPolyMesh does not correspond to the old mesh." 592 MapGeometricFields<scalar, fvPatchField, fvMeshMapper, volMesh>
594 MapGeometricFields<vector, fvPatchField, fvMeshMapper, volMesh>
596 MapGeometricFields<sphericalTensor, fvPatchField, fvMeshMapper, volMesh>
598 MapGeometricFields<symmTensor, fvPatchField, fvMeshMapper, volMesh>
600 MapGeometricFields<tensor, fvPatchField, fvMeshMapper, volMesh>
604 MapGeometricFields<scalar, fvsPatchField, fvMeshMapper, surfaceMesh>
606 MapGeometricFields<vector, fvsPatchField, fvMeshMapper, surfaceMesh>
608 MapGeometricFields<symmTensor, fvsPatchField, fvMeshMapper, surfaceMesh>
610 MapGeometricFields<symmTensor, fvsPatchField, fvMeshMapper, surfaceMesh>
612 MapGeometricFields<tensor, fvsPatchField, fvMeshMapper, surfaceMesh>
616 MapDimensionedFields<scalar, fvMeshMapper, volMesh>(mapper);
617 MapDimensionedFields<vector, fvMeshMapper, volMesh>(mapper);
618 MapDimensionedFields<sphericalTensor, fvMeshMapper, volMesh>(mapper);
619 MapDimensionedFields<symmTensor, fvMeshMapper, volMesh>(mapper);
620 MapDimensionedFields<tensor, fvMeshMapper, volMesh>(mapper);
640 V0[i] = savedV0[cellMap[i]];
656 label celli = -index-2;
658 V0[celli] += savedV0[oldCelli];
666 Info<<
"Mapping old time volume V0. Merged " 667 << nMerged <<
" out of " <<
nCells() <<
" cells" <<
endl;
684 V00[i] = savedV00[cellMap[i]];
700 label celli = -index-2;
702 V00[celli] += savedV00[oldCelli];
709 Info<<
"Mapping old time volume V00. Merged " 710 << nMerged <<
" out of " <<
nCells() <<
" cells" <<
endl;
781 updateGeomNotOldVol();
788 meshObject::movePoints<fvMesh>(*this);
789 meshObject::movePoints<lduMesh>(*this);
813 <<
"V:" <<
V().size()
814 <<
" not equal to the number of old cells " 818 if (V0Ptr_ && (V0Ptr_->size() != mpm.
nOldCells()))
821 <<
"V0:" << V0Ptr_->size()
822 <<
" not equal to the number of old cells " 826 if (V00Ptr_ && (V00Ptr_->size() != mpm.
nOldCells()))
829 <<
"V0:" << V00Ptr_->size()
830 <<
" not equal to the number of old cells " 837 clearGeomNotOldVol();
848 meshObject::updateMesh<fvMesh>(*
this, mpm);
849 meshObject::updateMesh<lduMesh>(*
this, mpm);
914 const label insertPatchi,
917 const word& defaultPatchFieldType,
918 const bool validBoundary
926 clearGeomNotOldVol();
942 defaultPatchFieldType,
958 AddPatchFields<volScalarField>
963 defaultPatchFieldType,
966 AddPatchFields<volVectorField>
971 defaultPatchFieldType,
974 AddPatchFields<volSphericalTensorField>
979 defaultPatchFieldType,
982 AddPatchFields<volSymmTensorField>
987 defaultPatchFieldType,
990 AddPatchFields<volTensorField>
995 defaultPatchFieldType,
1001 AddPatchFields<surfaceScalarField>
1006 defaultPatchFieldType,
1009 AddPatchFields<surfaceVectorField>
1014 defaultPatchFieldType,
1017 AddPatchFields<surfaceSphericalTensorField>
1022 defaultPatchFieldType,
1025 AddPatchFields<surfaceSymmTensorField>
1030 defaultPatchFieldType,
1033 AddPatchFields<surfaceTensorField>
1038 defaultPatchFieldType,
1047 const bool validBoundary
1052 boundary_.
shuffle(newToOld, validBoundary);
1055 ReorderPatchFields<volScalarField>(
db, newToOld);
1056 ReorderPatchFields<volVectorField>(
db, newToOld);
1057 ReorderPatchFields<volSphericalTensorField>(
db, newToOld);
1058 ReorderPatchFields<volSymmTensorField>(
db, newToOld);
1059 ReorderPatchFields<volTensorField>(
db, newToOld);
1061 ReorderPatchFields<surfaceScalarField>(
db, newToOld);
1062 ReorderPatchFields<surfaceVectorField>(
db, newToOld);
1063 ReorderPatchFields<surfaceSphericalTensorField>(
db, newToOld);
1064 ReorderPatchFields<surfaceSymmTensorField>(
db, newToOld);
1065 ReorderPatchFields<surfaceTensorField>(
db, newToOld);
1080 ok = phiPtr_->
write(write);
1086 ok = ok && V0Ptr_->write(write);
1101 Foam::fvMesh::validComponents<Foam::sphericalTensor>()
const
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
virtual void reorderPatches(const labelUList &newToOld, const bool validBoundary)
Reorder and trim existing patches. If validBoundary the new.
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.
label nOldCells() const
Number of old cells.
bool set(const label) const
Is element set.
const labelList & cellMap() const
Old cell map.
errorManipArg< error, int > exit(error &err, const int errNo=1)
void mapClouds(const objectRegistry &db, const mapPolyMesh &mapper)
Generic Geometric field mapper.
A list of keyword definitions, which are a keyword followed by any number of values (e...
fvSchemes(const objectRegistry &obr)
Construct for objectRegistry.
void addFvPatches(const List< polyPatch *> &, const bool validBoundary=true)
Add boundary patches. Constructor helper.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label nInternalFaces() const
virtual void addPatch(const label insertPatchi, const polyPatch &patch, const dictionary &patchFieldDict, const word &defaultPatchFieldType, const bool validBoundary)
Add/insert single patch. If validBoundary the new situation.
T & ref() const
Return non-const reference or generate a fatal error.
bool isFile(const fileName &, const bool checkVariants=true, const bool followLink=true)
Does the name exist as a file in the file system?
void clearOut()
Clear all geometry and addressing unnecessary for CFD.
virtual void reorderPatches(const labelUList &newToOld, const bool validBoundary)
Reorder and trim existing patches. If validBoundary the new.
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.
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 necessary if the mesh has moved.
const DimensionedField< scalar, volMesh > & V00() const
Return old-old-time cell volumes.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
const cellList & cells() const
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.
virtual bool write(const bool write=true) const
Write mesh using IO settings from time.
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 bool writeObject(IOstream::streamFormat fmt, IOstream::versionNumber ver, IOstream::compressionType cmp, const bool write=true) const
Write the underlying polyMesh and other data.
virtual const objectRegistry & thisDb() const
Return the object registry - resolve conflict polyMesh/lduMesh.
virtual const pointField & points() const
Return raw points.
virtual ~fvMesh()
Destructor.
void readUpdate(const polyBoundaryMesh &)
Update boundary based on new polyBoundaryMesh.
bool operator!=(const fvMesh &) const
const dimensionSet dimTime
fvSolution(const objectRegistry &obr)
Construct for objectRegistry.
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 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)
virtual void addPatch(const label insertPatchi, const polyPatch &patch, const dictionary &patchFieldDict, const word &defaultPatchFieldType, const bool validBoundary)
Add/insert single patch. If validBoundary the new situation.
scalar deltaTValue() const
Return time step value.
streamFormat
Enumeration for the format of data in the stream.
void shuffle(const labelUList &newToOld, const bool validBoundary)
Reorders patches. Ordering does not have to be done in.
const fileOperation & fileHandler()
Get current file handler.
virtual const faceList & faces() const
Return raw faces.
errorManip< error > abort(error &err)
void addPatches(const List< polyPatch *> &, const bool validBoundary=true)
Add boundary patches.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
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.
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 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.
fvMesh(const IOobject &io)
Construct from IOobject.
label size() const
Return the number of elements in the UPtrList.
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
prefixOSstream Pout(cout, "Pout")
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.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const dimensionSet dimVolume
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.
static autoPtr< fvPatch > New(const polyPatch &, const fvBoundaryMesh &)
Return a pointer to a new patch created on freestore from polyPatch.
readUpdateState
Enumeration defining the state of the mesh after a read update.
virtual bool write(const bool write=true) const
Write using setting from DB.
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.
A patch is a list of labels that address the faces in the global face list.
const objectRegistry & db() const
Return the local objectRegistry.
void deleteDemandDrivenData(DataPtr &dataPtr)
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
virtual bool writeObject(IOstream::streamFormat fmt, IOstream::versionNumber ver, IOstream::compressionType cmp, const bool write) const
Write the objects.
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.
polyMesh(const IOobject &io)
Construct from IOobject.