93 int 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." 174 const word ext(exportName.
ext());
176 if (ext ==
"ccm" || ext ==
"ccmg" || ext ==
"ccmp")
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))
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" This class separates the mesh into distinct unconnected regions, each of which is then given a label ...
static void noFunctionObjects(bool addWithOption=false)
Remove '-noFunctionObjects' option and ignore any occurrences.
static void addNote(const string ¬e)
Add extra notes for the usage information.
A class for handling file names.
errorManipArg< error, int > exit(error &err, const int errNo=1)
void off()
Switch the function objects off.
vtk::lineWriter writer(edgeCentres, edgeList::null(), fileName(aMesh.time().globalPath()/"finiteArea-edgesCentres"))
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
bool removeBaffles() const
Remove baffles by merging their respective faces (default false)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
constexpr char nl
The newline '\n' character (0x0a)
bool useNumberedNames() const
Use numbered names (eg, patch_0, zone_0) instead of human-readable.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const fileName & globalCaseName() const noexcept
Return global case name.
static unsigned int defaultPrecision() noexcept
Return the default precision.
Reads CCM files as written by PROSTAR/STARCCM.
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.
T getOrDefault(const word &optName, const T &deflt) const
Get a value from the named option if present, or return default.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
word ext() const
Return file name extension (part after last .)
bool mergeInterfaces() const
Merge in-place interfaces (default true)
const functionObjectList & functionObjects() const noexcept
Return the list of function objects.
A class for handling words, derived from Foam::string.
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.
const fileName & caseName() const noexcept
Return case name (parallel run) or global case (serial run)
const fileName & rootPath() const noexcept
Return root path.
bool remove_ext()
Remove extension, returning true if string changed.
word format(conversionProperties.get< word >("format"))
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.
vector span() const
The bounding box span (from minimum to maximum)
streamFormat
Data format (ascii | binary)
messageStream Info
Information stream (stdout output on master, null elsewhere)
virtual bool writeGeometry()
Write patch topology.
const boundBox & bounds() const noexcept
Return mesh bounding box.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
bool readIfPresent(const word &optName, T &val) const
Read a value from the named option if present.
Reader/writer for handling ccm files.
bool keepSolid() const
Keep solid regions (default true)
Foam::argList args(argc, argv)
static string defaultMeshName
The name for the topology file reference.
bool found(const word &optName) const
Return true if the named option is found.