Go to the documentation of this file.
39 const word& solverType
45 Info<<
" Reading boundary templates" <<
endl;
47 fileName BCDir(baseDir/
"boundaryConditions");
61 const word& regionType = iter().keyword();
130 BCDir/regionType/solverType/
patchTypes[i] +
"Options"
151 templates_.add(regionType, regionTemplate);
152 options_.add(regionType, regionOptions);
167 const word& regionPrefix,
168 const word& fieldName,
169 const word& condition,
170 const word& category,
171 const word& patchType,
178 if (regionTemplates.
found(category))
183 if (categoryDict.
found(patchType))
188 if (patchDict.
found(
"OPTIONS"))
191 options_.
subDict(regionPrefix);
193 if (!regionOptions.
found(category))
196 <<
"No options available for category "
204 forAll(requiredOptions, i)
206 const word& option = requiredOptions[i];
212 <<
"Condition " << condition <<
": "
213 <<
"No option '" << option
214 <<
"' available for category '" << category
215 <<
"' and patch type '" << patchType
216 <<
"'. Valid options are: "
217 << conditionOptions.
toc()
224 <<
"Condition " << condition <<
": "
225 <<
"No option '" << option
226 <<
"' available for category '" << category
227 <<
"' and patch type '" << patchType
228 <<
"'. Valid options are " <<
dict.
toc()
234 if (!optionDict.
found(selected))
237 <<
"Condition " << condition <<
": "
238 <<
"No option '" << selected
239 <<
"' available for category '" << category
240 <<
"' and patch type '" << patchType
241 <<
"'. Valid options are " << optionDict.
toc()
252 if (patchDict.
found(fieldName))
262 s.replace(iter().keyword(),
"");
266 "boundaryConditions." + condition +
".values"
268 dict.
add(iter().keyword(),
s.c_str());
276 <<
"Condition " << condition <<
": "
277 <<
"No '" << patchType
278 <<
"' condition found for field '" << fieldName
279 <<
"' in category type '" << category <<
"'"
286 <<
"Condition " << condition <<
": "
287 <<
"No '" << patchType <<
"' boundary types defined in "
288 << categoryDict.
dictName() <<
" templates. "
289 <<
"Available types are: " << categoryDict.
toc()
296 <<
"Condition " << condition <<
": "
297 <<
"Invalid boundary condition type '" << patchType
298 <<
"'. Valid types are:" << regionTemplates.
toc()
308 const word& regionPrefix,
309 const word& condition,
310 const word& category,
311 const word& patchType
316 if (!regionTemplates.
found(category))
319 <<
"Condition " << condition <<
": "
320 <<
"Unknown category '" << category
321 <<
"'. Valid categories are: " << regionTemplates.
toc()
327 if (!categoryDict.
found(patchType))
330 <<
"Condition " << condition <<
": "
331 <<
"Unknown type '" << patchType <<
"' in category '"
332 << category <<
"'. Valid types are: " << categoryDict.
toc()
340 const word& regionPrefix,
341 const word& category,
342 const word& patchType
347 if (regionTemplates.
found(category))
351 if (categoryDict.
found(patchType))
355 if (patchDict.
found(
"OPTIONS"))
363 <<
"No type '" << patchType <<
"' found in category '"
364 << category <<
"'. Valid types are "
365 << categoryDict.
toc()
372 <<
"No category '" << category <<
"' found in templates. "
373 <<
"Valid categories are " << templates_.toc()
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
const word dictName() const
Return the local dictionary name (final part of scoped name)
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A class for handling words, derived from string.
A class for handling file names.
#define forAll(list, i)
Loop across all elements in list.
bool readIfPresent(const word &, T &, bool recursive=false, bool patternMatch=true) const
Find an entry if present, and assign to T.
void checkPatch(const word ®ionPrefix, const word &condition, const word &category, const word &patchType) const
Check that user supplied patch info is valid.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Ostream & endl(Ostream &os)
Add newline and flush stream.
string str() const
Return the string.
wordList patchTypes(nPatches)
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
boundaryTemplates(const fileName &baseDir, const Time &runTime, const word &solverType)
Constructor.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
bool merge(const dictionary &)
Merge entries from the given dictionary.
A list of keyword definitions, which are a keyword followed by any number of values (e....
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Output to memory buffer stream.
const dictionary & templates() const
Return the dictionary of boundary templates.
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 toc() const
Return the table of contents.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
bool optionsRequired(const word ®ionPrefix, const word &category, const word &patchType) const
Return true if condition requires additional user options.
static const dictionary null
Null dictionary.
bool add(entry *, bool mergeEntry=false)
Add a new entry.