Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
blockMesh Class Reference

A multi-block mesh generator. More...

Inheritance diagram for blockMesh:
Inheritance graph
[legend]
Collaboration diagram for blockMesh:
Collaboration graph
[legend]

Public Member Functions

 ClassName ("blockMesh")
 
 blockMesh (const IOdictionary &, const word &regionName)
 Construct from IOdictionary. More...
 
 ~blockMesh ()
 Destructor. More...
 
const pointFieldblockPointField () const
 Reference to point field defining the block mesh. More...
 
const polyMeshtopology () const
 Return the blockMesh topology as a polyMesh. More...
 
const curvedEdgeListedges () const
 Return the curved edges. More...
 
scalar scaleFactor () const
 The scaling factor used to convert to metres. More...
 
const pointFieldpoints () const
 The points for the entire mesh. More...
 
const cellShapeListcells () const
 Return cell shapes list. More...
 
const faceListListpatches () const
 Return the patch face lists. More...
 
PtrList< dictionarypatchDicts () const
 Get patch information from the topology mesh. More...
 
wordList patchNames () const
 Return patch names. More...
 
label numZonedBlocks () const
 Number of blocks with specified zones. More...
 
void clearGeom ()
 Clear geometry (internal points, cells, boundaryPatches) More...
 
void writeTopology (Ostream &) const
 Writes edges of blockMesh in OBJ format. More...
 
- Public Member Functions inherited from PtrList
 PtrList ()
 Null Constructor. More...
 
 PtrList (const label)
 Construct with size specified. More...
 
 PtrList (const PtrList< T > &)
 Copy constructor. More...
 
template<class CloneArg >
 PtrList (const PtrList< T > &, const CloneArg &)
 Copy constructor with additional argument for clone. More...
 
 PtrList (const Xfer< PtrList< T > > &)
 Construct by transferring the parameter contents. More...
 
 PtrList (PtrList< T > &, bool reUse)
 Construct as copy or re-use as specified. More...
 
 PtrList (const SLPtrList< T > &)
 Construct as copy of SLPtrList<T> More...
 
template<class INew >
 PtrList (Istream &, const INew &)
 Construct from Istream using given Istream constructor class. More...
 
 PtrList (Istream &)
 Construct from Istream using default Istream constructor class. More...
 
 ~PtrList ()
 Destructor. More...
 
label size () const
 Return the number of elements in the PtrList. More...
 
bool empty () const
 Return true if the PtrList is empty (ie, size() is zero). More...
 
Tfirst ()
 Return reference to the first element of the list. More...
 
const Tfirst () const
 Return reference to first element of the list. More...
 
Tlast ()
 Return reference to the last element of the list. More...
 
const Tlast () const
 Return reference to the last element of the list. More...
 
void setSize (const label)
 Reset size of PtrList. If extending the PtrList, new entries are. More...
 
void resize (const label)
 Alias for setSize(const label) More...
 
void clear ()
 Clear the PtrList, i.e. set size to zero deleting all the. More...
 
void append (T *)
 Append an element at the end of the list. More...
 
void append (const autoPtr< T > &)
 
void append (const tmp< T > &)
 
void transfer (PtrList< T > &)
 Transfer the contents of the argument PtrList into this PtrList. More...
 
Xfer< PtrList< T > > xfer ()
 Transfer contents to the Xfer container. More...
 
bool set (const label) const
 Is element set. More...
 
autoPtr< Tset (const label, T *)
 Set element. Return old element (can be NULL). More...
 
autoPtr< Tset (const label, const autoPtr< T > &)
 
autoPtr< Tset (const label, const tmp< T > &)
 
void reorder (const labelUList &)
 Reorders elements. Ordering does not have to be done in. More...
 
const Toperator[] (const label) const
 Return element const reference. More...
 
Toperator[] (const label)
 Return element reference. More...
 
const Toperator() (const label) const
 Return element const pointer. More...
 
