84int main(
int argc,
char *argv[])
88 "Translate OPENFOAM data to CCM format"
91 timeSelector::addOptions();
92 argList::noParallel();
93 argList::addBoolOption
102 "Provide alternative base name. Default is <meshExport>."
104 argList::addBoolOption
107 "No backup of existing output files"
113 "Use specified remapping dictionary instead of <constant/remapping>"
115 argList::addBoolOption
118 "Convert results only"
121 argList::noFunctionObjects();
130 const bool optResults =
args.
found(
"results");
131 const bool optOverwrite =
args.
found(
"overwrite");
133 fileName exportName = ccm::writer::defaultMeshName;
136 const word ext(exportName.
ext());
138 if (ext ==
"ccm" || ext ==
"ccmg" || ext ==
"ccmp")
140 exportName = exportName.
lessExt();
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);
181 #include "getTimeIndex.H"
187 exportName +
".ccmg",
193 else if (
mesh.moving())
217 runTime.setTime(timeDirs[timeI], timeI);
219 #include "getTimeIndex.H"
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:";
265 writer.writeSolution(objects);
vtk::internalMeshWriter writer(topoMesh, topoCells, vtk::formatType::INLINE_ASCII, runTime.path()/"blockTopology")
Reader/writer for handling ccm files.
List of IOobjects with searching and retrieving facilities.
T & last()
Return the last element of the list.
void printUsage(bool full=true) const
Print usage.
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.
const fileName & globalCaseName() const noexcept
Return global case name.
Write OpenFOAM meshes and/or results to CCM format.
void exit(const int errNo=1)
Exit : can be called for any error to exit program.
A class for handling file names.
fileName lessExt() const
Return file name without extension (part before last .)
word ext() const
Return file name extension (part after last .)
static instantList select0(Time &runTime, const argList &args)
A class for handling words, derived from Foam::string.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Foam::argList args(argc, argv)
#define forAll(list, i)
Loop across all elements in list.