94 const word getClassType(
const word& pType)
124 void createFieldFiles
128 const word& regionPrefix,
136 Info<<
" Generating field files" <<
nl <<
endl;
141 const_cast<word&
>(IOdictionary::typeName) =
142 getClassType(fieldTypes[i]);
156 "$FOAM_CASE/system" + regionPath +
"caseProperties" 159 field.add(
"dimensions", fieldDimensions[i]);
161 string iField(
"${:initialConditions." + fieldNames[i] +
'}');
162 field.add(
"internalField", iField.c_str());
172 field.add(
"boundaryField", boundaryField);
182 field2.remove(
"#include");
183 field2.remove(
"initialConditions");
184 field2.remove(
"boundaryConditions");
200 fieldOut.regIOobject::writeObject
210 int main(
int argc,
char *argv[])
214 "Create a 0/ directory with fields appropriate for the chosen" 215 " solver and turbulence model." 222 "Read case set-up templates from specified location" 256 "${WM_PROJECT_DIR}/etc/caseDicts/createZeroDirectoryTemplates" 261 baseDir.toAbsolute();
266 <<
"templateDir " << baseDir <<
nl 267 <<
"Does not point to a folder containing case set-up templates" 292 const label nRegion =
solver.nRegion();
293 for (label regionI = 0; regionI < nRegion; regionI++)
316 solver.regionType(regionI),
317 solver.fieldNames(regionI),
318 solver.fieldTypes(regionI),
319 solver.fieldDimensions(regionI),
static void addNote(const string ¬e)
Add extra notes for the usage information.
A class for handling file names.
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...
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.
constexpr char nl
The newline '\n' character (0x0a)
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.
A traits class, which is primarily used for primitives and vector-space.
Generic GeometricField class.
A simple container for options an IOstream can normally have.
Ignore writing from objectRegistry::writeObject()
T getOrDefault(const word &optName, const T &deflt) const
Get a value from the named option if present, or return default.
Class to store boundary template specifications.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
#define forAll(list, i)
Loop across all elements in list.
localIOdictionary is derived from IOdictionary but excludes parallel master reading.
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?
static int disableFunctionEntries
Enable or disable use of function entries and variable expansions.
A class for handling words, derived from Foam::string.
static word defaultRegion
Return the default region name.
const word & system() const noexcept
Return system name.
static const word null
An empty word.
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Add an option to validOptions with usage information.
runTime controlDict().readEntry("adjustTimeStep"
The central control dictionary, the contents of which are either taken directly from the FOAM_CONTROL...
OBJstream os(runTime.globalPath()/outputName)
Class to hold information related to the simaulation case.
Foam::word regionName(args.getOrDefault< word >("region", Foam::polyMesh::defaultRegion))
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
Input from string buffer, using a ISstream. Always UNCOMPRESSED.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Class to store solver template specifications.
Foam::argList args(argc, argv)
Defines the attributes of an object for which implicit objectRegistry management is supported...
void checkPatches(const word ®ionPrefix, const boundaryTemplates &bcTemplates) const
Check patches.
Output to string buffer, using a OSstream. Always UNCOMPRESSED.