Loading...
Searching...
No Matches
edgeMeshFormat Class Reference

Provide a means of reading/writing the single-file OpenFOAM edge format. More...

#include <edgeMeshFormat.H>

Inheritance diagram for edgeMeshFormat:
Collaboration diagram for edgeMeshFormat:

Public Member Functions

 edgeMeshFormat (const fileName &filename)
 Construct from file name.
virtual ~edgeMeshFormat ()=default
 Destructor.
virtual bool read (const fileName &filename) override
 Read from file.
virtual void write (const fileName &name, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null) const override
 Write edge mesh to file.
virtual void write (const fileName &name, const word &fileType, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null) const override
 Write edge mesh to file.
Public Member Functions inherited from edgeMesh
 edgeMesh (const faMesh &mesh)
 Construct finite-area edge mesh faMesh reference.
label size () const noexcept
 The geometric (internal) size - number of internal edges.
const edgeVectorFieldC () const
 Field of edge centres.
 TypeName ("edgeMesh")
 Runtime type information.
 edgeMesh ()
 Default construct.
 edgeMesh (const edgeMesh &em)
 Copy construct.
 edgeMesh (edgeMesh &&em)
 Move construct.
 edgeMesh (const pointField &points, const edgeList &edges)
 Copy construct from components.
 edgeMesh (pointField &&pointLst, edgeList &&edgeLst)
 Move construct from components.
 edgeMesh (const fileName &name)
 Construct from file name (uses extension to determine type).
 edgeMesh (const fileName &name, const word &fileType)
 Construct from file name with specified type.
 declareRunTimeSelectionTable (autoPtr, edgeMesh, fileExtension,(const fileName &name),(name))
virtual ~edgeMesh ()=default
 Destructor.
 declareMemberFunctionSelectionTable (void, edgeMesh, write, fileExtension,(const fileName &name, const edgeMesh &mesh, IOstreamOption streamOpt, const dictionary &options),(name, mesh, streamOpt, options))
void transfer (edgeMesh &mesh)
 Transfer the contents of the argument and annul the argument.
bool read (const fileName &name, const word &fileType)
 Read from file. Chooses reader based on explicit extension.
const pointFieldpoints () const noexcept
 Return points.
const edgeListedges () const noexcept
 Return edges.
const labelListListpointEdges () const
 Return edges.
label regions (labelList &edgeRegion) const
 Find connected regions. Set region number per edge.
virtual void clear ()
 Clear all storage.
virtual void scalePoints (const scalar scaleFactor)
 Scale points. A non-positive factor is ignored.
virtual void mergePoints (const scalar mergeDist)
 Geometric merge points (points within mergeDist) prior to.
virtual void mergeEdges ()
 Merge duplicate edges and eliminate unused points.
virtual void writeStats (Ostream &) const
void operator= (const edgeMesh &rhs)
 Copy assignment.
void operator= (edgeMesh &&rhs)
 Move assignment.
Public Member Functions inherited from GeoMesh< faMesh >
 GeoMesh (const faMesh &mesh)
 Construct from mesh reference.
bool hasDb () const
 Return true if thisDb() is a valid DB - here = false.
const objectRegistrythisDb () const
 Return the object registry.
const faMeshoperator() () const
 Return reference to the underlying mesh.
Public Member Functions inherited from edgeMeshFormatsCore
 edgeMeshFormatsCore ()=default
 Default construct.
virtual ~edgeMeshFormatsCore ()=default
 Destructor.

Static Public Member Functions

static autoPtr< edgeMeshNew (const fileName &name)
 Read file and return edgeMesh.
static bool read (Istream &, pointField &, edgeList &)
 Read edgeMesh components from stream.
static Ostreamwrite (Ostream &, const pointField &, const edgeList &)
 Write edgeMesh components to stream.
static void write (const fileName &filename, const edgeMesh &mesh, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null)
 Write edge mesh to file with a mimicked IOobject header.
Static Public Member Functions inherited from edgeMesh
static label size (const faMesh &mesh) noexcept
 The geometric (internal) size - number of internal edges.
static label boundary_size (const faMesh &mesh) noexcept
 The geometric boundary size - number of boundary edges.
static wordHashSet readTypes ()
 Summary of supported read file types.
static wordHashSet writeTypes ()
 Summary of supported write file types.
static bool canReadType (const word &fileType, bool verbose=false)
 Can we read this file format?
static bool canWriteType (const word &fileType, bool verbose=false)
 Can we write this file format type?
static bool canRead (const fileName &name, bool verbose=false)
 Can we read this file format?
static autoPtr< edgeMeshNew (const fileName &name, const word &fileType)
 Read construct from filename with given format.
static autoPtr< edgeMeshNew (const fileName &name)
 Select constructed from filename (implicit extension).
