ensightFaces Class Reference

Sorting/classification of faces (2D) into corresponding ensight types. More...

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

Public Types

enum  elemType { TRIA3 = 0, QUAD4, NSIDED }
 Supported ensight 'Face' element types. More...
 

Public Member Functions

 TypeName ("ensightFaces")
 Declare type-name, virtual type (with debug switch) More...
 
 ensightFaces ()
 Default construct, with part index 0. More...
 
 ensightFaces (const string &description)
 Default construct, with description/partName. More...
 
virtual ~ensightFaces ()=default
 Destructor. More...
 
label size (const elemType etype) const
 Processor-local size of the specified element type. More...
 
labelRange range (const elemType etype) const
 Processor-local offset/size of element type. More...
 
label total () const
 The global size of all element types. More...
 
label total (const elemType etype) const
 The global size of the specified element type. More...
 
const FixedList< label, nTypes > & totals () const
 The global sizes for each element type. More...
 
FixedList< label, nTypessizes () const
 Processor-local sizes per element type. More...
 
const labelListfaceIds () const noexcept
 Processor-local face ids of all elements. More...
 
const labelUList faceIds (const elemType etype) const
 Processor-local face ids of the specified element type. More...
 
const boolListflipMap () const
 Processor-local flip-map of all elements. More...
 
bool usesFlipMap () const
 True for non-zero flip-map that spans the addresses. More...
 
const labelListfaceOrder () const noexcept
 
const labelUList faceOrder (const elemType etype) const
 
void classify (const UList< face > &faces)
 Classify the face types and set the element lists. More...
 
void classify (const UList< face > &faces, const labelRange &range)
 Classify face types (for a sublist) and set element lists. More...
 
void classify (const UList< face > &faces, const labelUList &addr, const boolList &flipMap=boolList(), const bitSet &exclude=bitSet())
 Classify the face types and set the element lists. More...
 
void clearOut ()
 Clear any demand-driven data. More...
 
void clear ()
 Set addressable sizes to zero, free up addressing memory. More...
 
void reduce ()
 Sum element counts across all processes. More...
 
void sort ()
 Inplace sort element lists numerically. More...
 
void incrFaceIds (const label off)
 Increase face ids by specified offset value. More...
 
void decrFaceIds (const label off)
 Decrease face ids by specified offset value. More...
 
label uniqueMeshPoints (const polyMesh &mesh, labelList &uniqueMeshPointLabels, bool parallel) const
 
virtual void writeDict (Ostream &os, const bool full=false) const
 
virtual void write (ensightGeoFile &os, const polyMesh &mesh, bool parallel) const
 Write geometry, using a mesh reference. More...
 
label size () const noexcept
 Processor-local size of all elements. More...
 
- Public Member Functions inherited from ensightPart
 TypeNameNoDebug ("ensightPart")
 Declare type-name, virtual type (without debug switch) More...
 
 ensightPart ()
 Default construct. Index=0, identifier = -1. More...
 
 ensightPart (const string &description)
 Default construct, with description/partName. More...
 
virtual ~ensightPart ()=default
 Destructor. More...
 
label index () const noexcept
 The index in a list (0-based) More...
 
label & index () noexcept
 The index in a list (0-based) More...
 
label identifier () const noexcept
 OpenFOAM identifier (patch, zone, etc), -1 when not in use. More...
 
label & identifier () noexcept
 OpenFOAM identifier (patch, zone, etc), -1 when not in use. More...
 
bool empty () const noexcept
 Processor-local test for any elements. More...
 
label size () const noexcept
 Processor-local size of all elements. More...
 
const stringname () const noexcept
 The part name or description. More...
 
void rename (const string &value)
 Change the part name or description. More...
 
void rename (string &&value)
 Change the part name or description. More...
 
label operator[] (const label i) const
 Processor-local element id from linear-list of addresses. More...
 

Static Public Member Functions

static const char * key (const elemType etype)
 The ensight element name for the specified 'Face' type. More...
 

Static Public Attributes

static constexpr int nTypes = 3
 Number of 'Face' element types (3) More...
 
static const char * elemNames [nTypes]
 The ensight 'Face' element type names. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ensightPart
const labelListaddressing () const noexcept
 Element addressing. More...
 
labelListaddressing () noexcept
 Element addressing. More...
 
void clear ()
 Clear element addressing. More...
 
void incrAddressing (const label off)
 Increase addressing by specified offset value. More...
 
void decrAddressing (const label off)
 Decrease addressing by specified offset value. More...
 

Detailed Description

Sorting/classification of faces (2D) into corresponding ensight types.

Some caution may be required when handling face addressing into a boundaryField. Since the face addressing is absolute, it will be necessary to work on a copy with local ids. For example,

// Operate on a copy
ensightFaces localPart(part);
// Change from global faceIds to patch-local faceIds
localPart.decrFaceIds(patchStart);
// Can now address into boundaryField

