45 typeIOobject<IOdictionary> io
56 Info<<
"Creating fvModels from "
57 << io.instance()/io.name() <<
nl
67 io.rename(
"fvOptions");
72 <<
"Creating fvModels from "
73 << io.instance()/io.name() <<
nl
88 <<
"Creating fvModels from "
89 << io.instance()/io.name()
90 <<
" rather than constant/fvModels"
109 void Foam::fvModels::checkApplied()
const
112 mesh().time().subCycling()
113 ? mesh().time().prevTimeState().timeIndex()
114 : mesh().time().timeIndex();
118 const PtrListDictionary<fvModel>& modelList(*
this);
122 const fvModel& model = modelList[i];
125 notAddSupFields -= addSupFields_[i];
130 <<
"Model " << model.name()
131 <<
" defined for field " << iter.key()
132 <<
" but never used" <<
endl;
150 createIOobject(mesh),
154 checkTimeIndex_(mesh.time().
timeIndex() + 1),
175 addSupFields_.setSize(
count);
182 const word&
name = iter().keyword();
185 const word modelType(modelDict.
lookup(
"type"));
190 || !fvConstraint::dictionaryConstructorTablePtr_->
found
211 addSupFields_.setSize(i);
213 if (readFromFvModels)
235 if (modelList[i].addsSupToField(fieldName))
266 modelList[i].preUpdateMesh();
279 allOk = allOk && modelList[i].movePoints();
292 modelList[i].topoChange(map);
303 modelList[i].mapMesh(map);
314 modelList[i].distribute(map);
323 checkTimeIndex_ = mesh().time().timeIndex() + 1;
332 bool ok = model.
read(subDict(model.
name()));
333 allOk = (allOk && ok);
372 const bool ok = modelList[i].write(
write);
373 allOk = (allOk && ok);
386 modelList[i].correct();
399 models.dictionary::write(os,
false);
#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.
streamFormat
Enumeration for the format of data in the stream.
bool bad() const
Return true if stream is corrupted.
compressionType
Enumeration for the format of data in the stream.
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.
Mesh data needed to do the Finite Volume discretisation.
const Time & time() const
Return the top-level database.
Finite volume model abstract base class.
static autoPtr< fvModel > New(const word &name, const fvMesh &mesh, const dictionary &dict)
Return a reference to the selected fvModel.
virtual bool read(const dictionary &dict)
Read source dictionary.
const word & name() const
Return const access to the source name.
virtual bool movePoints()
Update for mesh motion.
virtual bool writeObject(IOstream::streamFormat fmt, IOstream::versionNumber ver, IOstream::compressionType cmp, const bool write) const
Write the fvModels.
virtual void correct()
Correct the fvModels.
virtual bool writeData(Ostream &os) const
writeData function required by regIOobject but not used
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 scalar maxDeltaT() const
Return the maximum time-step for stable operation.
virtual void preUpdateMesh()
Prepare for mesh update.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
virtual bool readData(Istream &)
ReadData function which reads the fvModels dictionary.
virtual bool addsSupToField(const word &fieldName) const
Return true if an fvModel adds a source term to the given.
fvModels(const fvMesh &mesh)
Construct from components with list of field names.
virtual bool read()
Read the fvModels dictionary if it has changed.
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.
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
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.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
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.