93int main(
int argc,
char *argv[])
97 "Reads CCM files as written by PROSTAR/STARCCM and writes an OPENFOAM "
98 " polyMesh. Multi-region support for PROSTAR meshes should be stable."
99 " Multi-region merging for STARCCM meshes will not always be"
108 "Write in ASCII format instead of binary"
113 "Re-export mesh in CCM format for post-processing"
118 "List some information about the geometry"
124 "Alternative remapping dictionary (default: 'constant/remapping')"
130 "Provide alternative base name when re-exporting (implies -export). "
131 "Default is <meshExport>."
136 "Remove any baffles by merging the faces"
141 "Merge in-place interfaces"
146 "Use numbered names (eg, patch_0, zone_0) only"
152 "Geometry scaling factor - default is 1 (ie, no scaling)"
157 "Treat any solid cells present just like fluid cells. "
158 "The default is to remove them."
166 runTime.functionObjects().off();
168 const bool optList =
args.found(
"list");
172 if (
args.readIfPresent(
"name", exportName))
174 const word ext(exportName.
ext());
176 if (ext ==
"ccm" || ext ==
"ccmg" || ext ==
"ccmp")
181 else if (
args.found(
"export"))
184 if (
args.found(
"case"))
186 exportName +=
'-' +
args.globalCaseName();
191 const scalar scaleFactor =
args.getOrDefault<scalar>(
"scale", 1);
212 if (
args.found(
"numbered"))
217 if (
args.found(
"solids"))
219 Info<<
"treating solids like fluids" <<
endl;
233 Info<<
"mesh geometry information:" <<
endl;
234 if (reader.hasGeometry())
236 Info<<
nl <<
"cellTable:" << reader.cellTableInfo()
237 <<
nl <<
"boundaryRegion:" << reader.boundaryTableInfo()
238 <<
nl <<
"interfaces:" << reader.interfaceDefinitionsInfo()
245 : reader.remapMeshInfo(
runTime)
249 <<
"Remapped cellTable:" << reader.cellTableInfo() <<
nl
250 <<
"Remapped boundaryRegion:" << reader.boundaryTableInfo()
261 else if (reader.readGeometry(scaleFactor))
271 Info<<
nl <<
"Bounding box size: " <<
mesh().bounds().span() <<
nl;
276 Info<<
"Number of regions: " << rs.nRegions();
277 if (rs.nRegions() == 1)
284 <<
"**************************************************" <<
nl
285 <<
"** WARNING: the mesh has disconnected regions **" <<
nl
286 <<
"**************************************************" <<
nl;
292 if (exportName.size())
294 const fileName geomName = exportName +
".ccmg";
295 Info<<
nl <<
"Re-exporting geometry as " << geomName <<
nl;
302 <<
"could not read geometry"
Reader/writer routines for handling ccm files.
streamFormat
Data format (ascii | binary | coherent).
@ ASCII
"ascii" (normal default)
static unsigned int minPrecision(unsigned int prec) noexcept
Set the minimum default precision.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Extract command arguments and options from the supplied argc and argv parameters.
static void noFunctionObjects(bool addWithOption=false)
Remove '-noFunctionObjects' option and ignore any occurrences.
static void addArgument(const string &argName, const string &usage="")
Append a (mandatory) argument to validArgs.
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.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
bool mergeInterfaces() const noexcept
Merge in-place interfaces (default true).
bool useNumberedNames() const noexcept
Use numbered names (eg, patch_0, zone_0) instead of human-readable.
bool removeBaffles() const noexcept
Remove baffles by merging their respective faces (default false).
bool keepSolid() const noexcept
Keep solid regions (default true).
Reads CCM files as written by PROSTAR/STARCCM.
Write OpenFOAM meshes and/or results to CCM format.
FOAM_DLL_EXPORT void writeGeometry()
Write the mesh.
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 .).
This class separates the mesh into distinct unconnected regions, each of which is then given a label ...
A class for handling words, derived from Foam::string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
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...
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a).
word format(conversionProperties.get< word >("format"))
Foam::argList args(argc, argv)