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
88 <<
"Creating fvConstraints from "
89 << io.instance()/io.name()
90 <<
" rather than system/fvConstraints"
109 void Foam::fvConstraints::checkApplied()
const
111 if (mesh().time().
timeIndex() > checkTimeIndex_)
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;
131 checkTimeIndex_ = mesh().time().timeIndex();
145 createIOobject(mesh),
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);
306 checkTimeIndex_ = mesh().time().timeIndex() + 1;
315 bool ok = constraint.
read(subDict(constraint.
name()));
316 allOk = (allOk && ok);
335 constraints.writeData(os);
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
Templated abstract base-class for demand-driven mesh objects used to automate their allocation to the...
const fvMesh & mesh() const
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
const word & name() const
Return name.
bool bad() const
Return true if stream is corrupted.
bool good() const
Return true if next operation might succeed.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Template dictionary class which manages the storage associated with it.
autoPtr< T > set(const label, const word &key, T *)
Set element to pointer provided and return old element.
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
static const word & constant()
Return constant name.
static const word & system()
Return system name.
const fileName & name() const
Return the dictionary name.
A list of keyword definitions, which are a keyword followed by any number of values (e....
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
void write(Ostream &, const bool subDict=true) const
Write dictionary, normally with sub-dictionary formatting.
bool isDict(const word &) const
Check if entry is a sub-dictionary.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
Finite volume options abstract base class.
virtual bool read(const dictionary &dict)
Read source dictionary.
const word & name() const
Return const access to the source name.
static autoPtr< fvConstraint > New(const word &name, const fvMesh &mesh, const dictionary &dict)
Return a reference to the selected fvConstraint.
Finite volume constraints.
virtual bool movePoints()
Update for mesh motion.
virtual bool writeData(Ostream &os) const
Write data to Ostream.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
fvConstraints(const fvMesh &mesh)
Construct from components with list of field names.
virtual bool constrainsField(const word &fieldName) const
Return true if an fvConstraint constrains the given field.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
virtual bool readData(Istream &)
ReadData function which reads the fvConstraints dictionary.
virtual bool read()
Read the fvConstraints dictionary if it has changed.
Mesh data needed to do the Finite Volume discretisation.
const Time & time() const
Return the top-level database.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
bool readHeaderOk(const IOstream::streamFormat defaultFormat, const word &typeName)
Read header, check readOpt flags and read data if necessary.
void addWatch()
Add file watch on object (if registered and READ_IF_MODIFIED)
virtual void rename(const word &newName)
Rename.
virtual bool read()
Read object.
A class for handling words, derived from string.
#define WarningInFunction
Report a warning using Foam::Warning.
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.
defineTypeNameAndDebug(combustionModel, 0)
HashSet wordHashSet
A HashSet with word keys.
label count(const ListType &l, typename ListType::const_reference x)
Count the number of occurrences of a value in a list.