84int main(
int argc,
char *argv[])
88 "Translate OPENFOAM data to CCM format"
102 "Provide alternative base name. Default is <meshExport>."
107 "No backup of existing output files"
113 "Alternative remapping dictionary (default: 'constant/remapping')"
118 "Convert results only"
129 const bool optMesh =
args.found(
"mesh");
130 const bool optResults =
args.found(
"results");
131 const bool optOverwrite =
args.found(
"overwrite");
134 if (
args.readIfPresent(
"name", exportName))
136 const word ext(exportName.
ext());
138 if (ext ==
"ccm" || ext ==
"ccmg" || ext ==
"ccmp")
143 else if (
args.found(
"case"))
145 exportName +=
'-' +
args.globalCaseName();
148 if (optMesh && optResults)
151 <<
"\n-mesh and -results options are mutually exclusive\n"
171 runTime.setTime(timeDirs[0], 0);
179 runTime.setTime(timeDirs[timeI], timeI);
187 exportName +
".ccmg",
193 else if (
mesh.moving())
217 runTime.setTime(timeDirs[timeI], timeI);
222 <<
mesh.nCells() <<
" cells, "
223 <<
mesh.nPoints() <<
" points, "
224 <<
mesh.boundaryMesh().size() <<
" patches"
233 exportName +
".ccmg",
239 else if (
mesh.moving())
258 Info<<
"writing solution:";
259 if (
args.found(
"remap"))
265 writer.writeSolution(objects);
Reader/writer routines for handling ccm files.
vtk::lineWriter writer(edgeCentres, edgeList::null(), fileName(aMesh.time().globalPath()/(vtkBaseFileName+"-edgesCentres")))
List of IOobjects with searching and retrieving facilities. Implemented as a HashTable,...
T & last()
Access last element of the list, position [size()-1].
static void noFunctionObjects(bool addWithOption=false)
Remove '-noFunctionObjects' option and ignore any occurrences.
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
Add a bool option to validOptions with usage information.
static void noParallel()
Remove the parallel options.
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.
Write OpenFOAM meshes and/or results to CCM format.
static FOAM_DLL_EXPORT string defaultMeshName
The name for the topology file reference.
A class for handling file names.
bool remove_ext()
Remove extension, returning true if string changed.
word ext() const
Return file name extension (part after last .).
static void addOptions(const bool constant=true, const bool withZero=false)
Add timeSelector options to argList::validOptions.
static instantList select0(Time &runTime, const argList &args)
Return the set of times selected based on the argList options and also set the runTime to the first i...
A class for handling words, derived from Foam::string.
messageStream Info
Information stream (stdout output on master, null elsewhere).
List< instant > instantList
List of instants.
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...
messageStream Warning
Warning stream (stdout output on master, null elsewhere), with additional 'FOAM Warning' header text.
Foam::argList args(argc, argv)
#define forAll(list, i)
Loop across all elements in list.