Loading...
Searching...
No Matches
edgeMesh Class Reference

Mesh data needed to do the Finite Area discretisation. More...

#include <edgeFaMesh.H>

Inheritance diagram for edgeMesh:
Collaboration diagram for edgeMesh:

Public Member Functions

 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.
virtual bool read (const fileName &name)
 Read from file. Chooses reader based on detected 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
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.
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.
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 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.

Protected Member Functions

pointFieldstoredPoints () noexcept
 Non-const access to global points.
edgeListstoredEdges () noexcept
 Non-const access to the edges.

Friends

Ostreamoperator<< (Ostream &os, const edgeMesh &em)
Istreamoperator>> (Istream &is, edgeMesh &em)

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.
Static Protected Member Functions inherited from edgeMeshFormatsCore
static string getLineNoComment (ISstream &is, const char comment='#')
 Read non-comment line.
Protected Attributes inherited from GeoMesh< faMesh >
const faMeshmesh_
 Reference to Mesh.

Detailed Description

Mesh data needed to do the Finite Area discretisation.

Points connected by edges.

Author Zeljko Tukovic, FMENA Hrvoje Jasak, Wikki Ltd.

Can be read from fileName based on extension. Uses ::New factory method to select the reader and transfer the result.

Source files

Definition at line 47 of file edgeFaMesh.H.

Constructor & Destructor Documentation

◆ edgeMesh() [1/8]

◆ edgeMesh() [2/8]

edgeMesh ( )
inline

Default construct.

Definition at line 38 of file edgeMeshI.H.

References edgeMeshFormatsCore::edgeMeshFormatsCore().

Referenced by extendedEdgeMesh::sortPointsAndEdges().

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

◆ edgeMesh() [3/8]

edgeMesh ( const edgeMesh & em)
inline

Copy construct.

Definition at line 47 of file edgeMeshI.H.

References edgeMesh(), and edgeMeshFormatsCore::edgeMeshFormatsCore().

Here is the call graph for this function:

◆ edgeMesh() [4/8]

edgeMesh ( edgeMesh && em)
inline

Move construct.

Definition at line 56 of file edgeMeshI.H.

References edgeMesh(), and transfer().

Here is the call graph for this function:

◆ edgeMesh() [5/8]

edgeMesh ( const pointField & points,
const edgeList & edges )
inline

Copy construct from components.

Definition at line 64 of file edgeMeshI.H.

References edgeMeshFormatsCore::edgeMeshFormatsCore(), edges(), and points().

Here is the call graph for this function:

◆ edgeMesh() [6/8]

edgeMesh ( pointField && pointLst,
edgeList && edgeLst )
inline

Move construct from components.

Definition at line 77 of file edgeMeshI.H.

References edgeMeshFormatsCore::edgeMeshFormatsCore(), edges(), and points().

Here is the call graph for this function:

◆ edgeMesh() [7/8]

edgeMesh ( const fileName & name)
explicit

Construct from file name (uses extension to determine type).

Definition at line 42 of file edgeMeshIO.C.

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

Here is the call graph for this function:

◆ edgeMesh() [8/8]

edgeMesh ( const fileName & name,
const word & fileType )

Construct from file name with specified type.

Definition at line 28 of file edgeMeshIO.C.

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

Here is the call graph for this function:

◆ ~edgeMesh()

virtual ~edgeMesh ( )
virtualdefault

Destructor.

References edgeMesh().

Here is the call graph for this function:

Member Function Documentation

◆ size() [1/2]

label size ( const faMesh & mesh)
inlinestaticnoexcept

The geometric (internal) size - number of internal edges.

Method name expected by GeoMesh interface

Definition at line 71 of file edgeFaMesh.H.

References mesh.

Referenced by extendedEdgeMesh::add(), extendedEdgeMesh::autoMap(), extendedEdgeMesh::edgeTreesByType(), extendedEdgeMesh::flipNormals(), extendedEdgeMesh::mergePointsAndSort(), NASedgeFormat::read(), STARCDedgeFormat::read(), extendedEdgeMesh::setFromStatus(), and extendedEdgeMesh::trim().

Here is the caller graph for this function:

◆ boundary_size()

label boundary_size ( const faMesh & mesh)
inlinestaticnoexcept

The geometric boundary size - number of boundary edges.

Method name expected by GeoMesh interface

Definition at line 81 of file edgeFaMesh.H.

References mesh.

◆ size() [2/2]

label size ( ) const
inlinenoexcept

The geometric (internal) size - number of internal edges.

