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();
128 Info<<
"fvMesh::clearAddressing(const bool) :" 129 <<
" isMeshUpdate:" << isMeshUpdate <<
endl;
139 TopologicalMeshObject,
148 TopologicalMeshObject,
157 meshObject::clear<fvMesh, TopologicalMeshObject>(*this);
158 meshObject::clear<lduMesh, TopologicalMeshObject>(*this);
164 void Foam::fvMesh::storeOldVol(
const scalarField& V)
170 Info<<
"fvMesh::storeOldVol(const scalarField&) :" 171 <<
" Storing old time volumes since from time " << curTimeIndex_
172 <<
" and time now " << time().timeIndex()
178 if (V00Ptr_ && V0Ptr_)
187 V0Ptr_->scalarField::operator=(V);
192 V0Ptr_ =
new DimensionedField<scalar, volMesh>
213 curTimeIndex_ = time().timeIndex();
217 Info<<
"fvMesh::storeOldVol() :" 218 <<
" Stored old time volumes V0:" << V0Ptr_->size()
222 Info<<
"fvMesh::storeOldVol() :" 223 <<
" Stored oldold time volumes V00:" << V00Ptr_->size()
268 Info<<
"Constructing fvMesh from IOobject" 344 const word& defaultBoundaryPatchName,
345 const word& defaultBoundaryPatchType,
357 defaultBoundaryPatchName,
358 defaultBoundaryPatchType,
362 fvSchemes(static_cast<const objectRegistry&>(*
this)),
363 fvSolution(static_cast<const objectRegistry&>(*
this)),
364 data(static_cast<const objectRegistry&>(*
this)),
379 Info<<
"Constructing fvMesh from cellShapes" <<
endl;
394 polyMesh(io, points, faces, allOwner, allNeighbour, syncPar),
396 fvSchemes(static_cast<const objectRegistry&>(*
this)),
397 fvSolution(static_cast<const objectRegistry&>(*
this)),
398 data(static_cast<const objectRegistry&>(*
this)),
413 Info<<
"Constructing fvMesh from components" <<
endl;
427 polyMesh(io, points, faces, cells, syncPar),
429 fvSchemes(static_cast<const objectRegistry&>(*
this)),
430 fvSolution(static_cast<const objectRegistry&>(*
this)),
431 data(static_cast<const objectRegistry&>(*
this)),
446 Info<<
"Constructing fvMesh from components" <<
endl;
464 const bool validBoundary
471 "fvMesh::addFvPatches(const List<polyPatch*>&, const bool)" 472 ) <<
" boundary already exists" 486 Info<<
"void fvMesh::removeFvBoundary(): " 487 <<
"Removing boundary patches." 504 Info<<
"polyMesh::readUpdateState fvMesh::readUpdate() : " 505 <<
"Updating fvMesh. ";
514 Info<<
"Boundary and topological update" <<
endl;
526 Info<<
"Topological update" <<
endl;
535 Info<<
"Point motion update" <<
endl;
573 Info<<
"fvMesh::mapFields :" 590 <<
"mapPolyMesh does not correspond to the old mesh." 604 MapGeometricFields<scalar, fvPatchField, fvMeshMapper, volMesh>
606 MapGeometricFields<vector, fvPatchField, fvMeshMapper, volMesh>
608 MapGeometricFields<sphericalTensor, fvPatchField, fvMeshMapper, volMesh>
610 MapGeometricFields<symmTensor, fvPatchField, fvMeshMapper, volMesh>
612 MapGeometricFields<tensor, fvPatchField, fvMeshMapper, volMesh>
616 MapGeometricFields<scalar, fvsPatchField, fvMeshMapper, surfaceMesh>
618 MapGeometricFields<vector, fvsPatchField, fvMeshMapper, surfaceMesh>
620 MapGeometricFields<symmTensor, fvsPatchField, fvMeshMapper, surfaceMesh>
622 MapGeometricFields<symmTensor, fvsPatchField, fvMeshMapper, surfaceMesh>
624 MapGeometricFields<tensor, fvsPatchField, fvMeshMapper, surfaceMesh>
628 MapDimensionedFields<scalar, fvMeshMapper, volMesh>(mapper);
629 MapDimensionedFields<vector, fvMeshMapper, volMesh>(mapper);
630 MapDimensionedFields<sphericalTensor, fvMeshMapper, volMesh>(mapper);
631 MapDimensionedFields<symmTensor, fvMeshMapper, volMesh>(mapper);
632 MapDimensionedFields<tensor, fvMeshMapper, volMesh>(mapper);
652 V0[i] = savedV0[cellMap[i]];
668 label cellI = -index-2;
670 V0[cellI] += savedV0[oldCellI];
678 Info<<
"Mapping old time volume V0. Merged " 679 << nMerged <<
" out of " <<
nCells() <<
" cells" <<
endl;
696 V00[i] = savedV00[cellMap[i]];
712 label cellI = -index-2;
714 V00[cellI] += savedV00[oldCellI];
721 Info<<
"Mapping old time volume V00. Merged " 722 << nMerged <<
" out of " <<
nCells() <<
" cells" <<
endl;
780 phi.
boundaryField()[patchI] = patches[patchI].patchSlice(sweptVols);
790 updateGeomNotOldVol();
797 meshObject::movePoints<fvMesh>(*this);
798 meshObject::movePoints<lduMesh>(*this);
819 <<
"V:" <<
V().size()
820 <<
" not equal to the number of old cells " 824 if (V0Ptr_ && (V0Ptr_->size() != mpm.
nOldCells()))
827 <<
"V0:" << V0Ptr_->size()
828 <<
" not equal to the number of old cells " 832 if (V00Ptr_ && (V00Ptr_->size() != mpm.
nOldCells()))
835 <<
"V0:" << V00Ptr_->size()
836 <<
" not equal to the number of old cells " 847 clearGeomNotOldVol();
858 meshObject::updateMesh<fvMesh>(*
this, mpm);
859 meshObject::updateMesh<lduMesh>(*
this, mpm);
880 ok = phiPtr_->
write();
virtual bool write() const
Write mesh using IO settings from time.
virtual void updateMesh(const mapPolyMesh &mpm)
Update the mesh corresponding to given map.
void addFvPatches(const List< polyPatch * > &, const bool validBoundary=true)
Add boundary patches. Constructor helper.
virtual tmp< scalarField > movePoints(const pointField &)
Move points, returns volumes swept by faces in motion.
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
Mesh data needed to do the Finite Volume discretisation.
virtual bool writeObject(IOstream::streamFormat fmt, IOstream::versionNumber ver, IOstream::compressionType cmp) const
Write the objects.
void removeBoundary()
Remove boundary patches.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual bool writeObjects(IOstream::streamFormat fmt, IOstream::versionNumber ver, IOstream::compressionType cmp) const
Write the underlying polyMesh and other data.
virtual readUpdateState readUpdate()
Update the mesh based on the mesh files saved in.
void clearAddressing()
Clear topological data.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
GeometricBoundaryField & boundaryField()
Return reference to GeometricBoundaryField.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
void clear()
Clear the PtrList, i.e. set size to zero deleting all the.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
const DimensionedField< scalar, volMesh > & V() const
Return cell volumes.
const surfaceScalarField & phi() const
Return cell face motion fluxes.
A simple container for copying or transferring objects of type <T>.
void deleteDemandDrivenData(DataPtr &dataPtr)
A class for handling words, derived from string.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface...
void size(const label)
Override size to be inconsistent with allocated storage.
errorManipArg< error, int > exit(error &err, const int errNo=1)
const DimensionedField< scalar, volMesh > & V00() const
Return old-old-time cell volumes.
InternalField & internalField()
Return internal field.
Database for solution data, solver performance and other reduced data.
void removeFvBoundary()
Remove boundary patches. Warning: fvPatchFields hold ref to.
Selector class for finite volume differencing schemes. fvMesh is derived from fvShemes so that all fi...
void addPatches(const List< polyPatch * > &, const bool validBoundary=true)
Add boundary patches.
static void clearUpto(objectRegistry &)
Clear all meshObject derived from FromType up to (but not including)
virtual void updateMesh(const mapPolyMesh &mpm)
Update mesh corresponding to the given map.
label nOldFaces() const
Number of old faces.
const scalarField & oldCellVolumes() const
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const Time & time() const
Return the top-level database.
virtual bool write() const
Write using setting from DB.
void setSize(const label)
Reset size of List.
Ostream & endl(Ostream &os)
Add newline and flush stream.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
scalar deltaTValue() const
Return time step value.
void movePoints()
Correct patches after moving points.
label timeIndex() const
Return current time index.
streamFormat
Enumeration for the format of data in the stream.
bool operator!=(const fvMesh &) const
Selector class for finite volume solution solution. fvMesh is derived from fvSolution so that all fie...
readUpdateState
Enumeration defining the state of the mesh after a read update.
virtual void mapFields(const mapPolyMesh &mpm)
Map all fields in time using given map.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
const labelList & faceMap() const
Old face map.
Template functions to aid in the implementation of demand driven data.
label size() const
Return number of elements in table.
errorManip< error > abort(error &err)
virtual readUpdateState readUpdate()
Update the mesh based on the mesh files saved in time.
void clearOut()
Clear all geometry and addressing unnecessary for CFD.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
compressionType
Enumeration for the format of data in the stream.
label nInternalFaces() const
virtual const lduAddressing & lduAddr() const
Return ldu addressing.
void clearOut()
Clear all geometry and addressing.
Mesh consisting of general polyhedral cells.
const GeometricField< Type, PatchField, GeoMesh > & oldTime() const
Return old time field.
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.
SubField< scalar > subField
Declare type of subField.
const dimensionSet dimVolume(pow3(dimLength))
Registry of regIOobjects.
void clearOut()
Clear all geometry and addressing.
DimensionedField< Type, GeoMesh > DimensionedInternalField
Class holds all the necessary information for mapping fields associated with fvMesh.
label timeIndex() const
Return the time index of the field.
const labelList & reverseCellMap() const
Reverse cell map.
surfaceInterpolation(const fvMesh &)
Construct given an fvMesh.
The class contains the addressing required by the lduMatrix: upper, lower and losort.
Cell to surface interpolation scheme. Included in fvMesh.
bool isFile(const fileName &, const bool checkGzip=true)
Does the name exist as a FILE in the file system?
virtual ~fvMesh()
Destructor.
bool operator==(const fvMesh &) const
bool moving() const
Is mesh moving.
A class for managing temporary objects.
void readUpdate(const polyBoundaryMesh &)
Update boundary based on new polyBoundaryMesh.
bool movePoints()
Do what is neccessary if the mesh has moved.
defineTypeNameAndDebug(combustionModel, 0)
label nOldCells() const
Number of old cells.
Generic Geometric field mapper. For "real" mapping, add template specialisations for mapping of inter...
void mapClouds(const objectRegistry &db, const mapPolyMesh &mapper)
Generic Geometric field mapper.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
Foam::fvMeshLduAddressing.
const labelList & cellMap() const
Old cell map.
static int debug
Debug switch.