69 int main(
int argc,
char *argv[])
76 Info<<
"Reading material properties\n" <<
endl;
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");
112 const word& regionName = regionIter().keyword();
113 const dictionary& regionDict = regionIter().dict();
114 const word regionType(regionDict.
lookup(
"type"));
115 const word regionMaterial(regionDict.
lookup(
"material"));
117 Info<<
"\nRegion " << regionName <<
":\n" 118 <<
"\tCreating 0/" << regionName
119 <<
" directory" <<
endl;
125 if (iter == regionInfo.
end())
133 if (
findIndex(regionNames, regionName) == -1)
136 regionNames.
append(regionName);
141 const fileName sourceDir(timeDir/regionType);
142 if (
isDir(sourceDir))
144 cpFiles(sourceDir, currentDir/
"0"/regionName);
149 <<
"Cannot find region type file " 153 const fileName matDir(materialsDir/regionMaterial);
156 Info<<
"\tCreating constant/" << regionName
157 <<
" directory with " << regionMaterial
158 <<
" material" <<
endl;
159 cpFiles(constantDir/regionType, currentDir/
"constant"/regionName);
160 cpFiles(matDir, currentDir/
"constant"/regionName);
163 Info<<
"\tCreating system/" << regionName
164 <<
" directory" <<
endl;
165 cpFiles(systemDir/regionType, currentDir/
"system"/regionName);
170 <<
"Cannot find region material folder " 177 Info<<
"\nWriting region properties\n" <<
endl;
const word & executable() const
Name of executable without the path.
A class for handling file names.
errorManipArg< error, int > exit(error &err, const int errNo=1)
static iteratorEnd end()
iteratorEnd set to beyond the end of any HashTable
A list of keyword definitions, which are a keyword followed by any number of values (e...
void cpFiles(const fileName &srcDir, const fileName &targetDir)
Copy all the files from the source to the target directory.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Simple class to hold region information for coupled region simulations.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
iterator find(const Key &)
Find and return an iterator set at the hashedEntry.
bool isDir(const fileName &, const bool followLink=true)
Does the name exist as a directory in the file system?
A class for handling words, derived from string.
void append(const T &)
Append an element at the end of the list.
const word & constant() const
Return constant name.
static const dictionary null
Null dictionary.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
#define FatalIOErrorIn(functionName, ios)
Report an error message using Foam::FatalIOError.
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurrence of given element and return index,.
List< word > wordList
A List of words.
Foam::argList args(argc, argv)
fileName path() const
Return path.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.