Additionally, for some uses (eg, finiteArea), the ordered list of faces can be used for a direct local lookup into the field instead of via the overall mesh face addressing.

Definition at line 71 of file ensightFaces.H.

Member Enumeration Documentation

◆ elemType

enum elemType

Supported ensight 'Face' element types.

Must be zero-based since they are also for internal bookkeeping.

Enumerator
TRIA3 

"tria3"

QUAD4 

"quad4"

NSIDED 

"nsided"

Definition at line 81 of file ensightFaces.H.

Constructor & Destructor Documentation

◆ ensightFaces() [1/2]

Default construct, with part index 0.

Definition at line 103 of file ensightFaces.C.

◆ ensightFaces() [2/2]

ensightFaces ( const string description)
explicit

Default construct, with description/partName.

Definition at line 113 of file ensightFaces.C.

References ensightPart::rename().

Here is the call graph for this function:

◆ ~ensightFaces()

virtual ~ensightFaces ( )
virtualdefault

Destructor.

Member Function Documentation

◆ key()

const char * key ( const elemType  etype)
inlinestatic

The ensight element name for the specified 'Face' type.

Definition at line 49 of file ensightFacesI.H.

Referenced by ensightFaces::writeDict().

Here is the caller graph for this function:

◆ TypeName()

TypeName ( "ensightFaces"  )

Declare type-name, virtual type (with debug switch)

◆ size() [1/2]

Foam::label size ( const elemType  etype) const
inline

Processor-local size of the specified element type.

Definition at line 67 of file ensightFacesI.H.

Referenced by Foam::ensightOutput::Detail::writeFaceLocalField(), Foam::ensightOutput::Detail::writeFaceSubField(), Foam::ensightOutput::writeField(), and Foam::ensightOutput::writeVolField().

Here is the caller graph for this function:

◆ range()

Foam::labelRange range ( const elemType  etype) const
inline

Processor-local offset/size of element type.

Definition at line 73 of file ensightFacesI.H.

Referenced by Foam::ensightOutput::writeFaceConnectivityPresorted(), and Foam::ensightOutput::Detail::writeFaceSubField().

Here is the caller graph for this function:

◆ total() [1/2]

Foam::label total ( ) const

The global size of all element types.

This value is only meaningful after a reduce operation.

Definition at line 136 of file ensightFaces.C.

References forAll.

Referenced by ensightMesh::correct(), ensightOutputSurface::write(), Foam::ensightOutput::writeFaceConnectivity(), Foam::ensightOutput::writeFaceConnectivityPresorted(), Foam::ensightOutput::Detail::writeFaceLocalField(), Foam::ensightOutput::Detail::writeFaceSubField(), and Foam::ensightOutput::writeField().

Here is the caller graph for this function:

◆ total() [2/2]

Foam::label total ( const elemType  etype) const
inline

The global size of the specified element type.

This value is only meaningful after a reduce operation.

Definition at line 61 of file ensightFacesI.H.

◆ totals()

const Foam::FixedList< Foam::label, 3 > & totals ( ) const
inline

The global sizes for each element type.

This value is only meaningful after a reduce operation.

Definition at line 55 of file ensightFacesI.H.

◆ sizes()

Foam::FixedList< Foam::label, 3 > sizes ( ) const

Processor-local sizes per element type.

Definition at line 123 of file ensightFaces.C.

References Foam::BitOps::count(), and forAll.

Here is the call graph for this function:

◆ faceIds() [1/2]

const Foam::labelList & faceIds ( ) const
inlinenoexcept

Processor-local face ids of all elements.

Definition at line 79 of file ensightFacesI.H.

Referenced by ensightFaces::uniqueMeshPoints(), ensightFaces::write(), Foam::ensightOutput::writeFaceConnectivity(), Foam::ensightOutput::writeField(), and Foam::ensightOutput::writeVolField().

Here is the caller graph for this function:

◆ faceIds() [2/2]

const Foam::labelUList faceIds ( const elemType  etype) const
inline

Processor-local face ids of the specified element type.

Definition at line 86 of file ensightFacesI.H.

References range.

◆ flipMap()

const Foam::boolList & flipMap ( ) const
inline

Processor-local flip-map of all elements.

Definition at line 92 of file ensightFacesI.H.

Referenced by ensightFaces::write().

Here is the caller graph for this function:

◆ usesFlipMap()

bool usesFlipMap ( ) const
inline

True for non-zero flip-map that spans the addresses.

Definition at line 98 of file ensightFacesI.H.

Referenced by ensightFaces::write().

Here is the caller graph for this function:

◆ faceOrder() [1/2]

const Foam::labelList & faceOrder ( ) const
inlinenoexcept

Processor-local face order (where applicable)

Definition at line 105 of file ensightFacesI.H.

