54 if (io.typeHeaderOk<IOdictionary>(
true))
56 Info<<
"Creating fvConstraints from " 57 << io.instance()/io.name() <<
nl 67 io.rename(
"fvOptions");
69 if (io.typeHeaderOk<IOdictionary>(
true))
72 <<
"Creating fvConstraints from " 73 << io.instance()/io.name() <<
nl 83 io.instance() = mesh.time().constant();
85 if (io.typeHeaderOk<IOdictionary>(
true))
88 <<
"Creating fvConstraints from " 89 << io.instance()/io.name()
90 <<
" rather than system/fvConstraints" 109 void Foam::fvConstraints::checkApplied()
const 113 const PtrListDictionary<fvConstraint>& constraintList(*
this);
117 const fvConstraint& constraint = constraintList[i];
119 wordHashSet notConstrainedFields(constraint.constrainedFields());
120 notConstrainedFields -= constrainedFields_[i];
125 <<
"Constraint " << constraint.name()
126 <<
" defined for field " << iter.key()
127 <<
" but never used" <<
endl;
149 checkTimeIndex_(mesh.time().timeIndex() + 1),
170 constrainedFields_.setSize(count);
177 const word&
name = iter().keyword();
178 const dictionary& constraintDict = iter().dict();
180 const word constraintType(constraintDict.
lookup(
"type"));
184 readFromFvConstraints
185 || !fvModel::dictionaryConstructorTablePtr_->
found 206 constrainedFields_.setSize(i);
208 if (readFromFvConstraints)
230 if (constraintList[i].constrainsField(fieldName))
246 constraintList[i].updateMesh(mpm);
259 allOk = allOk && constraintList[i].movePoints();
293 bool ok = constraint.
read(subDict(constraint.
name()));
294 allOk = (allOk && ok);
313 constraints.writeData(os);
virtual void updateMesh(const mapPolyMesh &)
Update for mesh changes.
void write(Ostream &, const bool subDict=true) const
Write dictionary, normally with sub-dictionary formatting.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const word & name() const
Return name.
bool bad() const
Return true if stream is corrupted.
A list of keyword definitions, which are a keyword followed by any number of values (e...
autoPtr< T > set(const label, const word &key, T *)
Set element to pointer provided and return old element.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
static autoPtr< fvConstraint > New(const word &name, const dictionary &dict, const fvMesh &mesh)
Return a reference to the selected fvConstraint.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual bool constrainsField(const word &fieldName) const
Return true if an fvConstraint constrains the given field.
label count(const ListType &l, typename ListType::const_reference x)
Count the number of occurrences of a value in a list.
virtual bool movePoints()
Update for mesh motion.
const Time & time() const
Return the top-level database.
bool good() const
Return true if next operation might succeed.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Templated abstract base-class for optional mesh objects used to automate their allocation to the mesh...
const word & name() const
Return const access to the source name.
virtual bool read()
Read the fvConstraints dictionary if it has changed.
virtual bool writeData(Ostream &os) const
Write data to Ostream.
Foam::fvConstraints & fvConstraints
A class for handling words, derived from string.
HashSet wordHashSet
A HashSet with word keys.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
fvConstraints(const fvMesh &mesh)
Construct from components with list of field names.
defineTypeNameAndDebug(combustionModel, 0)
word name(const complex &)
Return a string representation of a complex.
label timeIndex() const
Return current time index.
#define WarningInFunction
Report a warning using Foam::Warning.
Finite volume constraints.
Mesh data needed to do the Finite Volume discretisation.
virtual bool read(const dictionary &dict)
Read source dictionary.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Finite volume options abstract base class.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
virtual bool readData(Istream &)
ReadData function which reads the fvConstraints dictionary.