Loading...
Searching...
No Matches
blockDescriptor Class Reference

Takes the description of the block and the list of curved edges and creates a list of points on edges together with the weighting factors. More...

#include <blockDescriptor.H>

Inheritance diagram for blockDescriptor:
Collaboration diagram for blockDescriptor:

Public Member Functions

 blockDescriptor (const blockDescriptor &)=default
 Copy construct.
void operator= (const blockDescriptor &)=delete
 No copy assignment.
 blockDescriptor (const cellShape &bshape, const pointField &vertices, const blockEdgeList &edges, const blockFaceList &faces, const labelVector &density, const UList< gradingDescriptors > &expand=UList< gradingDescriptors >::null(), const word &zoneName=word::null)
 Construct from components. Optional zone name.
 blockDescriptor (const dictionary &dict, const label blockIndex, const pointField &vertices, const blockEdgeList &edges, const blockFaceList &faces, Istream &is)
 Construct from Istream.
const pointFieldvertices () const noexcept
 Reference to point field defining the block mesh.
const blockFaceListblockFaces () const noexcept
 Return reference to the list of curved faces.
const cellShapeblockShape () const noexcept
 Return the block shape.
const labelVectordensity () const noexcept
 The mesh density (number of cells) in the i,j,k directions.
const List< gradingDescriptors > & grading () const noexcept
 Expansion ratios in all directions.
const wordzoneName () const noexcept
 Return the (optional) zone name.
const FixedList< label, 6 > & curvedFaces () const noexcept
 Curved-face labels for each block-face (-1 for flat faces).
label nCurvedFaces () const noexcept
 Number of curved faces in this block.
const pointblockPoint (const label i) const
 Return block point for local label i.
label facePointLabel (const direction facei, const label i, const label j) const
 Face vertex label offset for a particular i,j,k position on hex face (0-5).
bool vertex (const label i, const label j, const label k) const
 True if point i,j,k addresses a block vertex.
bool edge (const label i, const label j, const label k) const
 True if point i,j,k addresses a block edge.
int edgesPointsWeights (pointField(&edgesPoints)[12], scalarList(&edgesWeights)[12]) const
 Calculate the points and weights for all edges.
bool edgePointsWeights (const label edgei, pointField &edgePoints, scalarList &edgeWeights, const label nDiv, const gradingDescriptors &gd=gradingDescriptors()) const
 Calculate points and weights for specified edge, using the specified number of divisions and grading.
bool edgePointsWeights (const label edgei, pointField &edgePoints, scalarList &edgeWeights) const
 Calculate points and weights for specified edge.
bool flatFaceOrEdge (const label i, const label j, const label k) const
 Return true if point i,j,k addresses a block flat face or edge.
FixedList< pointField, 6 > facePoints (const pointField &points) const
 Return the list of face-points for all of the faces of the block.
void correctFacePoints (FixedList< pointField, 6 > &) const
 Correct the location of the given face-points.
InfoProxy< blockDescriptorinfo () const noexcept
 Return info proxy, used to print information to a stream.
Public Member Functions inherited from ijkMesh
 ijkMesh ()
 Construct zero-sized.
 ijkMesh (const labelVector &ijk)
 Construct with addressing.
 ijkMesh (const label nx, const label ny, const label nz)
 Construct with addressing.
label nPoints () const
 The number of mesh points (nx+1)*(ny+1)*(nz+1) in the i-j-k mesh.
label nCells () const
 The number of mesh cells (nx*ny*nz) in the i-j-k mesh.
label nFaces () const
 The total number of mesh faces in the i-j-k mesh.
label nInternalFaces () const
 The number of internal faces in the i-j-k mesh.
label nBoundaryFaces () const
 The number of boundary faces in the i-j-k mesh.
label nBoundaryFaces (const direction shapeFacei) const
 The number of boundary faces on the box face.
label cellLabel (const label i, const label j, const label k) const
 The linear cell index for an i-j-k position - same as index().
label cellLabel (const labelVector &ijk) const
 The linear cell index for an i-j-k position - same as index().
label pointLabel (const label i, const label j, const label k) const
 The linear point index for an i-j-k position.
label pointLabel (const labelVector &ijk) const
 The linear point index for an i-j-k position.
hexCell vertLabels (const label i, const label j, const label k) const
 The hex cell vertices for an i-j-k position.
hexCell vertLabels (const labelVector &ijk) const
 The hex cell vertices for an i-j-k position.
Public Member Functions inherited from ijkAddressing
 ijkAddressing ()
 Construct zero-size addressing.
 ijkAddressing (const labelVector &ijk)
 Construct with addressing.
 ijkAddressing (const label ni, const label nj, const label nk)
 Construct with addressing components.
bool empty () const noexcept
 Addressing is considered empty if any component is zero.
