38 if (tetBasePtIsPtr_.valid())
40 tetBasePtIsPtr_->writeOpt() = wo;
49 faces_.writeOpt() = wo;
50 owner_.writeOpt() = wo;
51 neighbour_.writeOpt() = wo;
52 boundary_.writeOpt() = wo;
54 if (pointZones_.noTopoUpdate())
56 pointZones_.writeOpt() = wo;
59 if (faceZones_.noTopoUpdate())
61 faceZones_.writeOpt() = wo;
64 if (cellZones_.noTopoUpdate())
66 cellZones_.writeOpt() = wo;
77 return readScalar(instance().c_str(), time0) && time0 <
time().value();
89 points_.instance() = inst;
90 points_.eventNo() = getEvent();
92 if (tetBasePtIsPtr_.valid())
94 tetBasePtIsPtr_->instance() = inst;
95 tetBasePtIsPtr_().eventNo() = getEvent();
106 setPointsInstance(inst);
108 faces_.instance() = inst;
109 owner_.instance() = inst;
110 neighbour_.instance() = inst;
111 boundary_.instance() = inst;
113 if (pointZones_.noTopoUpdate())
115 pointZones_.instance() = inst;
118 if (faceZones_.noTopoUpdate())
120 faceZones_.instance() = inst;
123 if (cellZones_.noTopoUpdate())
125 cellZones_.instance() = inst;
136 const fileName instance0 = instance();
137 const bool forward = readUpdateIsForward();
140 instance() =
time().name();
169 <<
" Faces instance: old = " << facesInstance()
170 <<
", new = " << facesInst <<
nl
171 <<
" Points instance: old = " << pointsInstance()
172 <<
", new = " << pointsInst <<
endl;
174 if (facesInst != (forward ? instance0 : facesInstance()))
182 meshObjects::clearAll<polyMesh, DeletableMeshObject>(*
this);
198 points_.instance() = pointsInst;
214 faces_.instance() = facesInst;
230 owner_.instance() = facesInst;
246 neighbour_.instance() = facesInst;
265 bool boundaryChanged =
false;
267 if (newBoundary.
size() != boundary_.size())
269 boundaryChanged =
true;
276 wordList oldTypes = boundary_.types();
277 wordList oldNames = boundary_.names();
287 boundaryChanged =
true;
296 boundary_.setSize(newBoundary.
size());
318 newBoundary[
patchi].size(),
319 newBoundary[
patchi].start()
324 boundary_.instance() = facesInst;
330 if (!owner_.headerClassName().empty())
360 boundary_.topoChange();
363 boundary_.calcGeometry();
371 tetBasePtIsPtr_ = readTetBasePtIs();
382 else if (pointsInst != (forward ? instance0 : pointsInstance()))
389 label nOldPoints = points_.size();
407 if (nOldPoints != 0 && nOldPoints != newPoints.
size())
410 <<
"Point motion detected but number of points "
411 << newPoints.
size() <<
" in "
412 << newPoints.
objectPath() <<
" does not correspond to "
413 <<
" current " << nOldPoints
417 points_.transfer(newPoints);
419 points_.instance() = pointsInst;
423 if (newTetBasePtIsPtr.
valid())
425 tetBasePtIsPtr_ = newTetBasePtIsPtr;
429 boundary_.calcGeometry();
454 if (pointZonesInst != pointZones_.instance())
471 pointZones_.swap(newPointZones);
472 pointZones_.instance() = pointZonesInst;
489 if (faceZonesInst != faceZones_.instance())
506 faceZones_.swap(newFaceZones);
507 faceZones_.instance() = faceZonesInst;
524 if (cellZonesInst != cellZones_.instance())
541 cellZones_.swap(newCellZones);
542 cellZones_.instance() = cellZonesInst;
563 if (faces_.writeOpt() == AUTO_WRITE)
565 auto rmAddressing = [&](
const word&
name)
580 rmAddressing(
"cellProc");
584 rmAddressing(
"pointProcAddressing");
585 rmAddressing(
"faceProcAddressing");
586 rmAddressing(
"cellProcAddressing");
593 unsigned int precision0 =
618 unsigned int precision0 =
621 ok = ok && points_.write();
628 ok = ok && faces_.write();
633 ok = ok && owner_.write();
638 ok = ok && neighbour_.write();
643 ok = ok && pointZones_.write();
648 ok = ok && faceZones_.write();
653 ok = ok && cellZones_.write();
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
#define forAll(list, i)
Loop across all elements in list.
A List of objects of type <Type> with automated input and output using a compact storage....
A primitive field of type <Type> with automated input and output.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
writeOption & writeOpt() const
fileName filePath(const bool global) const
Return complete path + object name if the file exists.
writeOption
Enumeration defining the write options.
static unsigned int fullPrecision()
Return a full precision for writing data that is *very*.
streamFormat
Enumeration for the format of data in the stream.
static unsigned int defaultPrecision()
Return the default precision.
compressionType
Enumeration for the format of data in the stream.
void size(const label)
Override size to be inconsistent with allocated storage.
static bool & parRun()
Is this a parallel run?
label size() const
Return the number of elements in the UPtrList.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
bool valid() const
Return true if the autoPtr valid (ie, the pointer is set)
A bounding box defined in terms of the points at its extremities.
A class for handling file names.
virtual bool rm(const fileName &) const =0
Remove a file, returning true if successful otherwise false.
virtual bool writeObject(IOstream::streamFormat fmt, IOstream::versionNumber ver, IOstream::compressionType cmp, const bool write) const
Write the objects.
wordList types() const
Return a list of patch types.
wordList names() const
Return the list of patch names.
Mesh consisting of general polyhedral cells.
bool readUpdateIsForward() const
Does a read update move the mesh forward in time?
readUpdateState
Enumeration defining the state of the mesh after a read update.
virtual bool writeObject(IOstream::streamFormat fmt, IOstream::versionNumber ver, IOstream::compressionType cmp, const bool write=true) const
Write the mesh data and all objects in the registry.
readUpdateState readUpdate()
Update the mesh based on the mesh files saved in.
void setPointsInstance(const fileName &)
Set the instance for the points files.
void setInstance(const fileName &)
Set the instance for mesh files.
virtual bool writeMesh() const
Write the mesh data only.
fileName objectPath() const
Return complete path + object name.
A class for handling words, derived from string.
static const word null
An empty word.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define DebugInfo
Report an information message using Foam::Info.
#define DebugInFunction
Report an information message using Foam::Info.
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
const fileOperation & fileHandler()
Get current file handler.
errorManipArg< error, int > exit(error &err, const int errNo=1)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
CompactIOList< face > faceCompactIOList
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if successful.
vectorIOField pointIOField
pointIOField is a vectorIOField.
IOList< label > labelIOList
Label container classes.
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.