Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
cellMatcher Class Referenceabstract

Base class for cellshape matchers (hexMatch, prismMatch, etc.). These are classes which given a mesh and cell number find out the orientation of the cellShape and construct cell-vertex to mesh-vertex mapping and cell-face to mesh-face mapping. More...

Inheritance diagram for cellMatcher:
Inheritance graph
[legend]
Collaboration diagram for cellMatcher:
Collaboration graph
[legend]

Public Member Functions

 cellMatcher (const label vertPerCell, const label facePerCell, const label maxVertPerFace, const word &cellModelName)
 
virtual ~cellMatcher ()=default
 
const Map< label > & localPoint () const
 
const faceListlocalFaces () const
 
const labelListfaceSize () const
 
const labelListpointMap () const
 
const labelListfaceMap () const
 
const labelListedgeFaces () const
 
const labelListListpointFaceIndex () const
 
const labelListvertLabels () const
 
const labelListfaceLabels () const
 
const cellModelmodel () const
 
void write (Ostream &os) const
 
virtual label nVertPerCell () const =0
 
virtual label nFacePerCell () const =0
 
virtual label nMaxVertPerFace () const =0
 
virtual label faceHashValue () const =0
 
virtual bool faceSizeMatch (const faceList &, const labelList &) const =0
 
virtual bool matchShape (const bool checkOnly, const faceList &faces, const labelList &faceOwner, const label celli, const labelList &myFaces)=0
 
virtual bool isA (const primitiveMesh &mesh, const label celli)=0
 
virtual bool isA (const faceList &)=0
 
virtual bool matches (const primitiveMesh &mesh, const label celli, cellShape &shape)=0
 

Protected Member Functions

label calcLocalFaces (const faceList &faces, const labelList &myFaces)
 
void calcEdgeAddressing (const label numVert)
 
void calcPointFaceIndex ()
 
label otherFace (const label numVert, const label v0, const label v1, const label localFacei) const
 
 cellMatcher (const cellMatcher &)=delete
 
cellMatcheroperator= (const cellMatcher &)=delete
 

Static Protected Member Functions

static label edgeKey (const label numVert, const label v0, const label v1)
 
static label nextVert (const label, const label, const bool)
 

Protected Attributes

Map< label > localPoint_
 
faceList localFaces_
 
labelList faceSize_
 
labelList pointMap_
 
labelList faceMap_
 
labelList edgeFaces_
 
labelListList pointFaceIndex_
 
labelList vertLabels_
 
labelList faceLabels_
 
const word cellModelName_
 
const cellModelcellModelPtr_
 

Detailed Description

Base class for cellshape matchers (hexMatch, prismMatch, etc.). These are classes which given a mesh and cell number find out the orientation of the cellShape and construct cell-vertex to mesh-vertex mapping and cell-face to mesh-face mapping.

For example,

    hexMatcher hex(mesh);
    cellShape shape;
    ..
    bool isHex = hex.match(celli, shape);

Now shape is set to the correct Hex cellShape (if isHex is true)

Alternatively there is direct access to the vertex and face mapping:

    const labelList& hexVertLabels = hex.vertLabels();
    const labelList& hexFaceLabels = hex.faceLabels();

Now

Process of cellShape recognition consists of following steps:

The whole calculation is done such that no lists are allocated during cell checking. E.g. localFaces_ are always sized to hold max. number of possible face vertices and a separate list is filled which holds the actusl face sizes.

For now all hex-degenerates implemented. Numbering taken from picture in demoGuide.

Source files

Definition at line 95 of file cellMatcher.H.

Constructor & Destructor Documentation

◆ cellMatcher() [1/2]

cellMatcher ( const cellMatcher )
protecteddelete

◆ cellMatcher() [2/2]

cellMatcher ( const label  vertPerCell,
const label  facePerCell,
const label  maxVertPerFace,
const word cellModelName 
)

Definition at line 33 of file cellMatcher.C.

References f().

Here is the call graph for this function:

◆ ~cellMatcher()

virtual ~cellMatcher ( )
virtualdefault

Member Function Documentation

◆ edgeKey()

Foam::label edgeKey ( const label  numVert,
const label  v0,
const label  v1 
)
inlinestaticprotected

Definition at line 90 of file cellMatcherI.H.

Referenced by cellMatcher::calcEdgeAddressing().

Here is the caller graph for this function:

◆ nextVert()

Foam::label nextVert ( const label  localVertI,
const label  size,
const bool  rightHand 
)
inlinestaticprotected

Definition at line 102 of file cellMatcherI.H.

◆ calcLocalFaces()

Foam::label calcLocalFaces ( const faceList faces,
const labelList myFaces 
)
protected

Definition at line 67 of file cellMatcher.C.

References f(), forAll, and forAllConstIters().