const labelVectorsizes () const noexcept
 The (i,j,k) addressing dimensions.
labelVectorsizes () noexcept
 Return the (i,j,k) dimensions for modification.
label size () const noexcept
 Return the total i*j*k size.
label size (const vector::components cmpt) const
 The addressing dimension in the given direction.
void clear ()
 Reset to (0,0,0) sizing.
void reset (const label ni, const label nj, const label nk)
 Change the sizing parameters.
void reset (const labelVector &newSizes)
 Change the sizing parameters.
label index (const label i, const label j, const label k) const
 Linear addressing index (offset) for an (i,j,k) position.
label index (const labelVector &ijk) const
 Linear addressing index (offset) for an (i,j,k) position.
labelVector index (const label idx) const
 The (i,j,k) indexing from linear addressing.
void checkIndex (const label i, const label j, const label k, const bool allowExtra=false) const
 Check indices are within ni,nj,nk range.
void checkIndex (const labelVector &ijk, const bool allowExtra=false) const
 Check indices are within ni,nj,nk range.
void checkSizes () const
 Check that all components of sizes() are non-negative.
void checkSizes (const labelVector &other) const
 Check that all components of sizes() match.
void checkSizes (const label nTotal) const
 Check that the total size matches.

Static Public Member Functions

static void write (Ostream &, const label blocki, const dictionary &)
 Write block index with dictionary lookup.

Detailed Description

Takes the description of the block and the list of curved edges and creates a list of points on edges together with the weighting factors.

For a given block, the correspondence between the ordering of vertex labels and face labels is shown below. For vertex numbering in the sequence 0 to 7 (block, centre): faces 0 (f0) and 1 are left and right, respectively; faces 2 and 3 are front and back; and faces 4 and 5 are bottom and top:

                7 ---- 6
          f5    |\     :\    f3
           |    | 4 ---- 5    \
           |    3.|....2 |     \
           |     \|     \|     f2
          f4      0 ---- 1
  Y  Z
   \ |          f0 ------ f1
    \|
     o--- X
Source files

Definition at line 82 of file blockDescriptor.H.

Constructor & Destructor Documentation

◆ blockDescriptor() [1/3]

blockDescriptor ( const blockDescriptor & )
default

Copy construct.

References blockDescriptor().

Referenced by block::block(), block::block(), block::block(), blockDescriptor(), block::declareRunTimeSelectionTable(), info(), and operator=().

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

◆ blockDescriptor() [2/3]

blockDescriptor ( const cellShape & bshape,
const pointField & vertices,
const blockEdgeList & edges,
const blockFaceList & faces,
const labelVector & density,
const UList< gradingDescriptors > & expand = UList<gradingDescriptors>::null(),
const word & zoneName = word::null )

Construct from components. Optional zone name.

Definition at line 189 of file blockDescriptor.C.

