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...

Inheritance diagram for blockDescriptor:
[legend]
Collaboration diagram for blockDescriptor:
[legend]

Public Member Functions

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

Static Public Member Functions

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

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 78 of file blockDescriptor.H.

Constructor & Destructor Documentation

◆ blockDescriptor() [1/3]

blockDescriptor ( const blockDescriptor )
default

Copy construct.

◆ 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 197 of file blockDescriptor.C.

References Foam::exit(), Foam::stringOps::expand(), Foam::FatalError, and FatalErrorInFunction.

Here is the call graph for this function:

◆ blockDescriptor() [3/3]

blockDescriptor ( const dictionary dict,
const label  blockIndex,
const pointField vertices,
const blockEdgeList edges,
const blockFaceList faces,
Istream is 
)

Member Function Documentation

◆ operator=()

void operator= ( const blockDescriptor )
delete

No copy assignment.

◆ vertices()

const Foam::pointField & vertices ( ) const
inlinenoexcept

Reference to point field defining the block mesh.

Definition at line 32 of file blockDescriptorI.H.

Referenced by projectFace::project().

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 39 of file blockDescriptorI.H.

◆ blockShape()

const Foam::cellShape & blockShape ( ) const
inlinenoexcept

Return the block shape.

Definition at line 46 of file blockDescriptorI.H.

Referenced by Foam::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 53 of file blockDescriptorI.H.

References ijkAddressing::sizes().

Referenced by Foam::faceNij(), Foam::facePoint(), Foam::facePointN(), Foam::operator<<(), and projectFace::project().

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 60 of file blockDescriptorI.H.

Referenced by Foam::operator<<().

Here is the caller graph for this function:

◆ zoneName()

const Foam::word & zoneName ( ) const
inlinenoexcept

Return the (optional) zone name.

Definition at line 66 of file blockDescriptorI.H.

Referenced by Foam::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 73 of file blockDescriptorI.H.

◆ nCurvedFaces()

Foam::label nCurvedFaces ( ) const
inlinenoexcept

Number of curved faces in this block.

Definition at line 79 of file blockDescriptorI.H.

◆ blockPoint()

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

Return block point for local label i.

Definition at line 85 of file blockDescriptorI.H.

◆ 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 92 of file blockDescriptorI.H.

References x, and y.

◆ 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 129 of file blockDescriptorI.H.

References k.

◆ 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 142 of file blockDescriptorI.H.

References k.

◆ 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 129 of file blockDescriptorEdges.C.

References hexCell::modelEdges().

Here is the call 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 154 of file blockDescriptorEdges.C.

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

Here is the call 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 185 of file blockDescriptorEdges.C.

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

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 155 of file blockDescriptorI.H.

References k, x, and y.

◆ 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 326 of file blockDescriptor.C.

References k, points, and FixedList< T, N >::setSize().

Here is the call 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 382 of file blockDescriptor.C.

References forAll.

◆ write()

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

Write block index with dictionary lookup.

Definition at line 402 of file blockDescriptor.C.

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

Here is the call graph for this function:

◆ info()

InfoProxy<blockDescriptor> info ( ) const
inline

Return info proxy.

Definition at line 264 of file blockDescriptor.H.


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