50 if (casePath.empty() || casePath ==
".")
55 else if (casePath[0] !=
'/' && casePath.
name() ==
"..")
58 casePath =
cwd()/casePath;
66 int 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;
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);
static void addNote(const string ¬e)
Add extra notes for the usage information.
static void removeFiles(const polyMesh &mesh)
Helper: remove all procAddressing files from mesh instance.
A class for handling file names.
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)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Add a given mesh to the original mesh to create a single new mesh.
T getOrDefault(const word &optName, const T &deflt) const
Get a value from the named option if present, or return default.
void exit(const int errNo=1)
Exit : can be called for any error to exit program.
dimensionedScalar pos(const dimensionedScalar &ds)
static void removeFiles(const polyMesh &)
Helper: remove all sets files from mesh instance.
A class for handling words, derived from Foam::string.
static word defaultRegion
Return the default region name.
Extract command arguments and options from the supplied argc and argv parameters. ...
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Add an option to validOptions with usage information.
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
const fileName & caseName() const noexcept
Return case name (parallel run) or global case (serial run)
static std::string name(const std::string &str)
Return basename (part beyond last /), including its extension.
static bool clean(std::string &str)
Cleanup filename string, possibly applies other transformations such as changing the path separator e...
An instant of time. Contains the time value and name. Uses Foam::Time when formatting the name...
T get(const label index) const
Get a value from the argument at index.
static void addArgument(const string &argName, const string &usage="")
Append a (mandatory) argument to validArgs.
fileName cwd()
The physical or logical current working directory path name.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Mesh consisting of general polyhedral cells.
bool readIfPresent(const word &optName, T &val) const
Read a value from the named option if present.
Foam::argList args(argc, argv)
Defines the attributes of an object for which implicit objectRegistry management is supported...
bool check(bool checkArgs=argList::argsMandatory(), bool checkOpts=true) const
Check the parsed command-line for mandatory arguments and that all the options are correct...
bool found(const word &optName) const
Return true if the named option is found.