Loading...
Searching...
No Matches
cellModel Class Reference

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

#include <cellModel.H>

Collaboration diagram for cellModel:

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.
autoPtr< cellModelclone () const
 Return clone.
const wordname () const noexcept
 Return model name.
label index () const noexcept
 Return index of model in the model list.
label nPoints () const noexcept
 Return number of points.
label nEdges () const noexcept
 Return number of edges.
label nFaces () const noexcept
 Return number of faces.
const edgeListmodelEdges () const noexcept
 Return a raw list of model edges.
const faceListmodelFaces () const noexcept
 Return a raw list of model faces.
edgeList edges (const labelUList &pointLabels) const
 Return list of cell edges.
faceList faces (const labelUList &pointLabels) const
 Return list of cell faces.
Foam::edge edge (const label modelEdgei, const labelUList &pointLabels) const
 Return the cell edge for specified model edge.
Foam::face face (const label modelFacei, const labelUList &pointLabels) const
 Return the cell face for specified model face.
vector centre (const labelUList &pointLabels, const UList< point > &points) const
 Centroid of the cell.
scalar mag (const labelUList &pointLabels, const UList< point > &points) const
 Cell volume.
InfoProxy< cellModelinfo () const noexcept
 Return info proxy, used to print information to a stream.
bool writeData (Ostream &os) const
 The writeData member function required by regIOobject.

Static Public Member Functions

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

Static Public Attributes

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

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 81 of file cellModel.H.

Constructor & Destructor Documentation

◆ cellModel()

cellModel ( Istream & is)
explicit

Construct from Istream.

Definition at line 27 of file cellModelIO.C.

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

Referenced by info(), operator<<, ref(), ref(), and ref().

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

References ptr().

Referenced by cellModeller::lookup(), cellModeller::lookup(), cellMatcher::model(), Foam::operator>>(), ptr(), STARCDMeshReader::readCells(), ref(), ref(), ref(), hexCell::shape(), tetCell::shape(), shapeToCell::shapeToCell(), and shapeToCell::shapeToCell().

Here is the call graph for this function:
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 119 of file cellModels.C.

References n, and name.

◆ 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 139 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 150 of file cellModels.C.

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

Referenced by PDRblock::blockMeshDict(), STARCDMeshReader::readBoundary(), STARCDMeshReader::readCells(), ABAQUSCore::readHelper::readSurfaceElements(), 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 165 of file cellModels.C.

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

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 180 of file cellModels.C.

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

Here is the call graph for this function:

◆ New()

autoPtr< cellModel > New ( Istream & is)
inlinestatic

Return a new cellModel created from Istream.

Definition at line 198 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 206 of file cellModel.H.

References autoPtr< T >::New().

Here is the call graph for this function:

◆ name()

const Foam::word & name ( ) const
inlinenoexcept

Return model name.

Definition at line 24 of file cellModelI.H.

References Foam::noexcept.

Referenced by Foam::operator<<(), and Foam::operator<<().

Here is the caller graph for this function:

◆ index()

Foam::label index ( ) const
inlinenoexcept

Return index of model in the model list.

Definition at line 30 of file cellModelI.H.

References Foam::noexcept.

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

Here is the caller graph for this function:

◆ nPoints()

Foam::label nPoints ( ) const
inlinenoexcept

Return number of points.

Definition at line 36 of file cellModelI.H.

References Foam::noexcept.

Referenced by Foam::operator<<().

Here is the caller graph for this function:

◆ nEdges()

Foam::label nEdges ( ) const
inlinenoexcept

Return number of edges.

Definition at line 42 of file cellModelI.H.

References Foam::noexcept.

◆ nFaces()

Foam::label nFaces ( ) const
inlinenoexcept

Return number of faces.

Definition at line 48 of file cellModelI.H.

References Foam::noexcept.

◆ modelEdges()

const Foam::edgeList & modelEdges ( ) const
inlinenoexcept

Return a raw list of model edges.

Definition at line 54 of file cellModelI.H.

References Foam::noexcept.

Referenced by Foam::operator<<().

Here is the caller graph for this function:

◆ modelFaces()

const Foam::faceList & modelFaces ( ) const
inlinenoexcept

Return a raw list of model faces.

Definition at line 60 of file cellModelI.H.

References Foam::noexcept.

Referenced by Foam::operator<<(), and ABAQUSCore::readHelper::readSurfaceElements().

Here is the caller graph for this function:

◆ edges()

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

Return list of cell edges.

Definition at line 66 of file cellModelI.H.

References forAll, and pointLabels().

Here is the call graph for this function:

◆ faces()

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

Return list of cell faces.

Definition at line 94 of file cellModelI.H.

References forAll, and pointLabels().

Here is the call graph for this function:

◆ edge()

Foam::edge edge ( const label modelEdgei,
const labelUList & pointLabels ) const
inline

Return the cell edge for specified model edge.

Definition at line 83 of file cellModelI.H.

References pointLabels().

Here is the call graph for this function:

◆ face()

Foam::face face ( const label modelFacei,
const labelUList & pointLabels ) const
inline

Return the cell face for specified model face.

Definition at line 111 of file cellModelI.H.

References pointLabels().

Here is the call graph for this function:

◆ centre()

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

Centroid of the cell.

Definition at line 57 of file cellModel.C.

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

Here is the call graph for this function:

◆ mag()

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

Cell volume.

Definition at line 97 of file cellModel.C.

References Foam::endl(), f(), forAll, pyramid< Point, PointRef, PolygonRef >::mag(), pointLabels(), points, Foam::pointsAverage(), and WarningInFunction.

Here is the call graph for this function:

◆ info()

InfoProxy< cellModel > info ( ) const
inlinenoexcept

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

Definition at line 301 of file cellModel.H.

References cellModel(), info(), and Foam::noexcept.

Referenced by info().

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

◆ writeData()

bool writeData ( Ostream & os) const
inline

The writeData member function required by regIOobject.

Definition at line 306 of file cellModel.H.

References os().

Here is the call graph for this function:

◆ operator<<

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

References cellModel(), and os().

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 98 of file cellModel.H.

Referenced by ref(), and Foam::serializeHex().


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