static void write (const fileName &name, const edgeMesh &mesh, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null)
 Write to file (format implicit in the extension).
static void write (const fileName &name, const word &fileType, const edgeMesh &mesh, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null)
 Write to file, with given format.
Static Public Member Functions inherited from edgeMeshFormatsCore
static bool checkSupport (const wordHashSet &available, const word &fileType, const bool verbose=false, const char *functionName=nullptr)
 Verbose checking of fileType in the list of available types.

Static Protected Member Functions

static void writeHeader (Ostream &, const pointField &, const edgeList &)
 Write header information.
Static Protected Member Functions inherited from edgeMeshFormatsCore
static string getLineNoComment (ISstream &is, const char comment='#')
 Read non-comment line.

Additional Inherited Members

Public Types inherited from GeoMesh< faMesh >
typedef faMesh Mesh
typedef faMesh::BoundaryMesh BoundaryMesh
Static Public Attributes inherited from edgeMeshFormatsCore
static word nativeExt
 The file extension corresponding to 'native' edge format.
Protected Member Functions inherited from edgeMesh
pointFieldstoredPoints () noexcept
 Non-const access to global points.
edgeListstoredEdges () noexcept
 Non-const access to the edges.
Protected Attributes inherited from GeoMesh< faMesh >
const faMeshmesh_
 Reference to Mesh.

Detailed Description

Provide a means of reading/writing the single-file OpenFOAM edge format.

Note
This class provides more methods than the regular edge format interface.
Source files

Definition at line 54 of file edgeMeshFormat.H.

Constructor & Destructor Documentation

◆ edgeMeshFormat()

edgeMeshFormat ( const fileName & filename)
explicit

Construct from file name.

Definition at line 31 of file edgeMeshFormat.C.

References read().

Here is the call graph for this function:

◆ ~edgeMeshFormat()

virtual ~edgeMeshFormat ( )
virtualdefault

Destructor.

References edgeMesh::edgeMesh(), mesh, and dictionary::null.

Here is the call graph for this function:

Member Function Documentation

◆ writeHeader()

void writeHeader ( Ostream & ,
const pointField & ,
const edgeList &  )
staticprotected

Write header information.

◆ New()

autoPtr< edgeMesh > New ( const fileName & name)
inlinestatic

Read file and return edgeMesh.

Definition at line 88 of file edgeMeshFormat.H.

References Foam::name(), and autoPtr< T >::NewFrom().

Here is the call graph for this function:

◆ read() [1/2]

bool read ( Istream & is,
pointField & pointLst,
edgeList & edgeLst )
static

Read edgeMesh components from stream.

Definition at line 89 of file edgeMeshFormat.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, and IOstream::good().

Referenced by edgeMeshFormat(), Foam::operator>>(), and extendedFeatureEdgeMeshFormat::read().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write() [1/4]

Foam::Ostream & write ( Ostream & os,
const pointField & pointLst,
const edgeList & edgeLst )
static

Write edgeMesh components to stream.

Definition at line 110 of file edgeMeshFormat.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, FUNCTION_NAME, Foam::nl, os(), and IOobject::writeDivider().

Referenced by Foam::operator<<().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write() [2/4]

void write ( const fileName & filename,
const edgeMesh & mesh,
IOstreamOption streamOpt = IOstreamOption(),
const dictionary & options = dictionary::null )
static

Write edge mesh to file with a mimicked IOobject header.

Definition at line 134 of file edgeMeshFormat.C.

References clock::dateTime(), edgeMesh::edgeMesh(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, FUNCTION_NAME, io, mesh, Time::New(), IOobjectOption::NO_READ, IOobjectOption::NO_REGISTER, IOobjectOption::NO_WRITE, os(), and write().

Here is the call graph for this function:

◆ read() [2/2]

bool read ( const fileName & filename)
overridevirtual

◆ write() [3/4]

virtual void write ( const fileName & name,
IOstreamOption streamOpt = IOstreamOption(),
const dictionary & options = dictionary::null ) const
inlineoverridevirtual

Write edge mesh to file.

Reimplemented from edgeMesh.

Definition at line 144 of file edgeMeshFormat.H.

References Foam::name(), dictionary::null, and write().

Here is the call graph for this function:

◆ write() [4/4]

virtual void write ( const fileName & name,
const word & fileType,
IOstreamOption streamOpt = IOstreamOption(),
const dictionary & options = dictionary::null ) const
inlineoverridevirtual

Write edge mesh to file.

Reimplemented from edgeMesh.

Definition at line 157 of file edgeMeshFormat.H.

References Foam::name(), dictionary::null, and write().

Here is the call graph for this function:

The documentation for this class was generated from the following files: