Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
cellClassification Class Reference

'Cuts' a mesh with a surface. More...

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

Public Types

enum  cType { NOTSET, INSIDE, OUTSIDE, CUT }
 Type of cell. More...
 
enum  pointStatus { UNSET, MESH, NONMESH, MIXED }
 Enumeration defining the whether points are use by cells of. More...
 
- Public Types inherited from List
typedef SubList< TsubList
 Declare type of subList. More...
 

Public Member Functions

 ClassName ("cellClassification")
 
 cellClassification (const polyMesh &mesh, const meshSearch &meshQuery, const triSurfaceSearch &surfQuery, const pointField &outsidePoints)
 Construct from mesh and surface and point(s) on outside. More...
 
 cellClassification (const polyMesh &mesh, const labelList &cellType)
 Construct from mesh and type for every cell. More...
 
 cellClassification (const cellClassification &)
 Construct as copy. More...
 
const polyMeshmesh () const
 
label trimCutCells (const label nLayers, const label meshType, const label fillType)
 
label growSurface (const label meshType, const label fillType)
 Sets vertex neighbours of meshType cells to fillType. More...
 
label fillHangingCells (const label meshType, const label fillType, const label maxIter)
 Find hanging cells (cells with all points on outside) and set their. More...
 
label fillRegionEdges (const label meshType, const label fillType, const label maxIter)
 Find regionEdges and fill one neighbour. Iterate until nothing. More...
 
label fillRegionPoints (const label meshType, const label fillType, const label maxIter)
 Find regionPoints and fill all neighbours. Iterate until nothing. More...
 
void writeStats (Ostream &os) const
 Write statistics on cell types to Ostream. More...
 
void operator= (const cellClassification &)
 
- Public Member Functions inherited from List
 List ()
 Null constructor. More...
 
 List (const label)
 Construct with given size. More...
 
 List (const label, const T &)
 Construct with given size and value for all elements. More...
 
 List (const List< T > &)
 Copy constructor. More...
 
 List (const Xfer< List< T > > &)
 Construct by transferring the parameter contents. More...
 
 List (List< T > &, bool reUse)
 Construct as copy or re-use as specified. More...
 
 List (const UList< T > &, const labelUList &mapAddressing)
 Construct as subset. More...
 
template<class InputIterator >
 List (InputIterator first, InputIterator last)
 Construct given start and end iterators. More...
 
template<unsigned Size>
 List (const FixedList< T, Size > &)
 Construct as copy of FixedList<T, Size> More...
 
 List (const PtrList< T > &)
 Construct as copy of PtrList<T> More...
 
 List (const SLList< T > &)
 Construct as copy of SLList<T> More...
 
 List (const UIndirectList< T > &)
 Construct as copy of UIndirectList<T> More...
 
 List (const BiIndirectList< T > &)
 Construct as copy of BiIndirectList<T> More...
 
 List (Istream &)
 Construct from Istream. More...
 
autoPtr< List< T > > clone () const
 Clone. More...
 
 ~List ()
 Destructor. More...
 
label size () const
 Return the number of elements in the UList. More...
 
void resize (const label)
 Alias for setSize(const label) More...
 
void resize (const label, const T &)
 Alias for setSize(const label, const T&) More...
 
void setSize (const label)
 Reset size of List. More...
 
void setSize (const label, const T &)
 Reset size of List and value for new elements. More...
 
void clear ()
 Clear the list, i.e. set size to zero. More...
 
void append (const T &)
 Append an element at the end of the list. More...
 
void append (const UList< T > &)
 Append a List at the end of this list. More...
 
void append (const UIndirectList< T > &)
 Append a UIndirectList at the end of this list. More...
 
void transfer (List< T > &)
 Transfer the contents of the argument List into this list. More...
 
template<unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
void transfer (DynamicList< T, SizeInc, SizeMult, SizeDiv > &)
 Transfer the contents of the argument List into this list. More...
 
void transfer (SortableList< T > &)
 Transfer the contents of the argument List into this list. More...
 
Xfer< List< T > > xfer ()
 Transfer contents to the Xfer container. More...
 
TnewElmt (const label)
 Return subscript-checked element of UList. More...
 
void operator= (const UList< T > &)
 Assignment from UList operator. Takes linear time. More...
 
void operator= (const List< T > &)
 Assignment operator. Takes linear time. More...
 
void operator= (const SLList< T > &)
 Assignment from SLList operator. Takes linear time. More...
 
