150#ifndef Foam_ccmReader_H
151#define Foam_ccmReader_H
200 static const char* cellTableOpti[];
203 static const char* cellTableOptstr[];
209 const std::unique_ptr<options> options_;
215 UNKNOWN, BAD, OKAY, READ
220 nodeStatus geometryStatus_;
223 nodeStatus solutionStatus_;
240 label nInternalFaces_;
302 reader(
const reader&) =
delete;
305 void operator=(
const reader&) =
delete;
309 inline labelList patchStartList(label initial)
const;
312 void printSizes()
const;
315 int ccmGetEntityIndex(ccmNODE node);
319 std::string ccmReadNodestr(
const char* opt, ccmNODE node);
323 std::string ccmReadOptstr(
const char* opt, ccmID node);
326 void readMap(
const ccmID& mapId,
labelList& data);
329 bool detectGeometry();
332 void readProblemDescription(
const ccmID& probNode);
337 void readInterfaceDefinitions();
340 void readProblemDescription_boundaryRegion(
const ccmID& probNode);
343 void readProblemDescription_cellTable(
const ccmID& probNode);
346 void readMeshTopology(
const scalar scaleFactor=1.0);
351 const ccmID& verticesNode,
352 const scalar scaleFactor = 1.0
356 void readCells(
const ccmID& topoNode);
359 void readInterfaces(
const ccmID& cellsNode);
362 void readMonitoring(
const ccmID& topoId);
369 void removeUnwanted();
375 void renumberInterfaces(
const labelUList& oldToNew);
380 void cleanupInterfaces();
383 void mergeInplaceInterfaces();
392 void writeMeshLabelList
395 const word& propertyName,
407 bool detectSolution();
411 void determineFieldInfo
413 const ccmID& fieldSetNode,
538 return interfaceDefinitions_;
544 return boundaryRegion_;
556 return cellTable_.fluids();
562 return cellTable_.solids();
569 return solutionTable_;
583 return lagrangianTable_;
590 const word& solutionName,
591 const word& fieldName,
592 const bool wallData =
false
615 bool mergeInterfaces_;
619 bool renameInterfaces_;
626 bool useNumberedNames_;
645 mergeInterfaces_(false),
646 renameInterfaces_(true),
647 removeBaffles_(false),
648 useNumberedNames_(false),
670 return keepFluid_ || keepPorous_ || !keepSolid_;
697 void keepFluid(
bool b)
noexcept { keepFluid_ =
b; }
718 void mergeTol(scalar tol)
noexcept { mergeTol_ = tol; }
721 void undefScalar(scalar val)
noexcept { undefScalar_ = val; }
Various functions to operate on Lists.
Containers for holding STARCCM interface definitions.
Containers for holding ccm solution and field listings.
A HashTable similar to std::unordered_map.
A simple container for options an IOstream can normally have.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A HashTable to objects of type <T> with a label key.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
The boundaryRegion persistent data saved as a Map<dictionary>.
base(const base &)=delete
No copy construct.
A list of the available fields.
A list of available interface definitions.
bool keptSomeRegion() const noexcept
Some region (fluid, porous, solid) is kept.
void undefScalar(scalar val) noexcept
Value to assign for undefined solutions (default: NaN).
bool mergeInterfaces() const noexcept
Merge in-place interfaces (default true).
void keepFluid(bool b) noexcept
Keep fluid regions.
bool useNumberedNames() const noexcept
Use numbered names (eg, patch_0, zone_0) instead of human-readable.
bool keepFluid() const noexcept
Keep fluid regions (default true).
constexpr options() noexcept
Construct with default values.
void mergeInterfaces(bool b) noexcept
Merge in-place interfaces.
bool renameInterfaces() const noexcept
Rename interface boundaries as InterfaceN_0, InterfaceN_1.
void renameInterfaces(bool b) noexcept
Rename interface boundaries as InterfaceN_0, InterfaceN_1.
void removeBaffles(bool b) noexcept
Remove baffles by merging their respective faces.
void keepSolid(bool b) noexcept
Keep solid regions.
scalar undefScalar() const noexcept
Value to assign for undefined solutions (default: NaN).
bool removeBaffles() const noexcept
Remove baffles by merging their respective faces (default false).
bool keepSolid() const noexcept
Keep solid regions (default true).
void keepPorous(bool b) noexcept
Keep porous regions.
void mergeTol(scalar tol) noexcept
Merge tolerance for points (default 0.05e-3).
void useNumberedNames(bool b) noexcept
Use numbered names (eg, patch_0, zone_0) instead of human-readable.
bool keepPorous() const noexcept
Keep porous regions (default true).
scalar mergeTol() const noexcept
Merge tolerance for points (default 0.05e-3).
Reads CCM files as written by PROSTAR/STARCCM.
FOAM_DLL_EXPORT void writeMesh(const polyMesh &mesh, IOstreamOption streamOpt=IOstreamOption(IOstreamOption::BINARY)) const
Write the polyMesh.
FOAM_DLL_EXPORT bool remapMeshInfo(const objectRegistry ®istry, const fileName &remappingDictName=fileName::null)
Remap cellTable and boundaryRegion according to dictionary.
FOAM_DLL_EXPORT void clearGeom()
Clear out some information after obtaining a polyMesh.
FOAM_DLL_EXPORT ~reader()
Destructor (closes file).
const boundaryRegion & boundaryTableInfo() const noexcept
Return boundaryRegion table.
FOAM_DLL_EXPORT bool hasSolution()
Return true if file has solutions associated with it.
FOAM_DLL_EXPORT const reader::options & option() const
Reference to the reader options.
FOAM_DLL_EXPORT bool hasGeometry()
Return true if file has geometry associated with it.
FOAM_DLL_EXPORT bool readGeometry(const scalar scaleFactor=1.0)
Detect and read geometry if possible.
const solutionTable & solutions()
Return table of available solutions.
const interfaceDefinitions & interfaceDefinitionsInfo() const noexcept
Return interface definitions map.
const cellTable & cellTableInfo() const noexcept
Return cell table.
const labelList & origFaceId() const noexcept
Map to original face Id.
FOAM_DLL_EXPORT void printInfo() const
Print general information about the mesh.
const fieldTable & lagrangian()
Return table of available lagrangian fields.
const fieldTable & fields()
Return table of available fields.
FOAM_DLL_EXPORT tmp< scalarField > readField(const word &solutionName, const word &fieldName, const bool wallData=false)
Read solution and field combination.
FOAM_DLL_EXPORT autoPtr< polyMesh > mesh(const objectRegistry ®istry, const fileName &remappingDictName=fileName::null)
Construct the polyMesh from the read geometry.
Map< word > fluids() const
Return a list of names corresponding to fluids.
const labelList & origCellId() const noexcept
Map to original cell Id.
FOAM_DLL_EXPORT void writeAux(const objectRegistry ®istry) const
Write cellTable, boundaryRegion and interface information.
Map< word > solids() const
Return a list of names corresponding to solids.
static FOAM_DLL_EXPORT void warnDuplicates(const word &context, const wordList &lst)
Warn about repeated name.
The cellTable persistent data saved as a Map<dictionary>.
A class for handling file names.
static const fileName null
An empty fileName.
Registry of regIOobjects.
Mesh consisting of general polyhedral cells.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
namesList< solutionEntry > solutionTable
List< word > wordList
List of word.
List< label > labelList
A List of labels.
List< face > faceList
List of faces.
vectorField pointField
pointField is a vectorField.
UList< label > labelUList
A UList of labels.