Method name expected by GeoMesh interface

Definition at line 94 of file edgeFaMesh.H.

References GeoMesh< faMesh >::mesh_, Foam::noexcept, and size().

Referenced by size().

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

◆ C()

const edgeVectorField & C ( ) const
inline

Field of edge centres.

Definition at line 103 of file edgeFaMesh.H.

References GeoMesh< faMesh >::mesh_.

◆ storedPoints()

Foam::pointField & storedPoints ( )
inlineprotectednoexcept

◆ storedEdges()

Foam::edgeList & storedEdges ( )
inlineprotectednoexcept

◆ TypeName()

TypeName ( "edgeMesh" )

Runtime type information.

References canRead(), canReadType(), canWriteType(), edgeMesh(), edges(), Foam::name(), points(), readTypes(), TypeName(), and writeTypes().

Referenced by TypeName().

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

◆ readTypes()

Foam::wordHashSet readTypes ( )
static

Summary of supported read file types.

Definition at line 42 of file edgeMesh.C.

Referenced by canReadType(), and TypeName().

Here is the caller graph for this function:

◆ writeTypes()

Foam::wordHashSet writeTypes ( )
static

Summary of supported write file types.

Definition at line 48 of file edgeMesh.C.

Referenced by canWriteType(), and TypeName().

Here is the caller graph for this function:

◆ canReadType()

bool canReadType ( const word & fileType,
bool verbose = false )
static

Can we read this file format?

Definition at line 54 of file edgeMesh.C.

References edgeMeshFormatsCore::checkSupport(), and readTypes().

Referenced by canRead(), and TypeName().

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

◆ canWriteType()

bool canWriteType ( const word & fileType,
bool verbose = false )
static

Can we write this file format type?

Definition at line 66 of file edgeMesh.C.

References edgeMeshFormatsCore::checkSupport(), and writeTypes().

Referenced by TypeName().

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

◆ canRead()

bool canRead ( const fileName & name,
bool verbose = false )
static

Can we read this file format?

Definition at line 78 of file edgeMesh.C.

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

Referenced by TypeName().

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

◆ declareRunTimeSelectionTable()

declareRunTimeSelectionTable ( autoPtr ,
edgeMesh ,
fileExtension ,
(const fileName &name) ,
(name)  )

References declareRunTimeSelectionTable(), edgeMesh(), Foam::name(), and New().

Referenced by declareRunTimeSelectionTable().

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

◆ New() [1/2]

Foam::autoPtr< Foam::edgeMesh > New ( const fileName & name,
const word & fileType )
static

Read construct from filename with given format.

Definition at line 26 of file edgeMeshNew.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::flatOutput(), Foam::name(), and Foam::nl.

Referenced by declareRunTimeSelectionTable().

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

◆ New() [2/2]

Foam::autoPtr< Foam::edgeMesh > New ( const fileName & name)
static

Select constructed from filename (implicit extension).

Definition at line 48 of file edgeMeshNew.C.

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

Here is the call graph for this function:

◆ declareMemberFunctionSelectionTable()

declareMemberFunctionSelectionTable ( void ,
edgeMesh ,
write ,
fileExtension ,
(const fileName &name, const edgeMesh &mesh, IOstreamOption streamOpt, const dictionary &options) ,
(name, mesh, streamOpt, options)  )

◆ write() [1/4]

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

Write to file (format implicit in the extension).

Definition at line 104 of file edgeMeshIO.C.

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

Referenced by declareMemberFunctionSelectionTable(), write(), and extendedEdgeMesh::writeObj().

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

◆ write() [2/4]

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

Write to file, with given format.

Definition at line 77 of file edgeMeshIO.C.

References DebugInFunction, edgeMesh(), Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInLookup, mesh, and Foam::name().

Here is the call graph for this function:

◆ transfer()

void transfer ( edgeMesh & mesh)

Transfer the contents of the argument and annul the argument.

Definition at line 119 of file edgeMesh.C.

References edgeMesh(), and mesh.

Referenced by extendedEdgeMesh::add(), declareMemberFunctionSelectionTable(), edgeMesh(), extendedEdgeMesh::flipNormals(), operator=(), read(), extendedEdgeMesh::sortPointsAndEdges(), and extendedEdgeMesh::transfer().

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

◆ read() [1/2]

bool read ( const fileName & name,
const word & fileType )

Read from file. Chooses reader based on explicit extension.

Definition at line 65 of file edgeMeshIO.C.

References Foam::name(), Foam::New(), and transfer().

