Loading...
Searching...
No Matches
ensightFaces Class Reference

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

#include <ensightFaces.H>

Inheritance diagram for ensightFaces:
Collaboration diagram for ensightFaces:

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

Static Public Member Functions

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

Static Public Attributes

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

Additional Inherited Members

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

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
ensightFaces()
Default construct, with part index 0.

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 66 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 79 of file ensightFaces.H.

Constructor & Destructor Documentation

◆ ensightFaces() [1/2]

ensightFaces ( )

Default construct, with part index 0.

Definition at line 96 of file ensightFaces.C.

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

Referenced by ensightFaces(), ensightOutputSurface::ensightOutputSurface(), info(), uniqueMeshPoints(), and write().

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

◆ ensightFaces() [2/2]

ensightFaces ( const string & description)
explicit

Default construct, with description/partName.

Definition at line 106 of file ensightFaces.C.

References ensightFaces(), and ensightPart::rename().

Here is the call graph for this function:

◆ ~ensightFaces()

virtual ~ensightFaces ( )
virtualdefault

Destructor.

References Foam::noexcept, and ensightPart::size().

Here is the call graph for this function:

Member Function Documentation

◆ key()

const char * key ( const elemType etype)
inlinestaticnoexcept

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

Definition at line 42 of file ensightFacesI.H.

References elemNames.

Referenced by writeDict(), Foam::ensightOutput::writeFaceConnectivity(), and Foam::ensightOutput::writeFaceConnectivity().

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 60 of file ensightFacesI.H.

Referenced by reduce(), sizes(), sort(), usesFlipMap(), and writeDict().

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 66 of file ensightFacesI.H.

Referenced by classify(), and Foam::ensightOutput::writeFaceConnectivityPresorted().

Here is the caller graph for this function:

◆ totalSize()

Foam::label totalSize ( ) const
noexcept

The global size of all element types.

This value is only meaningful after a reduce operation.

Definition at line 129 of file ensightFaces.C.

References n, and Foam::noexcept.

Referenced by total().

Here is the caller graph for this function:

◆ total() [1/2]

label total ( ) const
inlinenoexcept

Same as totalSize.

Definition at line 203 of file ensightFaces.H.

References Foam::noexcept, total(), and totalSize().

Referenced by ensightMesh::correct(), total(), ensightOutputSurface::write(), Foam::ensightOutput::writeFaceConnectivity(), and Foam::ensightOutput::writeFaceConnectivityPresorted().

Here is the call graph for this function:
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 54 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 48 of file ensightFacesI.H.

◆ sizes()

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

Processor-local sizes per element type.

Definition at line 116 of file ensightFaces.C.

References nTypes, and size().

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 72 of file ensightFacesI.H.

References ensightPart::addressing(), and Foam::noexcept.

Referenced by uniqueMeshPoints(), write(), writeDict(), and Foam::ensightOutput::writeFaceConnectivity().

Here is the call graph for this function:
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 79 of file ensightFacesI.H.

References ensightPart::addressing(), and range.

Here is the call graph for this function:

◆ flipMap()

const Foam::boolList & flipMap ( ) const
inline

Processor-local flip-map of all elements.

Definition at line 85 of file ensightFacesI.H.

Referenced by classify(), and 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 91 of file ensightFacesI.H.

References size().

Referenced by write().

Here is the call graph for this function:
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 98 of file ensightFacesI.H.

References Foam::noexcept.

Referenced by sort().

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 105 of file ensightFacesI.H.

References range, and UList< T >::slice().

Here is the call graph for this function:

◆ classify() [1/3]

void classify ( const UList< face > & faces)

Classify the face types and set the element lists.

Definition at line 211 of file ensightFaces.C.

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

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

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 239 of file ensightFaces.C.

References classify(), ensightPart::incrAddressing(), 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 255 of file ensightFaces.C.

References Foam::add(), ensightPart::addressing(), faceId(), flipMap(), 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 153 of file ensightFaces.C.

Referenced by clear().

Here is the caller graph for this function:

◆ clear()

void clear ( )

Set addressable sizes to zero, free up addressing memory.

Definition at line 140 of file ensightFaces.C.

References ensightPart::clear(), clearOut(), 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 157 of file ensightFaces.C.

References nTypes, Foam::reduce(), and size().

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 167 of file ensightFaces.C.

References ensightPart::addressing(), IntRange< IntType >::empty(), faceOrder(), IndirectListBase< T, Addr >::list(), nTypes, range, size(), 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 111 of file ensightFacesI.H.

References ensightPart::incrAddressing().

Here is the call graph for this function:

◆ 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 117 of file ensightFacesI.H.

References ensightPart::decrAddressing().

Here is the call graph for this function:

◆ info()

InfoProxy< ensightFaces > info ( ) const
inlinenoexcept

Return info proxy, used to print information to a stream.

Definition at line 330 of file ensightFaces.H.

References ensightFaces(), info(), and Foam::noexcept.

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

Here is the call graph for this function:
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 31 of file ensightFacesAddr.C.

References ensightFaces(), faceIds(), mesh, nPoints, UPstream::parRun(), points, and pp().

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

References Foam::endEntry(), faceIds(), ensightPart::index(), key(), name, nTypes, os(), size(), and Foam::type().

Here is the call graph for this function:

◆ write()

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

Write geometry, using a mesh reference No beginGeometry() marker.

< Collective write?

< Collective write?

Reimplemented in ensightOutputSurface.

Definition at line 31 of file ensightFacesIO.C.

References ensightFaces(), f(), faceIds(), flipMap(), forAll, Foam::identity(), ensightPart::index(), Foam::ListListOps::inplaceRenumber(), mesh, ensightPart::name(), nPoints, os(), UPstream::parRun(), points, pp(), List< T >::resize_nocopy(), usesFlipMap(), Foam::ensightOutput::Detail::writeCoordinates(), and Foam::ensightOutput::writeFaceConnectivityPresorted().

Here is the call graph for this function:

◆ size() [2/2]

label size ( ) const
inlinenoexcept

Processor-local size of all elements.

Definition at line 193 of file ensightPart.H.

Member Data Documentation

◆ nTypes

int nTypes = 3
staticconstexpr

◆ elemNames

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

The ensight 'Face' element type names.

Definition at line 32 of file ensightFaces.H.

Referenced by key(), Foam::operator<<(), and ensightSurfaceReader::readGeometry().


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