74 int main(
int argc,
char *argv[])
78 "nonConformalCouples",
79 "creates a template \'createNonConformalCouplesDict\' file"
87 Info<<
"Reading material properties\n" <<
endl;
101 const fileName currentDir(runTime.path());
102 const fileName materialsDir(currentDir/
"templates"/
"materials");
103 const fileName systemDir(currentDir/
"templates"/
"system");
104 const fileName constantDir(currentDir/
"templates"/
"constant");
105 const fileName timeDir(currentDir/
"templates"/
"0");
117 if(!
isDir(currentDir/
"constant"/regionDirs[i]/
"polyMesh"))
119 regions.erase(regionDirs[i]);
130 "compressibleMultiphaseVoF",
136 "multicomponentFluid",
156 regionList.
append(regionIter().keyword());
157 const dictionary& regionDict = regionIter().dict();
161 if (!regions.found(regionList.
last()))
164 <<
"Cannot find region polyMesh directory "
165 <<
"constant"/regionList.
last()/
"polyMesh" <<
nl <<
nl
166 <<
"Existing regions are "
171 if (!solvers.found(solverList.
last()))
174 <<
"Cannot find solver "
176 <<
"Available solvers are "
177 << solvers.sortedToc()
181 if (!materials.found(materialList.
last()))
184 <<
"Cannot find region material directory "
185 <<
"templates/materials"/materialList.
last() <<
nl <<
nl
186 <<
"Available materials are "
201 const word region(regionList[i]);
202 const word material(materialList[i]);
205 Info<<
"\nRegion " << region <<
":\n"
206 <<
"\tCreating 0/" << region <<
" directory" <<
endl;
209 Info<<
"\tCreating constant/" << region
210 <<
" directory with " << material <<
" material" <<
endl;
212 cpFiles(materialsDir/material, currentDir/
"constant"/region);
214 Info<<
"\tCreating system/" << region <<
" directory" <<
endl;
220 Info<<
"\nWriting regionSolvers\n" <<
endl;
224 currentDir/runTime.system()/
"regionSolvers"
235 "createNonConformalCouplesDict",
241 NCCdict.add(
"fields",
"no");
244 dictionary couplesDict(
"nonConformalCouples");
254 solverList[i] !=
"solid"
255 && solverList[j] !=
"solid"
262 if (solverList[i] ==
"solid" && solverList[j] ==
"solid")
266 wordList keywords{
"regions",
"patches"};
279 word(
"NCC" + std::to_string((NCCi++))),
289 if (solverList[i] ==
"solid")
291 solidRegion = regionList[i];
292 fluidRegion = regionList[j];
296 solidRegion = regionList[j];
297 fluidRegion = regionList[i];
317 word(
"NCC" + std::to_string((NCCi++))),
325 NCCdict.add(
"nonConformalCouples", couplesDict);
327 Info<<
"Writing " << NCCdict.name() <<
"\n" <<
endl;
329 NCCdict.regIOobject::write();
#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.
A HashTable with keys but without contents.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
void append(const T &)
Append an element at the end of the list.
T & last()
Return the last element of the list.
static void addBoolOption(const word &opt, const string &usage="")
Add to a bool option to validOptions with usage information.
bool optionFound(const word &opt) const
Return true if the named option is found.
const word & executable() const
Name of executable without the path.
A keyword and a list of tokens is a 'dictionaryEntry'.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
bool add(entry *, bool mergeEntry=false)
Add a new entry.
static const dictionary null
Null dictionary.
A class for handling file names.
Class to hold the lists of region meshes and solvers.
Abstract base class for run-time selectable region solvers.
A class for handling words, derived from string.
#define FatalIOErrorIn(functionName, ios)
Report an error message using Foam::FatalIOError.
int main(int argc, char *argv[])
errorManipArg< error, int > exit(error &err, const int errNo=1)
List< word > wordList
A List of words.
void cpFiles(const fileName &srcDir, const fileName &targetDir)
Copy all the files from the source to the target directory.
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.
bool isDir(const fileName &, const bool followLink=true)
Does the name exist as a directory in the file system?
fileNameList readDir(const fileName &, const fileType=fileType::file, const bool filterVariants=true, const bool followLink=true)
Read a directory and return the entries as a string list.
Foam::argList args(argc, argv)