Referenced by declareMemberFunctionSelectionTable(), edgeMesh(), and edgeMesh().

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

◆ read() [2/2]

bool read ( const fileName & name)
virtual

Read from file. Chooses reader based on detected extension.

Reimplemented in extendedEdgeMesh, edgeMeshFormat, extendedEdgeMeshFormat, extendedFeatureEdgeMeshFormat, NASedgeFormat, OBJedgeFormat, STARCDedgeFormat, and VTKedgeFormat.

Definition at line 54 of file edgeMeshIO.C.

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

Here is the call graph for this function:

◆ points()

◆ edges()

◆ pointEdges()

const Foam::labelListList & pointEdges ( ) const
inline

Return edges.

Definition at line 104 of file edgeMeshI.H.

Referenced by extendedEdgeMesh::classifyFeaturePoint(), declareMemberFunctionSelectionTable(), regions(), extendedEdgeMesh::sortPointsAndEdges(), and extendedEdgeMesh::writeObj().

Here is the caller graph for this function:

◆ regions()

Foam::label regions ( labelList & edgeRegion) const

Find connected regions. Set region number per edge.

Returns number of regions.

Definition at line 132 of file edgeMesh.C.

References DynamicList< T, SizeMin >::append(), e, forAll, pointEdges(), List< T >::setSize(), UList< T >::size(), and List< T >::transfer().

Referenced by declareMemberFunctionSelectionTable().

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

◆ clear()

void clear ( )
virtual

Clear all storage.

Reimplemented in extendedEdgeMesh.

Definition at line 111 of file edgeMesh.C.

Referenced by extendedEdgeMesh::clear(), and declareMemberFunctionSelectionTable().

Here is the caller graph for this function:

◆ scalePoints()

void scalePoints ( const scalar scaleFactor)
virtual

Scale points. A non-positive factor is ignored.

Definition at line 198 of file edgeMesh.C.

References Foam::equal().

Referenced by declareMemberFunctionSelectionTable().

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

◆ mergePoints()

void mergePoints ( const scalar mergeDist)
virtual

Geometric merge points (points within mergeDist) prior to.

automatically calling mergeEdges().

Definition at line 208 of file edgeMesh.C.

References e, Foam::inplaceMergePoints(), and mergeEdges().

Referenced by declareMemberFunctionSelectionTable().

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

◆ mergeEdges()

void mergeEdges ( )
virtual

Merge duplicate edges and eliminate unused points.

Definition at line 234 of file edgeMesh.C.

References e, Foam::endl(), forAll, Foam::Info, HashSet< Key, Hash >::insert(), bitSet::set(), and bitSet::test().

Referenced by declareMemberFunctionSelectionTable(), and mergePoints().

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

◆ writeStats()

void writeStats ( Ostream & os) const
virtual

Reimplemented in extendedEdgeMesh.

Definition at line 116 of file edgeMeshIO.C.

References edges(), Foam::endl(), Foam::indent(), Foam::nl, os(), points, and UList< T >::size().

Referenced by declareMemberFunctionSelectionTable(), and extendedEdgeMesh::writeStats().

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

◆ write() [3/4]

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

Write to file, choosing writer based on the file extension.

Reimplemented in edgeMeshFormat, OBJedgeFormat, STARCDedgeFormat, and VTKedgeFormat.

Definition at line 340 of file edgeMesh.H.

References Foam::name(), write(), 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
inlinevirtual

Write to file with given format type.

If the format type is "", uses the file extension.

Reimplemented in edgeMeshFormat, OBJedgeFormat, STARCDedgeFormat, and VTKedgeFormat.

Definition at line 355 of file edgeMesh.H.

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

Here is the call graph for this function:

◆ operator=() [1/2]

void operator= ( const edgeMesh & rhs)
inline

Copy assignment.

Definition at line 116 of file edgeMeshI.H.

References edgeMesh(), and Foam::rhs().

Referenced by extendedEdgeMesh::sortPointsAndEdges().

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

◆ operator=() [2/2]

void operator= ( edgeMesh && rhs)
inline

Move assignment.

Definition at line 124 of file edgeMeshI.H.

References edgeMesh(), Foam::rhs(), and transfer().

Here is the call graph for this function:

◆ operator<<

Ostream & operator<< ( Ostream & os,
const edgeMesh & em )
friend

References edgeMesh(), and os().

◆ operator>>

Istream & operator>> ( Istream & is,
edgeMesh & em )
friend

References edgeMesh().


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