Referenced by Foam::ensightOutput::Detail::writeFaceLocalField().

Here is the caller graph for this function:

◆ faceOrder() [2/2]

const Foam::labelUList faceOrder ( const elemType  etype) const
inline

Processor-local face order of specified element type (where applicable)

Definition at line 112 of file ensightFacesI.H.

References range.

◆ classify() [1/3]

void classify ( const UList< face > &  faces)

Classify the face types and set the element lists.

Definition at line 219 of file ensightFaces.C.

References Foam::add(), UList< T >::size(), and Foam::Zero.

Referenced by ensightFaMesh::correct(), and ensightMesh::correct().

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

◆ classify() [2/3]

void classify ( const UList< face > &  faces,
const labelRange range 
)

Classify face types (for a sublist) and set element lists.

Definition at line 248 of file ensightFaces.C.

References range, UList< T >::size(), and IntRange< IntType >::start().

Here is the call graph for this function:

◆ classify() [3/3]

void classify ( const UList< face > &  faces,
const labelUList addr,
const boolList flipMap = boolList(),
const bitSet exclude = bitSet() 
)

Classify the face types and set the element lists.

The indirect addressing can be used when classifying groups of face (eg, from a faceZone etc) with an optional flipMap. The optional exclude marker can be used to skip faces on particular boundary types or regions.

Definition at line 264 of file ensightFaces.C.

References Foam::add(), faceId(), UList< T >::size(), bitSet::test(), and Foam::Zero.

Here is the call graph for this function:

◆ clearOut()

void clearOut ( )

Clear any demand-driven data.

Definition at line 160 of file ensightFaces.C.

◆ clear()

void clear ( )

Set addressable sizes to zero, free up addressing memory.

Definition at line 147 of file ensightFaces.C.

References ensightPart::clear(), and Foam::Zero.

Referenced by ensightFaMesh::correct(), and ensightMesh::correct().

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

◆ reduce()

void reduce ( )

Sum element counts across all processes.

Definition at line 164 of file ensightFaces.C.

References forAll, and Foam::reduce().

Referenced by ensightFaMesh::correct(), and ensightMesh::correct().

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

◆ sort()

void sort ( )

Inplace sort element lists numerically.

Definition at line 175 of file ensightFaces.C.

References IntRange< IntType >::empty(), range, and Foam::sortedOrder().

Here is the call graph for this function:

◆ incrFaceIds()

void incrFaceIds ( const label  off)
inline

Increase face ids by specified offset value.

Eg, to change patch local Ids to global Ids

Definition at line 118 of file ensightFacesI.H.

◆ decrFaceIds()

void decrFaceIds ( const label  off)
inline

Decrease face ids by specified offset value.

Eg, to change global Ids to patch local Ids

Definition at line 124 of file ensightFacesI.H.

Referenced by Foam::ensightOutput::writeVolField().

Here is the caller graph for this function:

◆ uniqueMeshPoints()

Foam::label uniqueMeshPoints ( const polyMesh mesh,
labelList uniqueMeshPointLabels,
bool  parallel 
) const

Globally unique mesh points. Required when writing point fields.

Definition at line 39 of file ensightFacesAddr.C.

References ensightFaces::faceIds(), mesh, PrimitivePatch< FaceList, PointField >::meshPointMap(), PrimitivePatch< FaceList, PointField >::meshPoints(), nPoints, and points.

Referenced by Foam::ensightOutput::writePointField().

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

◆ writeDict()

void writeDict ( Ostream os,
const bool  full = false 
) const
virtual

Write information about the object as a dictionary, optionally write all element addresses

Reimplemented from ensightPart.

Definition at line 325 of file ensightFaces.C.

References Ostream::beginBlock(), Ostream::endBlock(), Foam::endEntry(), ensightFaces::key(), Foam::name(), ensightFaces::nTypes, os(), Foam::type(), Ostream::writeEntry(), and Ostream::writeKeyword().

Here is the call graph for this function:

◆ write()

void write ( ensightGeoFile os,
const polyMesh mesh,
bool  parallel 
) const
virtual

◆ size() [2/2]

label size
inlinenoexcept

Processor-local size of all elements.

Definition at line 154 of file ensightPart.H.

Member Data Documentation

◆ nTypes

constexpr int nTypes = 3
staticconstexpr

Number of 'Face' element types (3)

Definition at line 89 of file ensightFaces.H.

Referenced by ensightFaces::writeDict().

◆ elemNames

const char * elemNames
static
Initial value:
=
{
"tria3", "quad4", "nsided"
}

The ensight 'Face' element type names.

Definition at line 92 of file ensightFaces.H.


The documentation for this class was generated from the following files:
Foam::ensightFaces::ensightFaces
ensightFaces()
Default construct, with part index 0.
Definition: ensightFaces.C:103