Functions | Variables
Foam::meshTools Namespace Reference

Collection of static functions to do various simple mesh related things. More...

Functions

bool visNormal (const vector &n, const vectorField &faceNormals, const labelList &faceLabels)
 
vectorField calcBoxPointNormals (const primitivePatch &pp)
 
vector normEdgeVec (const primitiveMesh &, const label edgeI)
 
void writeOBJ (Ostream &os, const point &pt)
 
void writeOBJ (Ostream &os, const UList< point > &pts)
 
void writeOBJ (Ostream &os, const triad &t, const point &origin)
 
void writeOBJ (Ostream &os, const point &p1, const point &p2, label &count)
 
void writeOBJ (Ostream &os, const point &p1, const point &p2)
 
void writeOBJ (Ostream &os, const treeBoundBox &bb)
 
template<class FaceType >
void writeOBJ (Ostream &os, const UList< FaceType > &faces, const UList< point > &points, const labelList &faceLabels)
 
template<class FaceType >
void writeOBJ (Ostream &os, const UList< FaceType > &faces, const UList< point > &points)
 
void writeOBJ (Ostream &os, const cellList &cells, const faceList &faces, const UList< point > &points, const labelList &cellLabels)
 
bool edgeOnCell (const primitiveMesh &mesh, const label celli, const label edgeI)
 
bool edgeOnFace (const primitiveMesh &mesh, const label facei, const label edgeI)
 
bool faceOnCell (const primitiveMesh &mesh, const label celli, const label facei)
 
label findEdge (const edgeList &edges, const labelList &candidates, const label v0, const label v1)
 
label findEdge (const primitiveMesh &mesh, const label v0, const label v1)
 
label getSharedEdge (const primitiveMesh &mesh, const label f0, const label f1)
 
label getSharedFace (const primitiveMesh &mesh, const label cell0, const label cell1)
 
void getEdgeFaces (const primitiveMesh &mesh, const label celli, const label edgeI, label &face0, label &face1)
 
label otherEdge (const primitiveMesh &mesh, const labelList &edgeLabels, const label thisEdgeI, const label thisVertI)
 
label otherFace (const primitiveMesh &mesh, const label celli, const label facei, const label edgeI)
 
label otherCell (const primitiveMesh &mesh, const label celli, const label facei)
 
label walkFace (const primitiveMesh &mesh, const label facei, const label startEdgeI, const label startVertI, const label nEdges)
 
void constrainToMeshCentre (const polyMesh &mesh, point &pt)
 
void constrainToMeshCentre (const polyMesh &mesh, pointField &pt)
 
void constrainDirection (const polyMesh &mesh, const Vector< label > &dirs, vector &d)
 
void constrainDirection (const polyMesh &mesh, const Vector< label > &dirs, vectorField &d)
 
void getParallelEdges (const primitiveMesh &mesh, const label celli, const label e0, label &e1, label &e2, label &e3)
 
vector edgeToCutDir (const primitiveMesh &mesh, const label celli, const label edgeI)
 
label cutDirToEdge (const primitiveMesh &mesh, const label celli, const vector &cutDir)
 

Variables

static const label mXmYmZ = 0
 
static const label pXmYmZ = 1
 
static const label mXpYmZ = 2
 
static const label pXpYmZ = 3
 
static const label mXmYpZ = 4
 
static const label pXmYpZ = 5
 
static const label mXpYpZ = 6
 
static const label pXpYpZ = 7
 
static const label mXmYmZMask = 1 << mXmYmZ
 
static const label pXmYmZMask = 1 << pXmYmZ
 
static const label mXpYmZMask = 1 << mXpYmZ
 
static const label pXpYmZMask = 1 << pXpYmZ
 
static const label mXmYpZMask = 1 << mXmYpZ
 
static const label pXmYpZMask = 1 << pXmYpZ
 
static const label mXpYpZMask = 1 << mXpYpZ
 
