ensightCells Class Reference

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

Inheritance diagram for ensightCells:
Collaboration diagram for ensightCells:

Public Types

enum  elemType {
  TETRA4 = 0, PYRAMID5, PENTA6, HEXA8,
  NFACED
}
 Supported ensight 'Cell' element types. More...
 

Public Member Functions

 TypeName ("ensightCells")
 Declare type-name, virtual type (with debug switch) More...
 
 ensightCells ()
 Default construct, with part index 0. More...
 
 ensightCells (const string &description)
 Default construct, with description/partName. More...
 
virtual ~ensightCells ()=default
 Destructor. More...
 
bool manifold () const noexcept
 Manifold mesh cells detected? Globally consistent quantity. 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 totalSize () const noexcept
 The global size of all element types. More...
 
label total () const noexcept
 Same as totalSize() 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 labelListcellIds () const
 Processor-local cell ids of all elements. More...
 
const labelUList cellIds (const elemType etype) const
 Processor-local cell ids of the specified element type. More...
 
Map< label > meshPointMap (const polyMesh &mesh) const
 Mesh point map. More...
 
void classify (const polyMesh &mesh)
 Classify cell types and set the element lists. More...
 
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). More...
 
void classify (const polyMesh &mesh, const bitSet &selection)
 Classify cell types and set element lists, using a subgroup of cells. 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 ()
 Sort element lists numerically. More...
 
void incrCellIds (const label off)
 Increase cell ids by specified offset value. More...
 
void decrCellIds (const label off)
 Decrease face ids by specified offset value. More...
 
InfoProxy< ensightCellsinfo () const noexcept
 Return info proxy, used to print information to a stream. More...
 
label uniqueMeshPoints (const polyMesh &mesh, labelList &uniqueMeshPointLabels, bool parallel) const
 Globally unique mesh points. Required when writing point fields. More...
 
virtual void writeDict (Ostream &os, const bool full=false) const
 Write information about the object as a dictionary, optionally write all element addresses. More...
 
virtual void write (ensightGeoFile &os, const polyMesh &mesh, bool parallel) const
 Write geometry, using a mesh reference (serial only) 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) noexcept
 The ensight element name for the specified 'Cell' type. More...
 

Static Public Attributes

static constexpr int nTypes = 5
 Number of 'Cell' element types (5) More...
 
static const char * elemNames [nTypes]
 The ensight 'Cell' 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 cells (3D) into corresponding ensight element types.

Definition at line 49 of file ensightCells.H.

Member Enumeration Documentation

◆ elemType

enum elemType

Supported ensight 'Cell' element types.

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

Enumerator
TETRA4 

"tetra4"

PYRAMID5 

"pyramid5"

PENTA6 

"penta6"

HEXA8 

"hexa8"

NFACED 

"nfaced"

Definition at line 62 of file ensightCells.H.

Constructor & Destructor Documentation

◆ ensightCells() [1/2]

Default construct, with part index 0.

Definition at line 72 of file ensightCells.C.

◆ ensightCells() [2/2]

ensightCells ( const string description)
explicit

Default construct, with description/partName.

Definition at line 81 of file ensightCells.C.

References ensightPart::rename().

Here is the call graph for this function:

◆ ~ensightCells()

virtual ~ensightCells ( )
virtualdefault

Destructor.

Member Function Documentation

◆ key()

const char * key ( const elemType  etype)
inlinestaticnoexcept

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

Definition at line 42 of file ensightCellsI.H.

Referenced by ensightCells::writeDict().

Here is the caller graph for this function:

◆ TypeName()

TypeName ( "ensightCells"  )

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

◆ manifold()

bool manifold ( ) const
inlinenoexcept

Manifold mesh cells detected? Globally consistent quantity.

Definition at line 36 of file ensightCellsI.H.

◆ 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 ensightCellsI.H.

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

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

◆ 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 104 of file ensightCells.C.

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

Referenced by ensightCells::total().

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

◆ total() [1/2]

label total ( ) const
inlinenoexcept

Same as totalSize()

Definition at line 231 of file ensightCells.H.

References ensightCells::totalSize().

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

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

