Go to the documentation of this file.
47 const bool loadFromFiles
58 if (setActive<fvMesh>())
63 if (conditions_.empty())
65 Info<<
type() <<
" " << name_ <<
" output:" <<
nl
66 <<
" No conditions present - deactivating" <<
nl
75 forAll(conditions_, conditionI)
77 if (conditions_[conditionI].active())
86 Info<<
type() <<
" " << name_ <<
" output:" <<
nl
87 <<
" All conditions inactive - deactivating" <<
nl
108 const wordList conditionNames(conditionsDict.
toc());
109 conditions_.setSize(conditionNames.
size());
111 label uniqueGroupI = 0;
112 forAll(conditionNames, conditionI)
114 const word& conditionName = conditionNames[conditionI];
123 label groupI = conditions_[conditionI].groupID();
125 if (groupMap_.insert(groupI, uniqueGroupI))
143 Info<<
type() <<
" " << name_ <<
" output:" <<
nl;
149 List<bool> groupSatisfied(groupMap_.size(),
true);
150 List<bool> groupActive(groupMap_.size(),
false);
152 forAll(conditions_, conditionI)
158 bool conditionSatisfied = condition.
apply();
164 if (conditionIter == groupMap_.end())
167 <<
"group " << groupI <<
" not found in map"
171 if (conditionSatisfied)
175 groupActive[conditionIter()] =
true;
181 groupSatisfied[conditionIter()] =
true;
187 groupSatisfied[conditionIter()] =
false;
193 forAll(groupSatisfied, groupI)
195 if (groupSatisfied[groupI] && groupActive[groupI])
206 Info<<
" " << conditions_[conditionI].type() <<
": "
207 << conditions_[conditionI].name()
208 <<
" condition satisfied" <<
nl;
213 Time& time =
const_cast<Time&
>(obr_.time());
215 if (writeStepI_ < nWriteStep_ - 1)
218 Info<<
" Writing fields - step " << writeStepI_ <<
nl;
223 Info<<
" Stopping calculation" <<
nl
224 <<
" Writing fields - final step" <<
nl;
230 Info<<
" Conditions not met - calculations proceeding" <<
nl;
253 forAll(conditions_, conditionI)
255 conditions_[conditionI].write();
Base class for run time conditions.
static autoPtr< runTimeCondition > New(const word &conditionName, const objectRegistry &obr, const dictionary &dict, functionObjectState &state)
Selector.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A class for handling words, derived from string.
Base class for function objects, adding functionality to read/write state information (data required ...
#define forAll(list, i)
Loop across all elements in list.
bool readIfPresent(const word &, T &, bool recursive=false, bool patternMatch=true) const
Find an entry if present, and assign to T.
bool read(const char *, int32_t &)
A HashTable to objects of type <T> with a label key.
virtual void timeSet()
Called when time was set at the end of the Time::operator++.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual void end()
Execute at the final time-loop, currently does nothing.
virtual void execute()
Execute, currently does nothing.
virtual void write()
Calculate the runTimeControl and write.
virtual ~runTimeControl()
Destructor.
bool writeAndEnd()
Write the objects now (not at end of iteration) and end the run.
Registry of regIOobjects.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
virtual void read(const dictionary &)
Read the runTimeControl data.
A list of keyword definitions, which are a keyword followed by any number of values (e....
errorManip< error > abort(error &err)
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
runTimeControl(const runTimeControl &)
Disallow default bitwise copy construct.
virtual bool active() const
Return the active flag.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
bool writeNow()
Write the objects now (not at end of iteration) and continue.
virtual bool apply()=0
Apply the condition.
wordList toc() const
Return the table of contents.
void size(const label)
Override size to be inconsistent with allocated storage.
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
defineTypeNameAndDebug(combustionModel, 0)
word name(const complex &)
Return a string representation of a complex.
virtual label groupID() const
Return the group index.
void set(entry *)
Assign a new entry, overwrite any existing entry.