Here is the call graph for this function:

◆ calcEdgeAddressing()

void calcEdgeAddressing ( const label  numVert)
protected

◆ calcPointFaceIndex()

void calcPointFaceIndex ( )
protected

Definition at line 179 of file cellMatcher.C.

References f(), and forAll.

Here is the call graph for this function:

◆ otherFace()

Foam::label otherFace ( const label  numVert,
const label  v0,
const label  v1,
const label  localFacei 
) const
protected

Definition at line 206 of file cellMatcher.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and Foam::glTF::key().

Here is the call graph for this function:

◆ operator=()

cellMatcher& operator= ( const cellMatcher )
protecteddelete

◆ localPoint()

const Foam::Map< Foam::label > & localPoint ( ) const
inline

Definition at line 23 of file cellMatcherI.H.

References cellMatcher::localPoint_.

◆ localFaces()

const Foam::faceList & localFaces ( ) const
inline

Definition at line 29 of file cellMatcherI.H.

◆ faceSize()

const Foam::labelList & faceSize ( ) const
inline

Definition at line 35 of file cellMatcherI.H.

◆ pointMap()

const Foam::labelList & pointMap ( ) const
inline

Definition at line 41 of file cellMatcherI.H.

◆ faceMap()

const Foam::labelList & faceMap ( ) const
inline

Definition at line 47 of file cellMatcherI.H.

◆ edgeFaces()

const Foam::labelList & edgeFaces ( ) const
inline

Definition at line 53 of file cellMatcherI.H.

◆ pointFaceIndex()

const Foam::labelListList & pointFaceIndex ( ) const
inline

Definition at line 59 of file cellMatcherI.H.

◆ vertLabels()

const Foam::labelList & vertLabels ( ) const
inline

Definition at line 65 of file cellMatcherI.H.

◆ faceLabels()

const Foam::labelList & faceLabels ( ) const
inline

Definition at line 71 of file cellMatcherI.H.

◆ model()

const Foam::cellModel & model ( ) const
inline

Definition at line 77 of file cellMatcherI.H.

References cellModel::ptr().

Here is the call graph for this function:

◆ write()

void write ( Foam::Ostream os) const

Definition at line 235 of file cellMatcher.C.

References Foam::endl(), forAll, Foam::nl, and os().

Here is the call graph for this function:

◆ nVertPerCell()

virtual label nVertPerCell ( ) const
pure virtual

◆ nFacePerCell()

virtual label nFacePerCell ( ) const
pure virtual

◆ nMaxVertPerFace()

virtual label nMaxVertPerFace ( ) const
pure virtual

◆ faceHashValue()

virtual label faceHashValue ( ) const
pure virtual

◆ faceSizeMatch()

virtual bool faceSizeMatch ( const faceList ,
const labelList  
) const
pure virtual

◆ matchShape()

virtual bool matchShape ( const bool  checkOnly,
const faceList faces,
const labelList faceOwner,
const label  celli,
const labelList myFaces 
)
pure virtual

◆ isA() [1/2]

virtual bool isA ( const primitiveMesh mesh,
const label  celli 
)
pure virtual

◆ isA() [2/2]

virtual bool isA ( const faceList )
pure virtual

◆ matches()

virtual bool matches ( const primitiveMesh mesh,
const label  celli,
cellShape shape 
)
pure virtual

Member Data Documentation

◆ localPoint_

Map<label> localPoint_
protected

Definition at line 116 of file cellMatcher.H.

Referenced by cellMatcher::localPoint().

◆ localFaces_

faceList localFaces_
protected

Definition at line 119 of file cellMatcher.H.

Referenced by cellMatcher::calcEdgeAddressing().

◆ faceSize_

labelList faceSize_
protected

Definition at line 122 of file cellMatcher.H.

Referenced by cellMatcher::calcEdgeAddressing().

◆ pointMap_

labelList pointMap_
protected

Definition at line 125 of file cellMatcher.H.

◆ faceMap_

labelList faceMap_
protected

Definition at line 128 of file cellMatcher.H.

◆ edgeFaces_

labelList edgeFaces_
protected

Definition at line 131 of file cellMatcher.H.

Referenced by cellMatcher::calcEdgeAddressing().

◆ pointFaceIndex_

labelListList pointFaceIndex_
protected

Definition at line 135 of file cellMatcher.H.

◆ vertLabels_

labelList vertLabels_
protected

Definition at line 138 of file cellMatcher.H.

◆ faceLabels_

labelList faceLabels_
protected

Definition at line 141 of file cellMatcher.H.

◆ cellModelName_

const word cellModelName_
protected

Definition at line 144 of file cellMatcher.H.

◆ cellModelPtr_

const cellModel* cellModelPtr_
mutableprotected

Definition at line 146 of file cellMatcher.H.


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