PtrList< T > & operator= (const PtrList< T > &)
 Assignment. More...
 
iterator begin ()
 Return an iterator to begin traversing the PtrList. More...
 
iterator end ()
 Return an iterator to end traversing the PtrList. More...
 
const_iterator cbegin () const
 Return an const_iterator to begin traversing the PtrList. More...
 
const_iterator cend () const
 Return an const_iterator to end traversing the PtrList. More...
 
const_iterator begin () const
 Return an const_iterator to begin traversing the PtrList. More...
 
const_iterator end () const
 Return an const_iterator to end traversing the PtrList. More...
 
template<class T >
 PtrList ()
 
template<class T >
 PtrList (const label s)
 
template<class T >
 PtrList (const PtrList< T > &a)
 
template<class T >
 PtrList (const Xfer< PtrList< T > > &lst)
 
template<class T >
 PtrList (PtrList< T > &a, bool reUse)
 
template<class T >
 PtrList (const SLPtrList< T > &sll)
 
template<class T >
 PtrList (Istream &is)
 

Static Public Member Functions

static void verbose (const bool on=true)
 Enable/disable verbose information about the progress. More...
 

Private Member Functions

bool blockLabelsOK (const label blockLabel, const pointField &points, const cellShape &blockShape) const
 
bool patchLabelsOK (const label patchLabel, const pointField &points, const faceList &patchShapes) const
 
bool readPatches (const dictionary &meshDescription, faceListList &tmpBlocksPatches, wordList &patchNames, wordList &patchTypes, wordList &nbrPatchNames)
 
bool readBoundary (const dictionary &meshDescription, wordList &patchNames, faceListList &tmpBlocksPatches, PtrList< dictionary > &patchDicts)
 
void createCellShapes (cellShapeList &tmpBlockCells)
 
polyMeshcreateTopology (const IOdictionary &, const word &regionName)
 
void checkBlockMesh (const polyMesh &) const
 
void calcMergeInfo ()
 Determine the merge info and the final number of cells/points. More...
 
void calcMergeInfoFast ()
 Determine the merge info and the final number of cells/points. More...
 
faceList createPatchFaces (const polyPatch &patchTopologyFaces) const
 
void createPoints () const
 
void createCells () const
 
void createPatches () const
 
 blockMesh (const blockMesh &)
 As copy (not implemented) More...
 

Private Attributes

pointField blockPointField_
 Point field defining the block mesh (corners) More...
 
curvedEdgeList edges_
 The list of curved edges. More...
 
scalar scaleFactor_
 The scaling factor to convert to metres. More...
 
polyMeshtopologyPtr_
 The blocks themselves (the topology) as a polyMesh. More...
 
label nPoints_
 
label nCells_
 The sum of all cells in each block. More...
 
labelList blockOffsets_
 The point offset added to each block. More...
 
labelList mergeList_
 The merge points information. More...
 
pointField points_
 
cellShapeList cells_
 
faceListList patches_
 

Static Private Attributes

static bool verboseOutput
 Switch for verbose output. More...
 

Additional Inherited Members

- Public Types inherited from PtrList
typedef T value_type
 Type of values the PtrList contains. More...
 
typedef Treference
 Type that can be used for storing into PtrList::value_type objects. More...
 
- Data Fields inherited from PtrList
const typedef Tconst_reference
 Type that can be used for storing into constant PtrList::value_type. More...
 
- Protected Member Functions inherited from PtrList
template<class INew >
void read (Istream &, const INew &inewt)
 Read from Istream using given Istream constructor class. More...
 

Detailed Description

A multi-block mesh generator.

Note
The vertices, cells and patches for filling the blocks are demand-driven.
Source files

Definition at line 58 of file blockMesh.H.

Constructor & Destructor Documentation

◆ blockMesh() [1/2]

blockMesh ( const blockMesh )
private

As copy (not implemented)

◆ blockMesh() [2/2]

