cellModel Class Reference

Maps a geometry to a set of cell primitives. More...

Collaboration diagram for cellModel:
[legend]

Public Types

enum  modelType {
  UNKNOWN = 0, HEX = 3, WEDGE = 4, PRISM = 5,
  PYR = 6, TET = 7, SPLITHEX = 8, TETWEDGE = 9
}
 Enumeration of commonly used cellModel types. More...
 

Public Member Functions

 cellModel (Istream &is)
 Construct from Istream. More...
 
autoPtr< cellModelclone () const
 Return clone. More...
 
const wordname () const
 Return model name. More...
 
label index () const
 Return index of model in the model list. More...
 
label nPoints () const
 Return number of points. More...
 
label nEdges () const
 Return number of edges. More...
 
label nFaces () const
 Return number of faces. More...
 
const edgeListmodelEdges () const
 Return a raw list of model edges. More...
 
const faceListmodelFaces () const
 Return a raw list of model faces. More...
 
edgeList edges (const labelUList &pointLabels) const
 Return list of edges. More...
 
faceList faces (const labelUList &pointLabels) const
 Return list of faces. More...
 
vector centre (const labelList &pointLabels, const UList< point > &points) const
 Vector centroid. More...
 
scalar mag (const labelList &pointLabels, const UList< point > &points) const
 Cell volume. More...
 
InfoProxy< cellModelinfo () const
 Return info proxy. More...
 
bool writeData (Ostream &os) const
 WriteData member function required by regIOobject. More...
 

Static Public Member Functions

static const cellModelptr (const modelType model)
 Look up pointer to cellModel by enumeration, or nullptr on failure. More...
 
static const cellModelptr (const word &modelName)
 Look up pointer to cellModel by name, or nullptr on failure. More...
 
static const cellModelptr (const label modelIndex)
 Look up pointer to cellModel by index, or nullptr on failure. More...
 
static const cellModelref (const modelType model)
 Look up reference to cellModel by enumeration. Fatal on failure. More...
 
static const cellModelref (const word &modelName)
 Look up reference to cellModel by name. Fatal on failure. More...
 
static const cellModelref (const label modelIndex)
 Look up reference to cellModel by index. Fatal on failure. More...
 
static autoPtr< cellModelNew (Istream &is)
 Return a new cellModel on free-store created from Istream. More...
 

Static Public Attributes

static const Enum< modelTypemodelNames
 Names of commonly used cellModels corresponding to modelType. More...
 

Friends

Ostreamoperator<< (Ostream &os, const cellModel &cm)
 

Detailed Description

Maps a geometry to a set of cell primitives.

This enables geometric cell data to be calculated without access to the primitive geometric level. This means mapping a 3D geometry to a set of pyramids which are each described by a cell face and the cell centre point.

Also includes a static collection of cell models (normally loaded from etc/cellModels), and a means of looking them up.

Source files

Definition at line 72 of file cellModel.H.

Member Enumeration Documentation

◆ modelType

enum modelType

Enumeration of commonly used cellModel types.

The indices must match those in "etc/cellModels"

Enumerator
UNKNOWN 

unknown

HEX 

hex

WEDGE 

wedge

PRISM 

prism

PYR 

pyr

TET 

tet

SPLITHEX 

splitHex

TETWEDGE 

tetWedge

Definition at line 78 of file cellModel.H.

Constructor & Destructor Documentation

◆ cellModel()

cellModel ( Istream is)

Construct from Istream.

Definition at line 33 of file cellModelIO.C.

References dict, dictionaryEntry::dict(), entry::keyword(), and dictionary::null.

Here is the call graph for this function:

Member Function Documentation

◆ ptr() [1/3]

const Foam::cellModel * ptr ( const modelType  model)
static

Look up pointer to cellModel by enumeration, or nullptr on failure.

Definition at line 120 of file cellModels.C.

Referenced by cellMatcher::model(), STARCDMeshReader::readCells(), shapeToCell::shapeToCell(), and tetCell::tetCellShape().

Here is the caller graph for this function:

◆ ptr() [2/3]

const Foam::cellModel * ptr ( const word modelName)
static

Look up pointer to cellModel by name, or nullptr on failure.

Definition at line 126 of file cellModels.C.

References n, and Foam::name().

Here is the call graph for this function:

◆ ptr() [3/3]

const Foam::cellModel * ptr ( const label  modelIndex)
static

Look up pointer to cellModel by index, or nullptr on failure.

Definition at line 146 of file cellModels.C.

◆ ref() [1/3]

const Foam::cellModel & ref ( const modelType  model)
static

