FreeFOAM The Cross-Platform CFD Toolkit
hexMatcher Class Reference

A cellMatcher for hex cells. More...

#include <OpenFOAM/hexMatcher.H>


Detailed Description

+ Inheritance diagram for hexMatcher:
+ Collaboration diagram for hexMatcher:

List of all members.

Public Member Functions

 hexMatcher ()
 Construct null.
 ~hexMatcher ()
virtual label nVertPerCell () const
virtual label nFacePerCell () const
virtual label nMaxVertPerFace () const
virtual label faceHashValue () const
 Hash value of all face sizes of this shape. Can be used for.
virtual bool faceSizeMatch (const faceList &, const labelList &) const
 Check whether number of face sizes match the shape.
virtual bool matchShape (const bool checkOnly, const faceList &faces, const labelList &faceOwner, const label cellI, const labelList &myFaces)
 Low level shape recognition. Return true if matches.
virtual bool isA (const primitiveMesh &mesh, const label cellI)
 Exact match. Uses faceSizeMatch.
virtual bool isA (const faceList &)
 Exact match given all the faces forming a cell. No checks.
virtual bool matches (const primitiveMesh &mesh, const label cellI, cellShape &shape)
 Like isA but also constructs a cellShape (if shape matches)
- Public Member Functions inherited from cellMatcher
 cellMatcher (const label vertPerCell, const label facePerCell, const label maxVertPerFace, const word &cellModelName)
 Construct given mesh and shape factors.
virtual ~cellMatcher ()
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

Additional Inherited Members

- Static Public Member Functions inherited from cellMatcher
static labelList makeIdentity (const label nElems)
 Create list with incrementing labels.
- Protected Member Functions inherited from cellMatcher
label calcLocalFaces (const faceList &faces, const labelList &myFaces)
 Calculates localFaces. Returns number of local vertices (or -1.
void calcEdgeAddressing (const label numVert)
 Fill edge (start, end) to face number.
void calcPointFaceIndex ()
 Fill vertex/face to index in face data structure.
label otherFace (const label numVert, const label v0, const label v1, const label localFaceI) const
 Given start,end of edge lookup both faces sharing it and return.
- Static Protected Member Functions inherited from cellMatcher
static label edgeKey (const label numVert, const label v0, const label v1)
 Given start and end of edge generate unique key.
static label nextVert (const label, const label, const bool)
 Step along face either in righthand or lefthand direction.
- Protected Attributes inherited from cellMatcher
Map< label > localPoint_
faceList localFaces_
 Faces using local vertex numbering.
labelList faceSize_
 Number of vertices per face in localFaces_.
labelList pointMap_
 Map from local to mesh vertex numbering.
labelList faceMap_
 Map from local to mesh face numbering.
labelList edgeFaces_
 Map from 'edge' to neighbouring faces.
labelListList pointFaceIndex_
 pointFaceIndex[localVertI][localFaceI] is index in localFace
labelList vertLabels_
 After matching: holds mesh vertices in cellmodel order.
labelList faceLabels_
 After matching: holds mesh faces in cellmodel order.
const word cellModelName_
 CellModel name.
const cellModelcellModelPtr_

Constructor & Destructor Documentation

Construct null.

Definition at line 39 of file hexMatcher.C.

~hexMatcher ( )

Definition at line 53 of file hexMatcher.C.


Member Function Documentation

virtual label nVertPerCell ( ) const
inlinevirtual

Implements cellMatcher.

Definition at line 87 of file hexMatcher.H.

virtual label nFacePerCell ( ) const
inlinevirtual

Implements cellMatcher.

Definition at line 92 of file hexMatcher.H.

virtual label nMaxVertPerFace ( ) const
inlinevirtual

Implements cellMatcher.

Definition at line 97 of file hexMatcher.H.

Foam::label faceHashValue ( ) const
virtual

Hash value of all face sizes of this shape. Can be used for.

quick initial recognition.

Implements cellMatcher.

Definition at line 247 of file hexMatcher.C.

bool faceSizeMatch ( const faceList ,
const labelList  
) const
virtual

Check whether number of face sizes match the shape.

Implements cellMatcher.

Definition at line 254 of file hexMatcher.C.

References forAll, and List< T >::size().

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

Low level shape recognition. Return true if matches.

Works in detection mode only (checkOnly=true) or in exact matching. Returns true and sets vertLabels_. Needs faces, faceOwner of all faces in 'mesh' and cell number and labels of faces for this cell. cellI only used in combination with faceOwner to detect owner status.

Implements cellMatcher.

Definition at line 60 of file hexMatcher.C.

References Foam::meshTools::otherFace().

bool isA ( const primitiveMesh mesh,
const label  cellI 
)
virtual

Exact match. Uses faceSizeMatch.

Returns true if cell matches shape exactly.

Implements cellMatcher.

Definition at line 278 of file hexMatcher.C.

References primitiveMesh::cells(), primitiveMesh::faceOwner(), and primitiveMesh::faces().

bool isA ( const faceList )
virtual

Exact match given all the faces forming a cell. No checks.

on whether faces match up and form a closed shape.

Implements cellMatcher.

Definition at line 291 of file hexMatcher.C.

References List< T >::size().

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

Like isA but also constructs a cellShape (if shape matches)

Implements cellMatcher.

Definition at line 306 of file hexMatcher.C.

References primitiveMesh::cells(), primitiveMesh::faceOwner(), and primitiveMesh::faces().


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