53 if (select == patchName)
58 else if (
select.match(patchName))
66 for (
const word& groupName : patchGroups)
68 if (select == groupName)
78 <<
"Boundary patch " << patchName <<
" not defined"
85void 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)
135 dict.readEntry(
"category", patchCategories_[i]);
136 dict.readEntry(
"type", patchTypes_[i]);
137 dict.readEntry(
"patches", patchNames_[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;
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
const List< wordList > & groups() const
Groups.
Class to store boundary template specifications.
void checkPatch(const word ®ionPrefix, const word &condition, const word &category, const word &patchType) const
Check that user supplied patch info is valid.
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.
bool optionsRequired(const word ®ionPrefix, const word &category, const word &patchType) const
Return true if condition requires additional user options.
Class to hold information related to the simaulation case.
void checkPatches(const word ®ionPrefix, const boundaryTemplates &bcTemplates) const
Check patches.
label findPatchConditionID(const label patchI, const word &patchName) const
Return the condition ID for a boundary patch.
const List< wordRes > & patchNames() const
Return the list of patch names.
const word & patchCategory(const label patchI) const
Return the category name for patch with index patchI.
dictionary generateBoundaryField(const word ®ionPrefix, const word &fieldName, const boundaryTemplates &bcTemplates) const
Generate boundary field (dictionary)
const word & conditionName(const label patchI) const
Return the condition name for patch with index patchI.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
entry * add(entry *entryPtr, bool mergeEntry=false)
Add a new entry.
This is the point-patch responsible for managing the force integration on a 'lumped-point' basis,...
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings.
A List of wordRe with additional matching capabilities.
A class for handling words, derived from Foam::string.
Foam::word regionName(Foam::polyMesh::defaultRegion)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
List< bool > select(const label n, const labelUList &locations)
List< label > toc(const UList< bool > &bools)
Return the (sorted) values corresponding to 'true' entries.
int system(const std::string &command, const bool bg=false)
Execute the specified command via the shell.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define forAll(list, i)
Loop across all elements in list.
#define forAllReverse(list, i)
Reverse loop across all elements in list.