Look up reference to cellModel by enumeration. Fatal on failure.

Definition at line 157 of file cellModels.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, and p.

Referenced by voxelMeshSearch::makeMesh(), STARCDMeshReader::readBoundary(), STARCDMeshReader::readCells(), vtuSizing::reset(), and writer::writer().

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

◆ ref() [2/3]

const Foam::cellModel & ref ( const word modelName)
static

Look up reference to cellModel by name. Fatal on failure.

Definition at line 172 of file cellModels.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, and p.

Here is the call graph for this function:

◆ ref() [3/3]

const Foam::cellModel & ref ( const label  modelIndex)
static

Look up reference to cellModel by index. Fatal on failure.

Definition at line 187 of file cellModels.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, and p.

Here is the call graph for this function:

◆ New()

static autoPtr<cellModel> New ( Istream is)
inlinestatic

Return a new cellModel on free-store created from Istream.

Definition at line 160 of file cellModel.H.

References autoPtr< T >::New().

Here is the call graph for this function:

◆ clone()

autoPtr<cellModel> clone ( ) const
inline

Return clone.

Definition at line 166 of file cellModel.H.

References autoPtr< T >::New().

Here is the call graph for this function:

◆ name()

const Foam::word & name ( ) const
inline

Return model name.

Definition at line 30 of file cellModelI.H.

Referenced by Foam::operator<<().

Here is the caller graph for this function:

◆ index()

Foam::label index ( ) const
inline

Return index of model in the model list.

Definition at line 36 of file cellModelI.H.

Referenced by Foam::operator<<(), STARCDMeshReader::readBoundary(), and writer::writer().

Here is the caller graph for this function:

◆ nPoints()

Foam::label nPoints ( ) const
inline

Return number of points.

Definition at line 42 of file cellModelI.H.

Referenced by Foam::operator<<().

Here is the caller graph for this function:

◆ nEdges()

Foam::label nEdges ( ) const
inline

Return number of edges.

Definition at line 48 of file cellModelI.H.

◆ nFaces()

Foam::label nFaces ( ) const
inline

Return number of faces.

Definition at line 54 of file cellModelI.H.

◆ modelEdges()

const Foam::edgeList & modelEdges ( ) const
inline

Return a raw list of model edges.

Definition at line 60 of file cellModelI.H.

Referenced by Foam::operator<<().

Here is the caller graph for this function:

◆ modelFaces()

const Foam::faceList & modelFaces ( ) const
inline

Return a raw list of model faces.

Definition at line 66 of file cellModelI.H.

Referenced by Foam::operator<<().

Here is the caller graph for this function:

◆ edges()

Foam::edgeList edges ( const labelUList pointLabels) const
inline

Return list of edges.

Definition at line 75 of file cellModelI.H.

References Foam::constant::electromagnetic::e, stdFoam::end(), forAll, pointLabels(), and Foam::start.

Here is the call graph for this function:

◆ faces()

Foam::faceList faces ( const labelUList pointLabels) const
inline

Return list of faces.

Definition at line 99 of file cellModelI.H.

References f(), forAll, pointLabels(), and List< T >::setSize().

Here is the call graph for this function:

◆ centre()

Foam::vector centre ( const labelList pointLabels,
const UList< point > &  points 
) const

Vector centroid.

Definition at line 35 of file cellModel.C.

References pyramid< Point, PointRef, polygonRef >::centre(), Foam::endl(), forAll, pyramid< Point, PointRef, polygonRef >::mag(), pointLabels(), points, WarningInFunction, and Foam::Zero.

Here is the call graph for this function:

◆ mag()

Foam::scalar mag ( const labelList pointLabels,
const UList< point > &  points 
) const

Cell volume.

Definition at line 92 of file cellModel.C.

References Foam::endl(), forAll, pyramid< Point, PointRef, polygonRef >::mag(), pointLabels(), points, WarningInFunction, and Foam::Zero.

Here is the call graph for this function:

◆ info()

InfoProxy<cellModel> info ( ) const
inline

Return info proxy.

Used to print information to a stream

Definition at line 218 of file cellModel.H.

◆ writeData()

bool writeData ( Ostream os) const
inline

WriteData member function required by regIOobject.

Definition at line 224 of file cellModel.H.

References IOstream::good().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ operator<<

Ostream& operator<< ( Ostream os,
const cellModel cm 
)
friend

Member Data Documentation

◆ modelNames

const Foam::Enum< Foam::cellModel::modelType > modelNames
static

Names of commonly used cellModels corresponding to modelType.

The names must match those in "etc/cellModels"

Definition at line 92 of file cellModel.H.


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