50 void Foam::fvMesh::clearGeomNotOldVol()
78 void Foam::fvMesh::updateGeomNotOldVol()
80 bool haveV = (VPtr_ != NULL);
81 bool haveSf = (SfPtr_ != NULL);
82 bool haveMagSf = (magSfPtr_ != NULL);
83 bool haveCP = (CPtr_ != NULL);
84 bool haveCf = (CfPtr_ != NULL);
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);
875 ok = phiPtr_->
write();
884 Foam::fvMesh::validComponents<Foam::sphericalTensor>()
const
label timeIndex() const
Return current time index.
A simple container for copying or transferring objects of type <T>.
void clearOut()
Clear all geometry and addressing.
virtual bool writeObjects(IOstream::streamFormat fmt, IOstream::versionNumber ver, IOstream::compressionType cmp) const
Write the underlying polyMesh and other data.
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.
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.
errorManipArg< error, int > exit(error &err, const int errNo=1)
void mapClouds(const objectRegistry &db, const mapPolyMesh &mapper)
Generic Geometric field mapper.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static int debug
Debug switch.
const surfaceScalarField & phi() const
Return cell face motion fluxes.
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.
bool operator!=(const fvMesh &) const
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface...
bool isFile(const fileName &, const bool checkGzip=true)
Does the name exist as a FILE in the file system?
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.
bool operator==(const fvMesh &) const
label size() const
Return number of elements in table.
Cell to surface interpolation scheme. Included in fvMesh.
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.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
void addFvPatches(const List< polyPatch * > &, const bool validBoundary=true)
Add boundary patches. Constructor helper.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
bool moving() const
Is mesh moving.
virtual ~fvMesh()
Destructor.
void readUpdate(const polyBoundaryMesh &)
Update boundary based on new polyBoundaryMesh.
const dimensionSet dimVolume(pow3(dimLength))
const GeometricField< Type, PatchField, GeoMesh > & oldTime() const
Return old time field.
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.
virtual bool writeObject(IOstream::streamFormat fmt, IOstream::versionNumber ver, IOstream::compressionType cmp) const
Write the objects.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
static void clearUpto(objectRegistry &)
Clear all meshObject derived from FromType up to (but not including)
label timeIndex() const
Return the time index of the field.
streamFormat
Enumeration for the format of data in the stream.
errorManip< error > abort(error &err)
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.
defineTypeNameAndDebug(combustionModel, 0)
Database for solution data, solver performance and other reduced data.
label nOldFaces() const
Number of old faces.
scalar deltaTValue() const
Return time step value.
Generic Geometric field mapper. For "real" mapping, add template specialisations for mapping of inter...
label nOldCells() const
Number of old cells.
void addPatches(const List< polyPatch * > &, const bool validBoundary=true)
Add boundary patches.
void setSize(const label)
Reset size of List.
Template functions to aid in the implementation of demand driven data.
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.
const labelList & cellMap() const
Old cell map.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
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 scalarField & oldCellVolumes() const
const DimensionedField< scalar, volMesh > & V() const
Return cell volumes.
const labelList & reverseCellMap() const
Reverse cell map.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
virtual bool write() const
Write using setting from DB.
virtual const lduAddressing & lduAddr() const
Return ldu addressing.
void movePoints()
Correct patches after moving points.
void clear()
Clear the PtrList, i.e. set size to zero deleting all the.
const labelList & faceMap() const
Old face map.
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.
T & ref() const
Return non-const reference or generate a fatal error.
void deleteDemandDrivenData(DataPtr &dataPtr)
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
label nInternalFaces() const
virtual bool write() const
Write mesh using IO settings from time.
const Time & time() const
Return the top-level database.
virtual void mapFields(const mapPolyMesh &mpm)
Map all fields in time using given map.
#define InfoInFunction
Report an information message using Foam::Info.