Sorting/classification of faces (2D) into corresponding ensight types. More...
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, nTypes > | sizes () const |
Processor-local sizes per element type. More... | |
const labelList & | faceIds () 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 boolList & | flipMap () const |
Processor-local flip-map of all elements. More... | |
bool | usesFlipMap () const |
True for non-zero flip-map that spans the addresses. More... | |
const labelList & | faceOrder () 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... | |
InfoProxy< ensightFaces > | info () const |
Return info proxy. 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 string & | name () 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... | |
virtual void | writeDict (Ostream &os, const bool full=false) const |
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 labelList & | addressing () const noexcept |
Element addressing. More... | |
labelList & | addressing () 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... | |
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,
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 72 of file ensightFaces.H.
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 82 of file ensightFaces.H.
ensightFaces | ( | ) |
Default construct, with part index 0.
Definition at line 103 of file ensightFaces.C.
|
explicit |
Default construct, with description/partName.
Definition at line 113 of file ensightFaces.C.
References ensightPart::rename().
|
virtualdefault |
Destructor.
|
inlinestatic |
The ensight element name for the specified 'Face' type.
Definition at line 49 of file ensightFacesI.H.
TypeName | ( | "ensightFaces" | ) |
Declare type-name, virtual type (with debug switch)
|
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().
|
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().
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(), Foam::operator<<(), Foam::ensightOutput::writeFaceConnectivity(), Foam::ensightOutput::writeFaceConnectivityPresorted(), Foam::ensightOutput::Detail::writeFaceLocalField(), Foam::ensightOutput::Detail::writeFaceSubField(), and Foam::ensightOutput::writeField().
|
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.
|
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.
Foam::FixedList< Foam::label, 3 > sizes | ( | ) | const |
Processor-local sizes per element type.
Definition at line 123 of file ensightFaces.C.
References forAll.
|
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().
|
inline |
Processor-local face ids of the specified element type.
Definition at line 86 of file ensightFacesI.H.
References range, and UList< T >::slice().
|
inline |
Processor-local flip-map of all elements.
Definition at line 92 of file ensightFacesI.H.
Referenced by ensightFaces::write().
|
inline |
True for non-zero flip-map that spans the addresses.
Definition at line 98 of file ensightFacesI.H.
Referenced by ensightFaces::write().
|
inlinenoexcept |
Processor-local face order (where applicable)
Definition at line 105 of file ensightFacesI.H.
Referenced by Foam::ensightOutput::Detail::writeFaceLocalField().
|
inline |
Processor-local face order of specified element type (where applicable)
Definition at line 112 of file ensightFacesI.H.
References range, and UList< T >::slice().
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 ensightMesh::correct(), ensightFaMesh::correct(), and ensightOutputSurface::ensightOutputSurface().
void classify | ( | const UList< face > & | faces, |
const labelRange & | range | ||
) |
Classify face types (for a sublist) and set element lists.
Definition at line 247 of file ensightFaces.C.
References range, UList< T >::size(), and IntRange< IntType >::start().
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 263 of file ensightFaces.C.
References Foam::add(), faceId(), UList< T >::size(), UList< T >::test(), bitSet::test(), and Foam::Zero.
void clearOut | ( | ) |
Clear any demand-driven data.
Definition at line 160 of file ensightFaces.C.
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 ensightMesh::correct(), and ensightFaMesh::correct().
void reduce | ( | ) |
Sum element counts across all processes.
Definition at line 164 of file ensightFaces.C.
References forAll, and Foam::reduce().
Referenced by ensightMesh::correct(), and ensightFaMesh::correct().
void sort | ( | ) |
Inplace sort element lists numerically.
Definition at line 175 of file ensightFaces.C.
References IntRange< IntType >::empty(), range, and Foam::sortedOrder().
|
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.
|
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().
|
inline |
Return info proxy.
Definition at line 247 of file ensightFaces.H.
Referenced by ensightMesh::correct(), and ensightFaMesh::correct().
Foam::label uniqueMeshPoints | ( | const polyMesh & | mesh, |
labelList & | uniqueMeshPointLabels, | ||
bool | parallel | ||
) | const |
Globally unique mesh points. Required when writing point fields.
Definition at line 38 of file ensightFacesAddr.C.
References ensightFaces::faceIds(), polyMesh::faces(), polyMesh::globalData(), globalMeshData::mergePoints(), mesh, PrimitivePatch< FaceList, PointField >::meshPointMap(), PrimitivePatch< FaceList, PointField >::meshPoints(), nPoints, UPstream::parRun(), points, polyMesh::points(), and UList< T >::size().
Referenced by Foam::ensightOutput::writePointField().
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(), HashTable< T, Key, Hash >::Iterator< Const >::key(), Foam::name(), ensightFaces::nTypes, os(), Foam::type(), Ostream::writeEntry(), and Ostream::writeKeyword().
|
virtual |
Write geometry, using a mesh reference.
< Collective write?
< Collective write?
Reimplemented in ensightOutputSurface.
Definition at line 38 of file ensightFacesIO.C.
References f(), ensightFaces::faceIds(), polyMesh::faces(), ensightFaces::flipMap(), forAll, polyMesh::globalData(), Foam::ListOps::identity(), ensightPart::index(), Foam::ListListOps::inplaceRenumber(), PrimitivePatch< FaceList, PointField >::localFaces(), globalMeshData::mergePoints(), mesh, PrimitivePatch< FaceList, PointField >::meshPointMap(), PrimitivePatch< FaceList, PointField >::meshPoints(), ensightPart::name(), nPoints, os(), UPstream::parRun(), points, polyMesh::points(), List< T >::resize(), UList< T >::size(), ensightFaces::usesFlipMap(), Foam::ensightOutput::Detail::writeCoordinates(), and Foam::ensightOutput::writeFaceConnectivityPresorted().
|
inlinenoexcept |
Processor-local size of all elements.
Definition at line 154 of file ensightPart.H.
|
staticconstexpr |
Number of 'Face' element types (3)
Definition at line 90 of file ensightFaces.H.
Referenced by Foam::operator<<(), and ensightFaces::writeDict().
|
static |
The ensight 'Face' element type names.
Definition at line 93 of file ensightFaces.H.
Referenced by Foam::operator<<().