blockMesh ( const IOdictionary dict,
const word regionName 
)

Construct from IOdictionary.

Definition at line 41 of file blockMesh.C.

References blockMesh::calcMergeInfo(), blockMesh::calcMergeInfoFast(), and dict.

Here is the call graph for this function:

◆ ~blockMesh()

~blockMesh ( )

Destructor.

Definition at line 62 of file blockMesh.C.

Member Function Documentation

◆ blockLabelsOK()

bool blockLabelsOK ( const label  blockLabel,
const pointField points,
const cellShape blockShape 
) const
private

Definition at line 150 of file blockMeshCheck.C.

References Foam::endl(), forAll, points, and WarningInFunction.

Here is the call graph for this function:

◆ patchLabelsOK()

bool patchLabelsOK ( const label  patchLabel,
const pointField points,
const faceList patchShapes 
) const
private

Definition at line 185 of file blockMeshCheck.C.

References Foam::endl(), f(), forAll, patchFaces(), points, and WarningInFunction.

Here is the call graph for this function:

◆ readPatches()

bool readPatches ( const dictionary meshDescription,
faceListList tmpBlocksPatches,
wordList patchNames,
wordList patchTypes,
wordList nbrPatchNames 
)
private

◆ readBoundary()

bool readBoundary ( const dictionary meshDescription,
wordList patchNames,
faceListList tmpBlocksPatches,
PtrList< dictionary > &  patchDicts 
)
private

◆ createCellShapes()

void createCellShapes ( cellShapeList tmpBlockCells)
private

Definition at line 235 of file blockMeshTopology.C.

References Foam::endl(), forAll, Foam::mag(), List::setSize(), PtrList::size(), and WarningInFunction.

Here is the call graph for this function:

◆ createTopology()

Foam::polyMesh * createTopology ( const IOdictionary meshDescription,
const word regionName 
)
private

◆ checkBlockMesh()

void checkBlockMesh ( const polyMesh bm) const
private

◆ calcMergeInfo()

void calcMergeInfo ( )
private

◆ calcMergeInfoFast()

void calcMergeInfoFast ( )
private

◆ createPatchFaces()

Foam::faceList createPatchFaces ( const polyPatch patchTopologyFaces) const
private

Definition at line 145 of file blockMeshCreate.C.

References forAll, patchFaces(), quadFace(), List::setSize(), and PtrList::size().

Here is the call graph for this function:

◆ createPoints()

void createPoints ( ) const
private

◆ createCells()

void createCells ( ) const
private

Definition at line 99 of file blockMeshCreate.C.

References Foam::endl(), forAll, Foam::hex(), Foam::Info, and cellModeller::lookup().

Here is the call graph for this function:

◆ createPatches()

void createPatches ( ) const
private

Definition at line 259 of file blockMeshCreate.C.

References Foam::endl(), forAll, Foam::Info, and PtrList::size().

Here is the call graph for this function:

◆ ClassName()

ClassName ( "blockMesh"  )

◆ blockPointField()

const Foam::pointField & blockPointField ( ) const

Reference to point field defining the block mesh.

these points have not been scaled by scaleFactor

Definition at line 76 of file blockMesh.C.

◆ topology()

const Foam::polyMesh & topology ( ) const

Return the blockMesh topology as a polyMesh.

Definition at line 82 of file blockMesh.C.

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

Referenced by blockMesh::calcMergeInfo(), blockMesh::calcMergeInfoFast(), and main().

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

◆ edges()

const curvedEdgeList& edges ( ) const
inline

Return the curved edges.

Definition at line 180 of file blockMesh.H.

References blockMesh::edges_.

◆ scaleFactor()

Foam::scalar scaleFactor ( ) const

The scaling factor used to convert to metres.

Definition at line 112 of file blockMesh.C.

◆ points()

const Foam::pointField & points ( ) const

The points for the entire mesh.

these points have been scaled by scaleFactor

