FEATURE: Make sure constant directory is available before writing into it. Author: Hrvoje Jasak. Merge: Dominik Christ.

This commit is contained in:
Dominik Christ 2014-09-30 16:25:19 +01:00
commit cc4804428b
2 changed files with 30 additions and 27 deletions

View file

@ -45,7 +45,7 @@ int main(int argc, char *argv[])
{
# include "setRootCase.H"
# include "createTime.H"
IOdictionary meshDict
(
IOobject
@ -57,7 +57,7 @@ int main(int argc, char *argv[])
IOobject::NO_WRITE
)
);
IOdictionary decomposeParDict
(
IOobject
@ -69,12 +69,12 @@ int main(int argc, char *argv[])
IOobject::NO_WRITE
)
);
const label nProcessors
(
readLabel(decomposeParDict.lookup("numberOfSubdomains"))
);
for(label procI=0;procI<nProcessors;++procI)
{
fileName file("processor");
@ -82,17 +82,20 @@ int main(int argc, char *argv[])
ss << procI;
file += ss.str();
Info << "Creating " << file << endl;
//- create a directory for processor data
// create a directory for processor data
mkDir(runTime.path()/file);
//- copy the contents of the const directory into processor*
// generate constant directories
mkDir(runTime.path()/"constant");
// copy the contents of the const directory into processor*
cp(runTime.path()/"constant", runTime.path()/file);
//- generate 0 directories for
mkDir(runTime.path()/file/"0");
// generate 0 directories
mkDir(runTime.path()/file/"0");
}
Info << "End\n" << endl;
return 0;
}

View file

@ -8,32 +8,32 @@ cd cartesianMesh
cd asmoOctree
cleanCase
rm -rf constant/polyMesh > /dev/null 2>&1
rm log.*
\rm -rf constant/polyMesh > /dev/null 2>&1
\rm -f log.*
cd ..
cd bunnyOctree
cleanCase
rm -rf constant/polyMesh > /dev/null 2>&1
rm log.*
\rm -rf constant/polyMesh > /dev/null 2>&1
\rm -f log.*
cd ..
cd intakePortOctree
cleanCase
rm -rf constant/polyMesh > /dev/null 2>&1
rm log.*
\rm -rf constant/polyMesh > /dev/null 2>&1
\rm -f log.*
cd ..
cd sawOctree
cleanCase
rm -rf processor* > /dev/null 2>&1
rm log.*
\rm -rf processor* > /dev/null 2>&1
\rm -f log.*
cd ..
cd sBendOctree
cleanCase
rm -rf constant/polyMesh > /dev/null 2>&1
rm log.*
\rm -rf constant/polyMesh > /dev/null 2>&1
\rm -f log.*
cd ..
cd ..
@ -42,8 +42,8 @@ cd cartesian2DMesh
cd hatOctree
cleanCase
rm -rf constant/polyMesh > /dev/null 2>&1
rm log.*
\rm -rf constant/polyMesh > /dev/null 2>&1
\rm -f log.*
cd ..
cd ..
@ -52,14 +52,14 @@ cd tetMesh
cd cutCubeOctree
cleanCase
rm -rf constant/polyMesh > /dev/null 2>&1
rm log.*
\rm -rf constant/polyMesh > /dev/null 2>&1
\rm -f log.*
cd ..
cd socketOctree
cleanCase
rm -rf constant/polyMesh > /dev/null 2>&1
rm log.*
\rm -rf constant/polyMesh > /dev/null 2>&1
\rm -f log.*
cd ..
cd ..