References density(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, ijkMesh::ijkMesh(), vertices(), and zoneName().

Here is the call graph for this function:

◆ blockDescriptor() [3/3]

Member Function Documentation

◆ operator=()

◆ vertices()

const Foam::pointField & vertices ( ) const
inlinenoexcept

Reference to point field defining the block mesh.

Definition at line 25 of file blockDescriptorI.H.

References Foam::noexcept.

Referenced by block::block(), block::block(), blockDescriptor(), blockDescriptor(), block::declareRunTimeSelectionTable(), namedBlock::namedBlock(), operator=(), projectFace::project(), and namedBlock::TypeNameNoDebug().

Here is the caller graph for this function:

◆ blockFaces()

const Foam::blockFaceList & blockFaces ( ) const
inlinenoexcept

Return reference to the list of curved faces.

Definition at line 32 of file blockDescriptorI.H.

References Foam::noexcept.

Referenced by operator=().

Here is the caller graph for this function:

◆ blockShape()

const Foam::cellShape & blockShape ( ) const
inlinenoexcept

Return the block shape.

Definition at line 39 of file blockDescriptorI.H.

References Foam::noexcept.

Referenced by Foam::operator<<(), operator=(), and projectFace::project().

Here is the caller graph for this function:

◆ density()

const Foam::labelVector & density ( ) const
inlinenoexcept

The mesh density (number of cells) in the i,j,k directions.

Definition at line 46 of file blockDescriptorI.H.

References Foam::noexcept, and ijkAddressing::sizes().

Referenced by block::block(), blockDescriptor(), block::declareRunTimeSelectionTable(), Foam::faceNij(), Foam::facePoint(), Foam::facePointN(), Foam::facePointN(), Foam::operator<<(), operator=(), projectFace::project(), and block::shapes().

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

◆ grading()

const Foam::List< Foam::gradingDescriptors > & grading ( ) const
inlinenoexcept

Expansion ratios in all directions.

Definition at line 53 of file blockDescriptorI.H.

References Foam::noexcept.

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

Here is the caller graph for this function:

◆ zoneName()

const Foam::word & zoneName ( ) const
inlinenoexcept

Return the (optional) zone name.

Definition at line 59 of file blockDescriptorI.H.

References Foam::noexcept.

Referenced by block::block(), blockDescriptor(), block::declareRunTimeSelectionTable(), Foam::operator<<(), and operator=().

Here is the caller graph for this function:

◆ curvedFaces()

const Foam::FixedList< Foam::label, 6 > & curvedFaces ( ) const
inlinenoexcept

Curved-face labels for each block-face (-1 for flat faces).

Definition at line 66 of file blockDescriptorI.H.

References Foam::noexcept.

Referenced by operator=().

Here is the caller graph for this function:

◆ nCurvedFaces()

Foam::label nCurvedFaces ( ) const
inlinenoexcept

Number of curved faces in this block.

Definition at line 72 of file blockDescriptorI.H.

References Foam::noexcept.

Referenced by operator=().

Here is the caller graph for this function:

◆ blockPoint()

const Foam::point & blockPoint ( const label i) const
inline

Return block point for local label i.

Definition at line 78 of file blockDescriptorI.H.

Referenced by operator=().

Here is the caller graph for this function:

◆ facePointLabel()

Foam::label facePointLabel ( const direction facei,
const label i,
const label j ) const
inline

Face vertex label offset for a particular i,j,k position on hex face (0-5).

Definition at line 84 of file blockDescriptorI.H.

References ijkAddressing::sizes(), x, and y.

Referenced by facePoints(), and operator=().

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

◆ vertex()

bool vertex ( const label i,
const label j,
const label k ) const
inline

True if point i,j,k addresses a block vertex.

Definition at line 121 of file blockDescriptorI.H.

References k, and ijkAddressing::sizes().

Referenced by operator=().

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

◆ edge()

bool edge ( const label i,
const label j,
const label k ) const
inline

True if point i,j,k addresses a block edge.

Definition at line 134 of file blockDescriptorI.H.

References k, and ijkAddressing::sizes().

Referenced by flatFaceOrEdge(), and operator=().

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

◆ edgesPointsWeights()

int edgesPointsWeights ( pointField(&) edgesPoints[12],
scalarList(&) edgesWeights[12] ) const

Calculate the points and weights for all edges.

Returns
the number of curved edges (0-12)

Definition at line 119 of file blockDescriptorEdges.C.

References hexCell::modelEdges(), and ijkAddressing::sizes().

Referenced by operator=().

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

◆ edgePointsWeights() [1/2]

bool edgePointsWeights ( const label edgei,
pointField & edgePoints,
scalarList & edgeWeights,
const label nDiv,
const gradingDescriptors & gd = gradingDescriptors() ) const

Calculate points and weights for specified edge, using the specified number of divisions and grading.

Returns
True if the edge is curved

Definition at line 144 of file blockDescriptorEdges.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, and hexCell::modelEdges().

Referenced by operator=().

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

◆ edgePointsWeights() [2/2]

bool edgePointsWeights ( const label edgei,
pointField & edgePoints,
scalarList & edgeWeights ) const

Calculate points and weights for specified edge.

Returns
True if the edge is curved

Definition at line 175 of file blockDescriptorEdges.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, hexCell::modelEdges(), and ijkAddressing::sizes().

Here is the call graph for this function:

◆ flatFaceOrEdge()

bool flatFaceOrEdge ( const label i,
const label j,
const label k ) const
inline

Return true if point i,j,k addresses a block flat face or edge.

Definition at line 147 of file blockDescriptorI.H.

References edge(), k, ijkAddressing::sizes(), x, and y.

Referenced by operator=().

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

◆ facePoints()

Foam::FixedList< Foam::pointField, 6 > facePoints ( const pointField & points) const

Return the list of face-points for all of the faces of the block.

Definition at line 319 of file blockDescriptor.C.

References facePointLabel(), facePoints(), k, ijkMesh::pointLabel(), points, and ijkAddressing::sizes().

Referenced by correctFacePoints(), facePoints(), and operator=().

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

◆ correctFacePoints()

void correctFacePoints ( FixedList< pointField, 6 > & facePoints) const

Correct the location of the given face-points.

to lie on the faces of the block

Definition at line 374 of file blockDescriptor.C.

References facePoints(), and forAll.

Referenced by operator=().

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

◆ write()

void write ( Ostream & os,
const label blocki,
const dictionary & d )
static

Write block index with dictionary lookup.

Definition at line 394 of file blockDescriptor.C.

References dictionary::findDict(), os(), and Foam::blockMeshTools::write().

Referenced by operator=().

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

◆ info()

InfoProxy< blockDescriptor > info ( ) const
inlinenoexcept

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

Definition at line 347 of file blockDescriptor.H.

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

Referenced by info().

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

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