50 if (casePath.empty() || casePath ==
".")
55 else if (casePath[0] !=
'/' && casePath.
name() ==
"..")
58 casePath =
cwd()/casePath;
66int main(
int argc,
char *argv[])
80 "Specify alternative mesh region for the master mesh"
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)
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;
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 =
164 &&
args.readIfPresent(
"resultTime", meshInstance)
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);
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Extract command arguments and options from the supplied argc and argv parameters.
static void addArgument(const string &argName, const string &usage="")
Append a (mandatory) argument to validArgs.
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Add an option to validOptions with usage information.
static void addNote(const string ¬e)
Add extra notes for the usage information.
A class for handling file names.
static bool clean(std::string &str)
Cleanup filename string, possibly applies other transformations such as changing the path separator e...
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.
static word defaultRegion
Return the default region name.
static void removeFiles(const polyMesh &mesh)
Helper: remove all procAddressing files from mesh instance.
static void removeFiles(const polyMesh &)
Helper: remove all sets files from mesh instance.
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.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
constexpr char nl
The newline '\n' character (0x0a).
Foam::argList args(argc, argv)