static const label pXpYpZMask = 1 << pXpYpZ
 

Detailed Description

Collection of static functions to do various simple mesh related things.

Source files

Function Documentation

◆ visNormal()

bool visNormal ( const vector n,
const vectorField faceNormals,
const labelList faceLabels 
)

Definition at line 30 of file meshTools.C.

References faceNormals(), forAll, and n.

Referenced by calcBoxPointNormals().

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

◆ calcBoxPointNormals()

Foam::vectorField calcBoxPointNormals ( const primitivePatch pp)

◆ normEdgeVec()

Foam::vector normEdgeVec ( const primitiveMesh mesh,
const label  edgeI 
)

Definition at line 186 of file meshTools.C.

References mesh.

Referenced by edgeToCutDir(), and cellLooper::getMisAlignedEdge().

Here is the caller graph for this function:

◆ writeOBJ() [1/9]

void writeOBJ ( Ostream os,
const point pt 
)

◆ writeOBJ() [2/9]

void writeOBJ ( Ostream os,
const UList< point > &  pts 
)

Definition at line 206 of file meshTools.C.

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

Here is the call graph for this function:

◆ writeOBJ() [3/9]

void writeOBJ ( Ostream os,
const triad t,
const point origin 
)

Definition at line 221 of file meshTools.C.

References forAll, os(), and writeOBJ().

Here is the call graph for this function:

◆ writeOBJ() [4/9]

void writeOBJ ( Ostream os,
const point p1,
const point p2,
label &  count 
)

Definition at line 235 of file meshTools.C.

References Foam::BitOps::count(), Foam::endl(), Foam::nl, os(), Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().

Here is the call graph for this function:

◆ writeOBJ() [5/9]

void writeOBJ ( Ostream os,
const point p1,
const point p2 
)

Definition at line 251 of file meshTools.C.

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

Here is the call graph for this function:

◆ writeOBJ() [6/9]

void writeOBJ ( Ostream os,
const treeBoundBox bb 
)

Definition at line 266 of file meshTools.C.

References Foam::constant::electromagnetic::e, Foam::nl, os(), treeBoundBox::points(), and writeOBJ().

Here is the call graph for this function:

◆ writeOBJ() [7/9]

void writeOBJ ( Ostream os,
const UList< FaceType > &  faces,
const UList< point > &  points,
const labelList faceLabels 
)

Definition at line 24 of file meshToolsTemplates.C.

References Foam::endl(), f(), forAll, os(), points, and writeOBJ().

Here is the call graph for this function:

◆ writeOBJ() [8/9]

void writeOBJ ( Ostream os,
const UList< FaceType > &  faces,
const UList< point > &  points 
)

Definition at line 60 of file meshToolsTemplates.C.

References forAll, os(), points, UList::size(), and writeOBJ().

Here is the call graph for this function:

◆ writeOBJ() [9/9]

void writeOBJ ( Ostream os,
const cellList cells,
const faceList faces,
const UList< point > &  points,
const labelList cellLabels 
)

Definition at line 281 of file meshTools.C.

References cells, HashSet::insert(), os(), points, and writeOBJ().

Here is the call graph for this function:

◆ edgeOnCell()

bool edgeOnCell ( const primitiveMesh mesh,
const label  celli,
const label  edgeI 
)

Definition at line 301 of file meshTools.C.

References mesh.

Referenced by cellLooper::getVertEdgesNonFace().

Here is the caller graph for this function:

◆ edgeOnFace()

bool edgeOnFace ( const primitiveMesh mesh,
const label  facei,
const label  edgeI 
)

Definition at line 312 of file meshTools.C.

References mesh.

Referenced by cellFeatures::isFeatureVertex().

Here is the caller graph for this function:

◆ faceOnCell()

bool faceOnCell ( const primitiveMesh mesh,
const label  celli,
const label  facei 
)

Definition at line 323 of file meshTools.C.

References mesh.