void operator= (const UIndirectList< T > &)
 Assignment from UIndirectList operator. Takes linear time. More...
 
void operator= (const BiIndirectList< T > &)
 Assignment from BiIndirectList operator. Takes linear time. More...
 
void operator= (const T &)
 Assignment of all entries to the given value. More...
 
template<class T >
 List (const label s)
 
template<class T >
 List (const label s, const T &a)
 
template<class T >
 List (const List< T > &a)
 
template<class T >
 List (const Xfer< List< T > > &lst)
 
template<class T >
 List (List< T > &a, bool reUse)
 
template<class T >
 List (const UList< T > &a, const labelUList &map)
 
template<class T >
 List (const PtrList< T > &lst)
 
template<class T >
 List (const SLList< T > &lst)
 
template<class T >
 List (const UIndirectList< T > &lst)
 
template<class T >
 List (const BiIndirectList< T > &lst)
 
template<class T >
void transfer (List< T > &a)
 
template<class T >
void transfer (SortableList< T > &a)
 
template<class T >
 List ()
 
template<class T >
 List (Istream &is)
 

Private Member Functions

boolList markFaces (const triSurfaceSearch &) const
 Mark all faces intersected by or intersecting surface. More...
 
void markCells (const meshSearch &queryMesh, const boolList &piercedFace, const pointField &outsidePts)
 Divide cells into cut/inside/outside by using MeshWave from cut. More...
 
void classifyPoints (const label meshType, const labelList &cellType, List< pointStatus > &pointSide) const
 Use cell status to classify points as being internal to meshType,. More...
 
bool usesMixedPointsOnly (const List< pointStatus > &, const label cellI) const
 Return true if cell uses only points with status=mixed. More...
 
void getMeshOutside (const label meshType, faceList &, labelList &) const
 Get faces (and its 'owner') inbetween cells of differing type. More...
 

Static Private Member Functions

static label count (const labelList &elems, const label elem)
 Count number of occurrences of elem in list. More...
 

Private Attributes

const polyMeshmesh_
 Reference to mesh. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from List
static const List< T > & null ()
 Return a null List. More...
 
- Protected Member Functions inherited from List
void size (const label)
 Override size to be inconsistent with allocated storage. More...
 

Detailed Description

'Cuts' a mesh with a surface.

Divides cells into three types

Used in various meshing programs.

Has various utility functions to deal with 'features' on this level where the mesh still has all inside and outside cells.

Concepts

Seen from above:

Ok:
     A | A
       |
     --+---
       |
     B | B

Not ok:
     A | B
       |
    ---+---
       |
     B | A

because this latter situation would cause the surface after subsetting type A or B to be multiply connected across this edge. And also when snapping the edge end points to the surface it might cause some twisted faces if the surface is normal to the edge (and smoothing the surface would not help since the points on the edge would be 'pulled' from two different sides)

Source files

Definition at line 115 of file cellClassification.H.

Member Enumeration Documentation

◆ cType

enum cType

Type of cell.

Enumerator
NOTSET 
INSIDE 
OUTSIDE 
CUT 

Definition at line 125 of file cellClassification.H.

◆ pointStatus

Enumeration defining the whether points are use by cells of.

a certain type.

Enumerator
UNSET 
MESH 
NONMESH 
MIXED 

Definition at line 136 of file cellClassification.H.

Constructor & Destructor Documentation

◆ cellClassification() [1/3]

cellClassification ( const polyMesh mesh,
const meshSearch meshQuery,
const triSurfaceSearch surfQuery,
const pointField outsidePoints 
)

Construct from mesh and surface and point(s) on outside.

Definition at line 482 of file cellClassification.C.

◆ cellClassification() [2/3]

cellClassification ( const polyMesh mesh,
const labelList cellType 
)

Construct from mesh and type for every cell.

Used to be able to reuse filling routines below.

Definition at line 503 of file cellClassification.C.

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

Here is the call graph for this function:

◆ cellClassification() [3/3]

Construct as copy.

Definition at line 521 of file cellClassification.C.

Member Function Documentation

◆ count()

Foam::label count ( const labelList elems,
const label  elem 
)
staticprivate

Count number of occurrences of elem in list.

Definition at line 51 of file cellClassification.C.

References forAll.

◆ markFaces()

Foam::boolList markFaces ( const triSurfaceSearch search) const
private

◆ markCells()