Definition at line 118 of file blockMesh.C.

Referenced by blockMesh::calcMergeInfo(), blockMesh::calcMergeInfoFast(), blockMesh::checkBlockMesh(), and main().

Here is the caller graph for this function:

◆ cells()

const Foam::cellShapeList & cells ( ) const

Return cell shapes list.

Definition at line 129 of file blockMesh.C.

Referenced by blockMesh::checkBlockMesh(), and main().

Here is the caller graph for this function:

◆ patches()

const Foam::faceListList & patches ( ) const

Return the patch face lists.

Definition at line 140 of file blockMesh.C.

Referenced by blockMesh::checkBlockMesh(), and main().

Here is the caller graph for this function:

◆ patchDicts()

Foam::PtrList< Foam::dictionary > patchDicts ( ) const

Get patch information from the topology mesh.

Definition at line 95 of file blockMesh.C.

References forAll, patchDicts, PtrList::size(), and OStringStream::str().

Referenced by main().

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

◆ patchNames()

Foam::wordList patchNames ( ) const

Return patch names.

Definition at line 151 of file blockMesh.C.

Referenced by main().

Here is the caller graph for this function:

◆ numZonedBlocks()

Foam::label numZonedBlocks ( ) const

Number of blocks with specified zones.

Definition at line 169 of file blockMesh.C.

References forAll.

Referenced by main().

Here is the caller graph for this function:

◆ clearGeom()

void clearGeom ( )

Clear geometry (internal points, cells, boundaryPatches)

Definition at line 283 of file blockMeshCreate.C.

References forAll.

◆ verbose()

void verbose ( const bool  on = true)
static

Enable/disable verbose information about the progress.

Definition at line 70 of file blockMesh.C.

Referenced by main().

Here is the caller graph for this function:

◆ writeTopology()

void writeTopology ( Ostream os) const

Writes edges of blockMesh in OBJ format.

Definition at line 185 of file blockMesh.C.

References Foam::e, Foam::endl(), forAll, Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().

Referenced by main().

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

Field Documentation

◆ verboseOutput

bool verboseOutput
staticprivate

◆ blockPointField_

pointField blockPointField_
private

Point field defining the block mesh (corners)

Definition at line 68 of file blockMesh.H.

◆ edges_

curvedEdgeList edges_
private

The list of curved edges.

Definition at line 71 of file blockMesh.H.

Referenced by blockMesh::edges().

◆ scaleFactor_

scalar scaleFactor_
private

The scaling factor to convert to metres.

Definition at line 74 of file blockMesh.H.

Referenced by blockMesh::createPoints().

◆ topologyPtr_

polyMesh* topologyPtr_
private

The blocks themselves (the topology) as a polyMesh.

Definition at line 77 of file blockMesh.H.

◆ nPoints_

label nPoints_
private

◆ nCells_

label nCells_
private

The sum of all cells in each block.

Definition at line 82 of file blockMesh.H.

Referenced by blockMesh::calcMergeInfo(), and blockMesh::calcMergeInfoFast().

◆ blockOffsets_

labelList blockOffsets_
private

The point offset added to each block.

Definition at line 85 of file blockMesh.H.

Referenced by blockMesh::calcMergeInfo(), blockMesh::calcMergeInfoFast(), and blockMesh::createPoints().

◆ mergeList_

labelList mergeList_
private

The merge points information.

Definition at line 88 of file blockMesh.H.

Referenced by blockMesh::calcMergeInfo(), blockMesh::calcMergeInfoFast(), and blockMesh::createPoints().

◆ points_

pointField points_
mutableprivate

Definition at line 90 of file blockMesh.H.

Referenced by blockMesh::createPoints().

◆ cells_

cellShapeList cells_
mutableprivate

Definition at line 92 of file blockMesh.H.

◆ patches_

faceListList patches_
mutableprivate

Definition at line 94 of file blockMesh.H.


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