Referenced by getEdgeFaces(), and cellLooper::getVertFacesNonEdge().

Here is the caller graph for this function:

◆ findEdge() [1/2]

Foam::label findEdge ( const edgeList edges,
const labelList candidates,
const label  v0,
const label  v1 
)

Definition at line 352 of file meshTools.C.

References Foam::constant::electromagnetic::e, and forAll.

Referenced by edgeVertex::cutPairToEdge(), faceCollapser::setRefinement(), and directionInfo::updateCell().

Here is the caller graph for this function:

◆ findEdge() [2/2]

Foam::label findEdge ( const primitiveMesh mesh,
const label  v0,
const label  v1 
)

Definition at line 375 of file meshTools.C.

References Foam::constant::electromagnetic::e, forAll, and mesh.

◆ getSharedEdge()

Foam::label getSharedEdge ( const primitiveMesh mesh,
const label  f0,
const label  f1 
)

Definition at line 401 of file meshTools.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, and mesh.

Here is the call graph for this function:

◆ getSharedFace()

Foam::label getSharedFace ( const primitiveMesh mesh,
const label  cell0,
const label  cell1 
)

Definition at line 434 of file meshTools.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, and mesh.

Referenced by undoableMeshCutter::getSplitFaces().

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

◆ getEdgeFaces()

void getEdgeFaces ( const primitiveMesh mesh,
const label  celli,
const label  edgeI,
label &  face0,
label &  face1 
)

Definition at line 472 of file meshTools.C.

References Foam::abort(), faceOnCell(), Foam::FatalError, FatalErrorInFunction, forAll, and mesh.

Referenced by hexCellLooper::cut(), topoCellLooper::cut(), directionInfo::edgeToFaceIndex(), cellLooper::getVertFacesNonEdge(), and otherFace().

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

◆ otherEdge()

Foam::label otherEdge ( const primitiveMesh mesh,
const labelList edgeLabels,
const label  thisEdgeI,
const label  thisVertI 
)

Definition at line 514 of file meshTools.C.

References Foam::abort(), Foam::constant::electromagnetic::e, Foam::FatalError, FatalErrorInFunction, forAll, and mesh.

Referenced by directionInfo::updateCell(), and walkFace().

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

◆ otherFace()

Foam::label otherFace ( const primitiveMesh mesh,
const label  celli,
const label  facei,
const label  edgeI 
)

◆ otherCell()

Foam::label otherCell ( const primitiveMesh mesh,
const label  celli,
const label  facei 
)

Definition at line 572 of file meshTools.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and mesh.

Here is the call graph for this function:

◆ walkFace()

Foam::label walkFace ( const primitiveMesh mesh,
const label  facei,
const label  startEdgeI,
const label  startVertI,
const label  nEdges 
)

Definition at line 596 of file meshTools.C.

References mesh, and otherEdge().

Referenced by edgeToCutDir(), directionInfo::edgeToFaceIndex(), and getParallelEdges().

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

◆ constrainToMeshCentre() [1/2]

void constrainToMeshCentre ( const polyMesh mesh,
point pt 
)

Definition at line 622 of file meshTools.C.

References Foam::max(), mesh, and Foam::min().

Referenced by twoDPointCorrector::correctDisplacement(), twoDPointCorrector::correctPoints(), particle< Type >::deviationFromMeshCentre(), InjectionModel< CloudType >::inject(), and InjectionModel< CloudType >::injectSteadyState().

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

◆ constrainToMeshCentre() [2/2]

void constrainToMeshCentre ( const polyMesh mesh,
pointField pt 
)

Definition at line 643 of file meshTools.C.

References forAll, Foam::max(), mesh, and Foam::min().

Here is the call graph for this function:

◆ constrainDirection() [1/2]

void constrainDirection ( const polyMesh mesh,
const Vector< label > &  dirs,
vector d 
)

◆ constrainDirection() [2/2]

