edgeMesh Class Reference

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

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

Public Member Functions

 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 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...
 

Protected Member Functions

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

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 MESH::BoundaryMesh BoundaryMesh
 
- Static Public Attributes inherited from edgeMeshFormatsCore
static word nativeExt
 The file extension corresponding to 'native' edge format. More...
 
- Static Protected Member Functions inherited from edgeMeshFormatsCore
static string getLineNoComment (ISstream &is, const char comment='#')
 Read non-comment line. More...
 
- Protected Attributes inherited from GeoMesh< faMesh >
const faMeshmesh_
 Reference to Mesh. More...
 

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 53 of file edgeFaMesh.H.

Constructor & Destructor Documentation

◆ edgeMesh() [1/8]

edgeMesh ( const faMesh mesh)
inlineexplicit

Construct finite-area edge mesh faMesh reference.

Definition at line 62 of file edgeFaMesh.H.

◆ edgeMesh() [2/8]

edgeMesh ( )
inline

Default construct.

Definition at line 45 of file edgeMeshI.H.

Referenced by extendedEdgeMesh::sortPointsAndEdges().

Here is the caller graph for this function:

◆ edgeMesh() [3/8]

edgeMesh ( const edgeMesh em)
inline

Copy construct.

Definition at line 54 of file edgeMeshI.H.

◆ edgeMesh() [4/8]

edgeMesh ( edgeMesh &&  em)
inline

Move construct.

Definition at line 63 of file edgeMeshI.H.

References edgeMesh::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 71 of file edgeMeshI.H.

◆ edgeMesh() [6/8]

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

Move construct from components.

Definition at line 84 of file edgeMeshI.H.

◆ edgeMesh() [7/8]

edgeMesh ( const fileName name)
explicit

Construct from file name (uses extension to determine type)

Definition at line 49 of file edgeMeshIO.C.

References Foam::name(), and edgeMesh::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 35 of file edgeMeshIO.C.

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

Here is the call graph for this function:

◆ ~edgeMesh()

virtual ~edgeMesh ( )
virtualdefault

Destructor.

Member Function Documentation

◆ size() [1/2]

static label size ( const Mesh mesh)
inlinestatic

Return size. Number of internal edges.

Definition at line 70 of file edgeFaMesh.H.

References mesh, and primitiveMesh::nInternalEdges().

Here is the call graph for this function:

◆ size() [2/2]

label size ( ) const
inline

Return size. Number of internal edges.

Definition at line 76 of file edgeFaMesh.H.

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

Referenced by edgeMesh::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 82 of file edgeFaMesh.H.

References faMesh::edgeCentres(), and GeoMesh< faMesh >::mesh_.

Here is the call graph for this function:

◆ storedPoints()

Foam::pointField & storedPoints ( )
inlineprotectednoexcept

Non-const access to global points.

Definition at line 31 of file edgeMeshI.H.

Referenced by extendedEdgeMesh::extendedEdgeMesh().

Here is the caller graph for this function:

◆ storedEdges()

Foam::edgeList & storedEdges ( )
inlineprotectednoexcept

Non-const access to the edges.

Definition at line 37 of file edgeMeshI.H.

Referenced by extendedEdgeMesh::extendedEdgeMesh().

Here is the caller graph for this function:

◆ TypeName()

TypeName ( "edgeMesh"  )

Runtime type information.

◆ readTypes()

Foam::wordHashSet readTypes ( )
static

Summary of supported read file types.

Definition at line 49 of file edgeMesh.C.

◆ writeTypes()

Foam::wordHashSet writeTypes ( )
static

Summary of supported write file types.

Definition at line 55 of file edgeMesh.C.

◆ canReadType()

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

Can we read this file format?

Definition at line 61 of file edgeMesh.C.

◆ canWriteType()

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

Can we write this file format type?

Definition at line 73 of file edgeMesh.C.

◆ canRead()

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

Can we read this file format?

Definition at line 85 of file edgeMesh.C.

References word::ext(), word::lessExt(), and Foam::name().

Here is the call graph for this function:

◆ declareRunTimeSelectionTable()

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

◆ 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 33 of file edgeMeshNew.C.

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

Here is the call 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 55 of file edgeMeshNew.C.

References word::ext(), word::lessExt(), 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 113 of file edgeMeshIO.C.

References word::ext(), mesh, Foam::name(), and write().

Here is the call 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 86 of file edgeMeshIO.C.

References DebugInFunction, 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 124 of file edgeMesh.C.

References mesh.

Referenced by edgeMesh::edgeMesh().

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 74 of file edgeMeshIO.C.

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

Referenced by edgeMesh::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 extendedEdgeMeshFormat, extendedFeatureEdgeMeshFormat, NASedgeFormat, edgeMeshFormat, OBJedgeFormat, STARCDedgeFormat, VTKedgeFormat, and extendedEdgeMesh.

Definition at line 61 of file edgeMeshIO.C.

References fileName::ext(), word::ext(), word::lessExt(), Foam::name(), and Foam::read().

Here is the call graph for this function:

◆ points()

const Foam::pointField & points ( ) const
inlinenoexcept

◆ edges()

const Foam::edgeList & edges ( ) const
inlinenoexcept

◆ pointEdges()

const Foam::labelListList & pointEdges ( ) const
inline

Return edges.

Definition at line 111 of file edgeMeshI.H.

Referenced by extendedEdgeMesh::sortPointsAndEdges().

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 137 of file edgeMesh.C.

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

Here is the call graph for this function:

◆ clear()

void clear ( )
virtual

Clear all storage.

Reimplemented in extendedEdgeMesh.

Definition at line 116 of file edgeMesh.C.

Referenced by extendedEdgeMesh::clear().

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 203 of file edgeMesh.C.

References Foam::equal().

Here is the call 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 213 of file edgeMesh.C.

References e, and Foam::inplaceMergePoints().

Here is the call graph for this function:

◆ mergeEdges()

void mergeEdges ( )
virtual

Merge duplicate edges and eliminate unused points.

Definition at line 240 of file edgeMesh.C.

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

Here is the call graph for this function:

◆ writeStats()

void writeStats ( Ostream os) const
virtual

Reimplemented in extendedEdgeMesh.

Definition at line 125 of file edgeMeshIO.C.

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

Referenced by 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 270 of file edgeMesh.H.

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

Definition at line 282 of file edgeMesh.H.

◆ operator=() [1/2]

void operator= ( const edgeMesh rhs)
inline

Copy assignment.

Definition at line 123 of file edgeMeshI.H.

Referenced by extendedEdgeMesh::sortPointsAndEdges().

Here is the caller graph for this function:

◆ operator=() [2/2]

void operator= ( edgeMesh &&  rhs)
inline

Move assignment.

Definition at line 131 of file edgeMeshI.H.

Friends And Related Function Documentation

◆ operator<<

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

◆ operator>>

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

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