41 return wordHashSet(*writefileExtensionMemberFunctionTablePtr_);
94 <<
"Cannot determine format from filename" <<
nl
99 write(
name, ext, surf, streamOpt, options);
106 auto* mfuncPtr = writefileExtensionMemberFunctionTable(fileType);
111 <<
"Unknown file type " << fileType <<
nl <<
nl
112 <<
"Valid types:" <<
nl
117 mfuncPtr(
name, surf, streamOpt, options);
129 const word
name(surfName.size() ? surfName : surfaceRegistry::defaultName);
135 const fileName objectDir
137 t.timePath()/surfaceRegistry::prefix/
name/surfMesh::meshSubDir
140 if (!isDir(objectDir))
154 surfMesh::meshSubDir,
156 IOobjectOption::NO_READ,
157 IOobjectOption::NO_WRITE,
158 IOobjectOption::NO_REGISTER
162 OFstream
os(objectDir/
io.name(), t.writeStreamOption());
168 IOobject::writeEndDivider(
os);
180 surfMesh::meshSubDir,
182 IOobjectOption::NO_READ,
183 IOobjectOption::NO_WRITE,
184 IOobjectOption::NO_REGISTER
188 OFstream
os(objectDir/
io.name(), t.writeStreamOption());
192 if (this->useFaceMap())
198 os << this->surfFaces();
201 IOobject::writeEndDivider(
os);
213 surfMesh::meshSubDir,
215 IOobjectOption::NO_READ,
216 IOobjectOption::NO_WRITE,
217 IOobjectOption::NO_REGISTER
222 OFstream
os(objectDir/
io.name());
226 os << this->surfZones();
228 IOobject::writeEndDivider(
os);
238 const pointField& pointLst,
239 const UList<Face>& faceLst,
240 const UList<surfZone>& zoneLst,
241 const labelUList& faceMap,
242 const labelUList& faceIdsLst
264 for (
const auto&
f : faces_)
266 nTri +=
f.nTriangles();
Various functions to operate on Lists.
@ NO_REGISTER
Do not request registration (bool: false).
@ NO_READ
Nothing to be read.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
static Ostream & writeEndDivider(Ostream &os)
Write the standard end file divider.
A simple container for options an IOstream can normally have.
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats.
const UList< surfZone > & surfZones() const noexcept
Const access to the surface zones.
static bool canWriteType(const word &fileType, bool verbose=false)
Can this file format type be written via MeshedSurfaceProxy?
static wordHashSet writeTypes()
The file format types that can be written via MeshedSurfaceProxy.
const UList< Face > & surfFaces() const noexcept
Return const access to the faces.
const labelUList & faceMap() const noexcept
Const access to the faceMap, zero-sized when unused.
MeshedSurfaceProxy(const pointField &pointLst, const UList< Face > &faceLst, const UList< surfZone > &zoneLst=UList< surfZone >::null(), const labelUList &faceMap=labelUList::null(), const labelUList &faceIdLst=labelUList::null())
Construct from component references.
label nTriangles() const
Count number of triangles.
label size() const noexcept
The surface size is the number of faces.
static void write(const fileName &name, const MeshedSurfaceProxy &surf, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null)
Write to file, select based on its extension.
bool useFaceMap() const noexcept
Can/should use faceMap?
Output to file stream as an OSstream, normally using std::ofstream for the actual output.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
IOstreamOption writeStreamOption() const noexcept
Get write stream option (format, compression, version).
static word timeName(const scalar t, const int precision=precision_)
Return a time name for the given scalar time value formatted with the given precision.
fileName timePath() const
Return current time path = path/timeName.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
static bool isTri()
Face-type only handles triangles. Not true in general.
A class for handling file names.
static word meshSubDir
Return the mesh sub-directory name (normally "surfMesh").
IOobject for a surfZoneList.
static const word prefix
The prefix to local: surfaces.
static word defaultName
The default surface name: default.
A class for handling words, derived from Foam::string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
#define DebugInFunction
Report an information message using Foam::Info.
List< label > sortedToc(const UList< bool > &bools)
Return the (sorted) values corresponding to 'true' entries.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
HashSet< word, Hash< word > > wordHashSet
A HashSet of words, uses string hasher.
CompactIOList< face > faceCompactIOList
Compact IO for a List of face.
vectorIOField pointIOField
pointIOField is a vectorIOField.
Ostream & endl(Ostream &os)
Add newline and flush stream.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
vectorField pointField
pointField is a vectorField.
errorManipArg< error, int > exit(error &err, const int errNo=1)
UList< label > labelUList
A UList of labels.
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?
constexpr char nl
The newline '\n' character (0x0a).