void constrainDirection ( const polyMesh mesh,
const Vector< label > &  dirs,
vectorField d 
)

Definition at line 697 of file meshTools.C.

References forAll.

◆ getParallelEdges()

void getParallelEdges ( const primitiveMesh mesh,
const label  celli,
const label  e0,
label &  e1,
label &  e2,
label &  e3 
)

Definition at line 730 of file meshTools.C.

References mesh, otherFace(), and walkFace().

Referenced by cutDirToEdge().

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

◆ edgeToCutDir()

Foam::vector edgeToCutDir ( const primitiveMesh mesh,
const label  celli,
const label  edgeI 
)

Definition at line 756 of file meshTools.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, mesh, Vector< Cmpt >::normalise(), normEdgeVec(), otherFace(), and walkFace().

Referenced by cutDirToEdge().

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

◆ cutDirToEdge()

Foam::label cutDirToEdge ( const primitiveMesh mesh,
const label  celli,
const vector cutDir 
)

Definition at line 803 of file meshTools.C.

References Foam::abort(), edgeToCutDir(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAll, getParallelEdges(), HashSet::insert(), Foam::mag(), and mesh.

Referenced by hexCellLooper::cut().

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

Variable Documentation

◆ mXmYmZ

const label mXmYmZ = 0
static

Definition at line 62 of file meshTools.H.

Referenced by calcBoxPointNormals().

◆ pXmYmZ

const label pXmYmZ = 1
static

Definition at line 63 of file meshTools.H.

Referenced by calcBoxPointNormals().

◆ mXpYmZ

const label mXpYmZ = 2
static

Definition at line 64 of file meshTools.H.

Referenced by calcBoxPointNormals().

◆ pXpYmZ

const label pXpYmZ = 3
static

Definition at line 65 of file meshTools.H.

Referenced by calcBoxPointNormals().

◆ mXmYpZ

const label mXmYpZ = 4
static

Definition at line 67 of file meshTools.H.

Referenced by calcBoxPointNormals().

◆ pXmYpZ

const label pXmYpZ = 5
static

Definition at line 68 of file meshTools.H.

Referenced by calcBoxPointNormals().

◆ mXpYpZ

const label mXpYpZ = 6
static

Definition at line 69 of file meshTools.H.

Referenced by calcBoxPointNormals().

◆ pXpYpZ

const label pXpYpZ = 7
static

Definition at line 70 of file meshTools.H.

Referenced by calcBoxPointNormals().

◆ mXmYmZMask

const label mXmYmZMask = 1 << mXmYmZ
static

Definition at line 72 of file meshTools.H.

Referenced by calcBoxPointNormals().

◆ pXmYmZMask

const label pXmYmZMask = 1 << pXmYmZ
static

Definition at line 73 of file meshTools.H.

Referenced by calcBoxPointNormals().

◆ mXpYmZMask

const label mXpYmZMask = 1 << mXpYmZ
static

Definition at line 74 of file meshTools.H.

Referenced by calcBoxPointNormals().

◆ pXpYmZMask

const label pXpYmZMask = 1 << pXpYmZ
static

Definition at line 75 of file meshTools.H.

Referenced by calcBoxPointNormals().

◆ mXmYpZMask

const label mXmYpZMask = 1 << mXmYpZ
static

Definition at line 77 of file meshTools.H.

Referenced by calcBoxPointNormals().

◆ pXmYpZMask

const label pXmYpZMask = 1 << pXmYpZ
static

Definition at line 78 of file meshTools.H.

Referenced by calcBoxPointNormals().

◆ mXpYpZMask

const label mXpYpZMask = 1 << mXpYpZ
static

Definition at line 79 of file meshTools.H.

Referenced by calcBoxPointNormals().

◆ pXpYpZMask

const label pXpYpZMask = 1 << pXpYpZ
static

Definition at line 80 of file meshTools.H.

Referenced by calcBoxPointNormals().