45 typeIOobject<IOdictionary> io
56 Info<<
"Creating fvConstraints from " 57 << io.instance()/io.name() <<
nl 67 io.rename(
"fvOptions");
72 <<
"Creating fvConstraints from " 73 << io.instance()/io.name() <<
nl 83 io.instance() = mesh.time().constant();
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))
248 allOk = allOk && constraintList[i].movePoints();
261 constraintList[i].topoChange(map);
272 constraintList[i].mapMesh(map);
283 constraintList[i].distribute(map);
315 bool ok = constraint.
read(subDict(constraint.
name()));
316 allOk = (allOk && ok);
335 constraints.writeData(os);
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.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
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...
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
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.
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.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
HashSet wordHashSet
A HashSet with word keys.
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.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
#define WarningInFunction
Report a warning using Foam::Warning.
Finite volume constraints.
Mesh data needed to do the Finite Volume discretisation.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
virtual bool read(const dictionary &dict)
Read source dictionary.
Class containing mesh-to-mesh mapping information.
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.