ensightCells Class Reference

Sorting/classification of cells (3D) into corresponding ensight element types. More...

Inheritance diagram for ensightCells:
[legend]

Public Types

enum  elemType {
  TETRA4, PYRAMID5, PENTA6, HEXA8,
  NFACED
}
 Addressable ensight element types. More...
 

Public Member Functions

 ensightCells ()
 Construct null, with part index 0. More...
 
 ensightCells (const label partIndex)
 Construct null, with specified part index. More...
 
 ensightCells (const ensightCells &obj)
 Copy constructor. Needed for lists etc. More...
 
 ~ensightCells ()=default
 Destructor. More...
 
label index () const
 The index in a list. More...
 
labelindex ()
 The index in a list, non-const access. More...
 
label size () const
 The processor local size of all elements. More...
 
label size (const enum elemType) const
 The processor local size of the specified element type. More...
 
label total (const enum elemType) const
 The global number of the specified element type. More...
 
label total () const
 The global number of all element types. More...
 
const FixedList< label, 5 > & totals () const
 The global numbers per element type. More...
 
FixedList< label, 5 > sizes () const
 The processor local sizes per element type. More...
 
label offset (const enum elemType what) const
 Processor local starting offset of element type. More...
 
const labelUList cellIds (const enum elemType) const
 Return the (local) cell ids of the specified element type. More...
 
const labelUListcellIds () const
 Return the cell ids of all elements. More...
 
void classify (const polyMesh &mesh)
 Classify cell types and set the element lists. More...
 
void classify (const polyMesh &mesh, const labelUList &cellIds)
 
void classify (const polyMesh &mesh, const bitSet &selection)
 
void clear ()
 Set addressable sizes to zero, free up addressing memory. More...
 
void reduce ()
 Sum element counts across all processes. More...
 
void sort ()
 Sort element lists numerically. More...
 
label operator[] (const label i) const
 Return id from linear list of addressing. More...
 

Static Public Member Functions

static const char * key (const enum elemType)
 Return the ensight element name for the specified type. More...
 

Static Public Attributes

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

Detailed Description

Sorting/classification of cells (3D) into corresponding ensight element types.

Definition at line 53 of file ensightCells.H.

Member Enumeration Documentation

◆ elemType

enum elemType

Addressable ensight element types.

Enumerator
TETRA4 

"tetra4"

PYRAMID5 

"pyramid5"

PENTA6 

"penta6"

HEXA8 

"hexa8"

NFACED 

"nfaced"

Definition at line 60 of file ensightCells.H.

Constructor & Destructor Documentation

◆ ensightCells() [1/3]

Construct null, with part index 0.

Definition at line 66 of file ensightCells.C.

◆ ensightCells() [2/3]

ensightCells ( const label  partIndex)
explicit

Construct null, with specified part index.

Definition at line 72 of file ensightCells.C.

◆ ensightCells() [3/3]

ensightCells ( const ensightCells obj)

Copy constructor. Needed for lists etc.

Definition at line 83 of file ensightCells.C.

References ensightCells::sizes().

Here is the call graph for this function:

◆ ~ensightCells()

~ensightCells ( )
default

Destructor.

Member Function Documentation

◆ key()

const char * key ( const enum elemType  what)
inlinestatic

Return the ensight element name for the specified type.

Definition at line 32 of file ensightCellsI.H.

References ensightCells::elemNames.

Referenced by ensightPartCells::dumpInfo(), and ensightPartCells::write().

Here is the caller graph for this function:

◆ index() [1/2]

Foam::label index ( ) const
inline

The index in a list.

Definition at line 38 of file ensightCellsI.H.

Referenced by ensightPartCells::index(), and Foam::ensightOutput::Detail::writeCellField().

Here is the caller graph for this function:

◆ index() [2/2]

Foam::label & index ( )
inline

The index in a list, non-const access.

Definition at line 44 of file ensightCellsI.H.

◆ size() [1/2]

Foam::label size ( ) const
inline

The processor local size of all elements.

Definition at line 50 of file ensightCellsI.H.

Referenced by ensightPartCells::size(), and Foam::ensightOutput::Detail::writeCellField().

Here is the caller graph for this function:

◆ size() [2/2]

Foam::label size ( const enum elemType  what) const
inline

The processor local size of the specified element type.

Definition at line 68 of file ensightCellsI.H.

◆ total() [1/2]

Foam::label total ( const enum elemType  what) const
inline

The global number of the specified element type.

This value is only meaningful after a reduce operation.

Definition at line 62 of file ensightCellsI.H.

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

Here is the caller graph for this function:

◆ total() [2/2]

Foam::label total ( ) const

The global number of all element types.

This value is only meaningful after a reduce operation.

Definition at line 117 of file ensightCells.C.

References forAll, and n.

◆ totals()

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

The global numbers per element type.

This value is only meaningful after a reduce operation.

Definition at line 56 of file ensightCellsI.H.

◆ sizes()

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

The processor local sizes per element type.

Definition at line 105 of file ensightCells.C.

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

Referenced by ensightCells::ensightCells().

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

◆ offset()

Foam::label offset ( const enum elemType  what) const
inline

Processor local starting offset of element type.

Definition at line 74 of file ensightCellsI.H.

◆ cellIds() [1/2]

const Foam::labelUList cellIds ( const enum elemType  what) const
inline

Return the (local) cell ids of the specified element type.

Definition at line 81 of file ensightCellsI.H.

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

Here is the caller graph for this function:

◆ cellIds() [2/2]

const Foam::labelUList & cellIds ( ) const
inline

Return the cell ids of all elements.

Definition at line 89 of file ensightCellsI.H.

◆ classify() [1/3]

void classify ( const polyMesh mesh)

Classify cell types and set the element lists.

Definition at line 238 of file ensightCells.C.

References labelRange::identity(), mesh, and primitiveMesh::nCells().

Here is the call graph for this function:

◆ classify() [2/3]

void classify ( const polyMesh mesh,
const labelUList cellIds 
)

Classify cell types and set element lists, using a subgroup of cells (eg, from a cellZone etc).

Definition at line 246 of file ensightCells.C.

References mesh.

◆ classify() [3/3]

void classify ( const polyMesh mesh,
const bitSet selection 
)

Classify cell types and set element lists, using a subgroup of cells

Definition at line 256 of file ensightCells.C.

References mesh.

◆ clear()

void clear ( )

Set addressable sizes to zero, free up addressing memory.

Definition at line 128 of file ensightCells.C.

References Foam::Zero.

◆ reduce()

void reduce ( )

Sum element counts across all processes.

Definition at line 135 of file ensightCells.C.

References forAll, and Foam::reduce().

Here is the call graph for this function:

◆ sort()

void sort ( )

Sort element lists numerically.

Definition at line 146 of file ensightCells.C.

References forAll, and Foam::sort().

Here is the call graph for this function:

◆ operator[]()

Foam::label operator[] ( const label  i) const
inline

Return id from linear list of addressing.

Definition at line 95 of file ensightCellsI.H.

Member Data Documentation

◆ nTypes

constexpr int nTypes = 5
staticconstexpr

Number of element types (5)

Definition at line 70 of file ensightCells.H.

Referenced by ensightPartCells::dumpInfo(), and ensightPartCells::write().

◆ elemNames

const char * elemNames
static
Initial value:
=
{ "tetra4", "pyramid5", "penta6", "hexa8", "nfaced" }

The ensight element type names.

Definition at line 73 of file ensightCells.H.

Referenced by ensightCells::key().


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