void markCells ( const meshSearch queryMesh,
const boolList piercedFace,
const pointField outsidePts 
)
private

Divide cells into cut/inside/outside by using MeshWave from cut.

faces. No check is done on whether outsidePts are in different domains.

Definition at line 248 of file cellClassification.C.

References MeshWave< Type, TrackingData >::allCellInfo(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, meshSearch::findCell(), forAll, HashSet< Key, Hash >::insert(), Foam::nl, Foam::returnReduce(), List::size(), and HashTable::toc().

Here is the call graph for this function:

◆ classifyPoints()

void classifyPoints ( const label  meshType,
const labelList cellType,
List< pointStatus > &  pointSide 
) const
private

Use cell status to classify points as being internal to meshType,.

internal to non-meshType or on border of both.

Definition at line 349 of file cellClassification.C.

References forAll, MESH, List::setSize(), and Foam::type().

Here is the call graph for this function:

◆ usesMixedPointsOnly()

bool usesMixedPointsOnly ( const List< pointStatus > &  pointSide,
const label  cellI 
) const
private

Return true if cell uses only points with status=mixed.

Definition at line 399 of file cellClassification.C.

References f(), and forAll.

Here is the call graph for this function:

◆ getMeshOutside()

void getMeshOutside ( const label  meshType,
faceList outsideFaces,
labelList outsideOwner 
) const
private

Get faces (and its 'owner') inbetween cells of differing type.

(meshType and non-meshType).

Definition at line 427 of file cellClassification.C.

References List::setSize().

Here is the call graph for this function:

◆ ClassName()

ClassName ( "cellClassification"  )

◆ mesh()

const polyMesh& mesh ( ) const
inline

Definition at line 218 of file cellClassification.H.

References cellClassification::mesh_.

◆ trimCutCells()

Foam::label trimCutCells ( const label  nLayers,
const label  meshType,
const label  fillType 
)

Definition at line 534 of file cellClassification.C.

References cellClassification::CUT, forAll, and Foam::type().

Referenced by surfaceSets::getSurfaceSets().

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

◆ growSurface()

Foam::label growSurface ( const label  meshType,
const label  fillType 
)

Sets vertex neighbours of meshType cells to fillType.

Definition at line 620 of file cellClassification.C.

References forAll, and Foam::type().

Here is the call graph for this function:

◆ fillHangingCells()

Foam::label fillHangingCells ( const label  meshType,
const label  fillType,
const label  maxIter 
)

Find hanging cells (cells with all points on outside) and set their.

type to fillType. Iterate until nothing changed. Returns total number of cells changed (in all iterations)

Definition at line 677 of file cellClassification.C.

References Foam::endl(), forAll, and Foam::Pout.

Here is the call graph for this function:

◆ fillRegionEdges()

Foam::label fillRegionEdges ( const label  meshType,
const label  fillType,
const label  maxIter 
)

Find regionEdges and fill one neighbour. Iterate until nothing.

changes. Returns total number of cells changed.

Definition at line 734 of file cellClassification.C.

References PrimitivePatch< Face, FaceList, PointField, PointType >::edgeFaces(), Foam::endl(), forAll, Foam::Pout, and List::size().

Here is the call graph for this function:

◆ fillRegionPoints()

Foam::label fillRegionPoints ( const label  meshType,
const label  fillType,
const label  maxIter 
)

Find regionPoints and fill all neighbours. Iterate until nothing.

changes. Returns total number of cells changed.

Definition at line 803 of file cellClassification.C.

References PrimitivePatch< Face, FaceList, PointField, PointType >::checkPointManifold(), Foam::endl(), forAll, forAllConstIter(), PrimitivePatch< Face, FaceList, PointField, PointType >::meshPointMap(), pFaces, PrimitivePatch< Face, FaceList, PointField, PointType >::pointFaces(), and Foam::Pout.

Here is the call graph for this function:

◆ writeStats()

void writeStats ( Ostream os) const

Write statistics on cell types to Ostream.

Definition at line 872 of file cellClassification.C.

References Foam::endl().

Here is the call graph for this function:

◆ operator=()

void operator= ( const cellClassification rhs)

Definition at line 884 of file cellClassification.C.

References List::operator=().

Here is the call graph for this function:

Field Documentation

◆ mesh_

const polyMesh& mesh_
private

Reference to mesh.

Definition at line 149 of file cellClassification.H.

Referenced by cellClassification::mesh().


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