50 if (casePath.empty() || casePath ==
".")
55 else if (casePath[0] !=
'/' && casePath.
name() ==
"..")
58 casePath =
cwd()/casePath;
66int main(
int argc,
char *argv[])
75 argList::addArgument(
"masterCase");
80 "Specify alternative mesh region for the master mesh"
83 argList::addArgument(
"addCase");
88 "Specify alternative mesh region for the additional mesh"
94 "Specify a time for the resulting mesh"
103 const bool overwrite =
args.
found(
"overwrite");
108 const word masterRegion =
111 const word addRegion =
117 const auto pos = cName.find(
"processor");
118 if (pos != string::npos && pos != 0)
120 fileName processorName = cName.substr(pos);
121 masterCase +=
'/' + processorName;
122 addCase +=
'/' + processorName;
126 getRootCase(masterCase);
127 getRootCase(addCase);
129 Info<<
"Master: " << masterCase <<
" region " << masterRegion <<
nl
130 <<
"mesh to add: " << addCase <<
" region " << addRegion <<
endl;
132 #include "createTimes.H"
134 Info<<
"Reading master mesh for time = " << runTimeMaster.timeName() <<
nl;
142 runTimeMaster.timeName(),
147 Info<<
"Reading mesh to add for time = " << runTimeToAdd.timeName() <<
nl;
154 runTimeToAdd.timeName(),
159 word meshInstance = masterMesh.pointsInstance();
161 const bool specifiedInstance =
167 if (specifiedInstance)
169 runTimeMaster.setTime(
instant(meshInstance), 0);
176 Info<<
"Writing combined mesh to " << runTimeMaster.timeName() <<
endl;
178 masterMesh.addMesh(meshToAdd);
181 if (overwrite || specifiedInstance)
183 masterMesh.setInstance(meshInstance);
187 topoSet::removeFiles(masterMesh);
188 processorMeshes::removeFiles(masterMesh);
Defines the attributes of an object for which implicit objectRegistry management is supported,...
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
Extract command arguments and options from the supplied argc and argv parameters.
T get(const label index) const
Get a value from the argument at index.
bool check(bool checkArgs=argList::argsMandatory(), bool checkOpts=true) const
bool found(const word &optName) const
Return true if the named option is found.
bool readIfPresent(const word &optName, T &val) const
Read a value from the named option if present.
T getOrDefault(const word &optName, const T &deflt) const
Get a value from the named option if present, or return default.
const fileName & caseName() const noexcept
Return case name (parallel run) or global case (serial run)
void exit(const int errNo=1)
Exit : can be called for any error to exit program.
A class for handling file names.
static bool clean(std::string &str)
static std::string name(const std::string &str)
Return basename (part beyond last /), including its extension.
An instant of time. Contains the time value and name. Uses Foam::Time when formatting the name.
Add a given mesh to the original mesh to create a single new mesh.
Mesh consisting of general polyhedral cells.
A class for handling words, derived from Foam::string.
fileName cwd()
The physical or logical current working directory path name.
dimensionedScalar pos(const dimensionedScalar &ds)
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
constexpr char nl
The newline '\n' character (0x0a)
Foam::argList args(argc, argv)