edgeMeshFormat Class Reference

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

Inheritance diagram for edgeMeshFormat:
[legend]
Collaboration diagram for edgeMeshFormat:
[legend]

Public Member Functions

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

Static Public Member Functions

static autoPtr< edgeMeshNew (const fileName &name)
 Read file and return edgeMesh. More...
 
static bool read (Istream &, pointField &, edgeList &)
 Read edgeMesh components from stream. More...
 
static Ostreamwrite (Ostream &, const pointField &, const edgeList &)
 Write edgeMesh components to stream. More...
 
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. More...
 
- Static Public Member Functions inherited from edgeMesh
static label size (const Mesh &mesh)
 Return size. Number of internal edges. More...
 
static wordHashSet readTypes ()
 Summary of supported read file types. More...
 
static wordHashSet writeTypes ()
 Summary of supported write file types. More...
 
static bool canReadType (const word &fileType, bool verbose=false)
 Can we read this file format? More...
 
static bool canWriteType (const word &fileType, bool verbose=false)
 Can we write this file format type? More...
 
static bool canRead (const fileName &name, bool verbose=false)
 Can we read this file format? More...
 
static autoPtr< edgeMeshNew (const fileName &name, const word &fileType)
 Read construct from filename with given format. More...
 
static autoPtr< edgeMeshNew (const fileName &name)
 Select constructed from filename (implicit extension) More...
 
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) More...
 
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. More...
 
- 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. More...
 

Static Protected Member Functions

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

Additional Inherited Members

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

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 58 of file edgeMeshFormat.H.

Constructor & Destructor Documentation

◆ edgeMeshFormat()

edgeMeshFormat ( const fileName filename)
explicit

Construct from file name.

Definition at line 38 of file edgeMeshFormat.C.

References edgeMeshFormat::read().

Here is the call graph for this function:

◆ ~edgeMeshFormat()

virtual ~edgeMeshFormat ( )
virtualdefault

Destructor.

Member Function Documentation

◆ writeHeader()

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

Write header information.

◆ New()

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

Read file and return edgeMesh.

Definition at line 95 of file edgeMeshFormat.H.

References Foam::name().

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 96 of file edgeMeshFormat.C.

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

Referenced by edgeMeshFormat::edgeMeshFormat().

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

◆ write() [1/3]

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

Write edgeMesh components to stream.

Definition at line 117 of file edgeMeshFormat.C.

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

Here is the call graph for this function:

◆ write() [2/3]

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 141 of file edgeMeshFormat.C.

References clock::dateTime(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, FUNCTION_NAME, io(), mesh, Time::New(), IOobject::NO_READ, IOobject::NO_WRITE, os(), ensightPTraits< Type >::typeName, and write().

Here is the call graph for this function:

◆ read() [2/2]

bool read ( const fileName name)
virtual

Read from file.

Reimplemented from edgeMesh.

Definition at line 49 of file edgeMeshFormat.C.

References clear(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, io(), Time::New(), IOobject::NO_READ, IOobject::NO_WRITE, and Foam::read().

Here is the call graph for this function:

◆ write() [3/3]

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

Write edge mesh to file.

Reimplemented from edgeMesh.

Definition at line 139 of file edgeMeshFormat.H.

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

Here is the call graph for this function:

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