◆ totals()

const Foam::FixedList< Foam::label, 5 > & 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 ensightCellsI.H.

◆ sizes()

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

Processor-local sizes per element type.

Definition at line 91 of file ensightCells.C.

References Foam::BitOps::count().

Here is the call graph for this function:

◆ cellIds() [1/2]

const Foam::labelList & cellIds ( ) const
inline

Processor-local cell ids of all elements.

Definition at line 72 of file ensightCellsI.H.

Referenced by ensightCells::meshPointMap(), and Foam::ensightOutput::writeField().

Here is the caller graph for this function:

◆ cellIds() [2/2]

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

Processor-local cell ids of the specified element type.

Definition at line 79 of file ensightCellsI.H.

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

Here is the call graph for this function:

◆ meshPointMap()

Foam::Map< Foam::label > meshPointMap ( const polyMesh mesh) const

Mesh point map.

Map mesh point index to local (compact) point index

const cellList& meshCells = mesh.cells();

Definition at line 31 of file ensightCellsAddr.C.

References ensightCells::cellIds(), manifoldCellsMeshObject::cells(), HashTable< T, Key, Hash >::insert(), mesh, MeshObject< polyMesh, UpdateableMeshObject, manifoldCellsMeshObject >::New(), nPoints, ensightPart::size(), and HashTable< T, Key, Hash >::sortedToc().

Here is the call graph for this function:

◆ classify() [1/3]

void classify ( const polyMesh mesh)

Classify cell types and set the element lists.

Definition at line 235 of file ensightCells.C.

References mesh, and primitiveMesh::nCells().

Referenced by ensightMesh::correct().

Here is the call graph for this function:
Here is the caller 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 243 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 253 of file ensightCells.C.

References mesh.

◆ clearOut()

void clearOut ( )

Clear any demand-driven data.

Definition at line 127 of file ensightCells.C.

◆ clear()

void clear ( )

Set addressable sizes to zero, free up addressing memory.

Definition at line 115 of file ensightCells.C.

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

Referenced by 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 131 of file ensightCells.C.

References Foam::reduce().

Referenced by ensightMesh::correct().

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

◆ sort()

void sort ( )

Sort element lists numerically.

Definition at line 141 of file ensightCells.C.

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

Here is the call graph for this function:

◆ incrCellIds()

void incrCellIds ( const label  off)
inline

Increase cell ids by specified offset value.

Eg, to change zone local Ids to global Ids

Definition at line 85 of file ensightCellsI.H.

◆ decrCellIds()

void decrCellIds ( const label  off)
inline

Decrease face ids by specified offset value.

Eg, to change global Ids to zone local Ids

Definition at line 91 of file ensightCellsI.H.

◆ info()

InfoProxy<ensightCells> info ( ) const
inlinenoexcept

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

Definition at line 338 of file ensightCells.H.

Referenced by ensightMesh::correct().

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 221 of file ensightCellsAddr.C.

References mesh, and List< label >::null().

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 262 of file ensightCells.C.

References Ostream::beginBlock(), Ostream::endBlock(), Foam::endEntry(), ensightCells::key(), Foam::name(), ensightCells::nTypes, os(), Foam::type(), Ostream::writeEntry(), Ostream::writeKeyword(), and UList< T >::writeList().

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 (serial only)

< Collective write?

Definition at line 260 of file ensightCellsIO.C.

References ensightPart::index(), mesh, ensightPart::name(), nPoints, ensightCells::nTypes, os(), UPstream::parRun(), polyMesh::points(), and Foam::ensightOutput::Detail::writeCoordinates().

Here is the call graph for this function:

◆ size() [2/2]

label size
inlinenoexcept

Processor-local size of all elements.

Definition at line 193 of file ensightPart.H.

Member Data Documentation

◆ nTypes

constexpr int nTypes = 5
static

Number of 'Cell' element types (5)

Definition at line 74 of file ensightCells.H.

Referenced by ensightCells::write(), and ensightCells::writeDict().

◆ elemNames

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

The ensight 'Cell' element type names.

Definition at line 79 of file ensightCells.H.


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