44 const wordList& patchGroups = boundaryInfo_.groups()[patchI];
58 else if (
select.match(patchName))
66 for (
const word& groupName : patchGroups)
78 <<
"Boundary patch " << patchName <<
" not defined" 85 void Foam::caseInfo::updateGeometricBoundaryField()
87 forAll(boundaryInfo_.names(), i)
89 const word& patchName = boundaryInfo_.names()[i];
91 if (!boundaryInfo_.constraint()[i])
94 const label conditionI = findPatchConditionID(i, patchName);
96 const word& category = patchCategories_[conditionI];
98 boundaryInfo_.setType(i, category);
102 boundaryInfo_.write();
123 bcDict_(properties_.subDict(
"boundaryConditions")),
124 conditionNames_(bcDict_.
toc()),
125 patchNames_(conditionNames_.size()),
126 patchCategories_(conditionNames_.size()),
127 patchTypes_(conditionNames_.size())
130 Info<<
" Reading case properties" <<
endl;
132 forAll(conditionNames_, i)
140 updateGeometricBoundaryField();
148 const word& regionPrefix,
153 forAll(conditionNames_, i)
174 return conditionNames_[patchI];
180 return patchCategories_[patchI];
186 return patchTypes_[patchI];
192 const word& regionPrefix,
193 const word& fieldName,
199 forAll(boundaryInfo_.names(), j)
201 const word& patchName = boundaryInfo_.names()[j];
203 if (boundaryInfo_.constraint()[j])
206 patchDict.
add(
"type", boundaryInfo_.types()[j]);
209 patchDict.
add(
"value",
"${:internalField}");
210 boundaryField.
add(patchName.c_str(), patchDict);
215 const label conditionI = findPatchConditionID(j, patchName);
217 if (conditionI == -1)
220 <<
"Unable to find patch " << patchName
221 <<
" in list of boundary conditions" 225 const word& condition = conditionNames_[conditionI];
227 const word& category = patchCategories_[conditionI];
229 const word& patchType = patchTypes_[conditionI];
251 boundaryField.
add(patchName.c_str(), patchDict);
255 return boundaryField;
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
const List< wordRes > & patchNames() const
Return the list of patch names.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
List< bool > select(const label n, const labelUList &locations)
Construct a selection list of bools (all false) with the given pre-size, subsequently add specified l...
dictionary generateBoundaryField(const word ®ionPrefix, const word &fieldName, const boundaryTemplates &bcTemplates) const
Generate boundary field (dictionary)
Ostream & endl(Ostream &os)
Add newline and flush stream.
entry * add(entry *entryPtr, bool mergeEntry=false)
Add a new entry.
Class to store boundary template specifications.
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
#define forAll(list, i)
Loop across all elements in list.
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, IOobjectOption::readOption readOpt=IOobjectOption::MUST_READ) const
Find entry and assign to T val. FatalIOError if it is found and the number of tokens is incorrect...
label findPatchConditionID(const label patchI, const word &patchName) const
Return the condition ID for a boundary patch.
A class for handling words, derived from Foam::string.
dictionary generatePatchDict(const word ®ionPrefix, const word &fieldName, const word &condition, const word &category, const word &patchType, const dictionary &conditionOptions) const
Generate a dictionary representation of patch boundary condition.
wordList patchNames(nPatches)
A List of wordRe with additional matching capabilities.
bool optionsRequired(const word ®ionPrefix, const word &category, const word &patchType) const
Return true if condition requires additional user options.
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings...
const word & patchCategory(const label patchI) const
Return the category name for patch with index patchI.
const word & patchType(const label patchI) const
Return the type name for patch with index patchI.
Foam::word regionName(args.getOrDefault< word >("region", Foam::polyMesh::defaultRegion))
caseInfo(const Time &runTime, const word ®ionName)
Constructor.
messageStream Info
Information stream (stdout output on master, null elsewhere)
const word & conditionName(const label patchI) const
Return the condition name for patch with index patchI.
void checkPatch(const word ®ionPrefix, const word &condition, const word &category, const word &patchType) const
Check that user supplied patch info is valid.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
int system(const std::string &command, const bool bg=false)
Execute the specified command via the shell.
Defines the attributes of an object for which implicit objectRegistry management is supported...
void checkPatches(const word ®ionPrefix, const boundaryTemplates &bcTemplates) const
Check patches.
List< label > toc(const UList< bool > &bools)
Return the (sorted) values corresponding to 'true' entries.