54 ownedByRegistry_(false),
55 eventNo_(isTimeObject ? 0 : db().getEvent()),
56 metaDataPtr_(nullptr),
71 ownedByRegistry_(false),
72 eventNo_(db().getEvent()),
73 watchFiles_(rio.watchFiles_),
74 watchIndices_(rio.watchIndices_),
75 metaDataPtr_(rio.metaDataPtr_.clone()),
86 ownedByRegistry_(false),
87 eventNo_(db().getEvent()),
88 metaDataPtr_(rio.metaDataPtr_.clone()),
106 const regIOobject& rio,
110 IOobject(newName, rio.instance(), rio.
local(), rio.db()),
112 ownedByRegistry_(false),
113 eventNo_(db().getEvent()),
114 metaDataPtr_(rio.metaDataPtr_.clone()),
130 const regIOobject& rio
135 ownedByRegistry_(false),
136 eventNo_(db().getEvent()),
137 metaDataPtr_(rio.metaDataPtr_.clone()),
153 Pout<<
"Destroy regIOobject: " <<
name()
154 <<
" type=" <<
type()
155 <<
" registered=" << registered_
156 <<
" owned=" << ownedByRegistry_
157 <<
" directory=" <<
path()
179 db().resetCacheTemporaryObject(
this);
182 ownedByRegistry_ =
false;
197 registered_ = db().checkIn(
this);
208 <<
"Failed to register: " <<
name() <<
' ' 210 <<
" : the name already exists in the registry" <<
nl 211 <<
"Contents:" << db().sortedToc() <<
endl 217 <<
"Failed to register: " <<
name() <<
' ' 219 <<
" : the name already exists in the registry" <<
endl;
234 watchIndices_.clear();
241 return db().checkOut(
this);
256 && time().runTimeModifiable()
270 index = watchFiles_.size();
271 watchFiles_.push_back(
f);
281 const bool masterOnly
301 && time().runTimeModifiable()
312 label index =
fileHandler().findWatch(watchIndices_,
f);
316 <<
"Object " << objectPath() <<
" of type " <<
type()
317 <<
" already watched with index " << watchIndices_[index]
332 filesToWatch.
resize(watchIndices_.size());
335 filesToWatch[i] =
fileHandler().getFile(watchIndices_[i]);
360 watchIndices_.clear();
361 for (
const auto& file : filesToWatch)
363 watchIndices_.push_back(
fileHandler().addWatch(file));
372 for (
const auto& file : watchFiles_)
374 watchIndices_.push_back(
fileHandler().addWatch(file));
384 watchIndices_.size()+watchFiles_.size()+1
388 for (
const label index : watchIndices_)
395 filesToWatch.push_back(std::move(watchFiles_));
398 filesToWatch.push_back(
f);
409 label da = a.
eventNo()-eventNo_;
452 return upToDate(a) && upToDate(
b);
463 return upToDate(a) && upToDate(
b) && upToDate(
c);
475 return upToDate(a) && upToDate(
b) && upToDate(
c) && upToDate(d);
481 eventNo_ = db().getEvent();
502 return localFilePath(
type());
519 <<
"failed to read header of file " << objectPath()
530 isPtr_.reset(
nullptr);
bool upToDate(const regIOobject &) const
Return true if up-to-date with respect to given object.
A class for handling file names.
void operator=(const IOobject &io)
Copy assignment, copies all values (except the registry)
void resize(const label len)
Adjust allocated size of list.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void setUpToDate()
Set as up-to-date.
constexpr char nl
The newline '\n' character (0x0a)
label eventNo() const noexcept
Event number at last update.
bool empty() const noexcept
True if List is empty (ie, size() is zero)
virtual void rename(const word &newName)
Rename the object.
regIOobject(const IOobject &io, const bool isTimeObject=false)
Construct from IOobject. The optional flag adds special handling if the object is the top-level regIO...
Ostream & endl(Ostream &os)
Add newline and flush stream.
static bool & parRun() noexcept
Test if this a parallel run.
bool headerOk()
Read and check header info. Does not check the headerClassName.
refPtr< fileOperation > fileHandler(std::nullptr_t)
Delete current file handler - forwards to fileOperation::handler()
virtual fileName filePath() const
Return complete path + object name if the file exists.
static label worldComm
Communicator for all ranks. May differ from commGlobal() if local worlds are in use.
#define forAll(list, i)
Loop across all elements in list.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
A class for handling words, derived from Foam::string.
static word defaultRegion
Return the default region name.
errorManip< error > abort(error &err)
bool checkOut()
Remove object from registry, and remove all file watches.
int debug
Static debugging option.
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
defineTypeNameAndDebug(combustionModel, 0)
static fileCheckTypes fileModificationChecking
Type of file modification checking.
virtual void addWatch()
Add file watch on object (if registered and READ_IF_MODIFIED)
virtual void rename(const word &newName)
Rename.
void push_back(const T &val)
Copy append an element to the end of this list.
static void broadcasts(const label comm, Type &arg1, Args &&... args)
Broadcast multiple items to all communicator ranks. Does nothing in non-parallel. ...
static bool masterOnlyReading
To flag master-only reading of objects.
#define WarningInFunction
Report a warning using Foam::Warning.
void operator=(const regIOobject &)=delete
No copy assignment.
const dimensionedScalar c
Speed of light in a vacuum.
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
bool registerObject() const noexcept
Should objects created with this IOobject be registered?
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
Defines the attributes of an object for which implicit objectRegistry management is supported...
bool checkIn()
Add object to registry, if not already registered.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
virtual ~regIOobject()
Destructor.