cellClassification Class Reference

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

Inheritance diagram for cellClassification:
[legend]
Collaboration diagram for cellClassification:
[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< label >
typedef SubList< label > subList
 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< label >
constexpr List () noexcept
 Default construct. More...
 
 List (const label len)
 Construct with given size. More...
 
 List (const label len, const label &val)
 Construct with given size and value for all elements. More...
 
 List (const label len, const Foam::zero)
 Construct with given size initializing all elements to zero. More...
 
 List (const Foam::one, const label &val)
 Construct with length=1, copying the value as the only content. More...
 
 List (const Foam::one, label &&val)
 Construct with length=1, moving the value as the only content. More...
 
 List (const Foam::one, const Foam::zero)
 Construct with length=1, initializing content to zero. More...
 
 List (const List< label > &a)
 Copy construct from list. More...
 
 List (const UList< label > &a)
 Copy construct contents from list. More...
 
 List (List< label > &a, bool reuse)
 Construct as copy or re-use as specified. More...
 
 List (const UList< label > &list, const labelUList &indices)
 Copy construct subset of list. More...
 
 List (const UList< label > &list, const FixedList< label, N > &indices)
 Copy construct subset of list. More...
 
 List (const FixedList< label, N > &list)
 Construct as copy of FixedList<T, N> More...
 
 List (const PtrList< label > &list)
 Construct as copy of PtrList<T> More...
 
 List (const SLList< label > &list)
 Construct as copy of SLList<T> More...
 
 List (const IndirectListBase< label, Addr > &list)
 Construct as copy of IndirectList contents. More...
 
 List (std::initializer_list< label > list)
 Construct from an initializer list. More...
 
 List (List< label > &&list)
 Move construct from List. More...
 
 List (DynamicList< label, SizeMin > &&list)
 Move construct from DynamicList. More...
 
 List (SortableList< label > &&list)
 Move construct from SortableList. More...
 
 List (SLList< label > &&list)
 Move construct from SLList. More...
 
 List (Istream &is)
 Construct from Istream. More...
 
autoPtr< List< label > > clone () const
 Clone. More...
 
 ~List ()
 Destructor. More...
 
void clear ()
 Clear the list, i.e. set size to zero. More...
 
void resize (const label len)
 Adjust allocated size of list. More...
 
void resize (const label len, const label &val)
 Adjust allocated size of list and set val for new elements. More...
 
void resize (const label newLen)
 
void resize_nocopy (const label len)
 Adjust allocated size of list without necessarily. More...
 
void setSize (const label n)
 Alias for resize() More...
 
void setSize (const label n, const label &val)
 Alias for resize() More...
 
void append (const label &val)
 Append an element at the end of the list. More...
 
void append (label &&val)
 Move append an element at the end of the list. More...
 
void append (const UList< label > &list)
 Append a List to the end of this list. More...
 
void append (const IndirectListBase< label, Addr > &list)
 Append IndirectList contents at the end of this list. More...
 
label appendUniq (const label &val)
 Append an element if not already in the list. More...
 
void transfer (List< label > &list)
 
void transfer (DynamicList< label, SizeMin > &list)
 
void transfer (SortableList< label > &list)
 
label & newElmt (const label i)
 
void operator= (const UList< label > &a)
 Assignment to UList operator. Takes linear time. More...
 
void operator= (const List< label > &list)
 Assignment operator. Takes linear time. More...
 
void operator= (const SLList< label > &list)
 Assignment to SLList operator. Takes linear time. More...
 
void operator= (const IndirectListBase< label, Addr > &list)
 Assignment from IndirectList. Takes linear time. More...
 
void operator= (const FixedList< label, N > &list)
 Copy assignment from FixedList. More...
 
void operator= (std::initializer_list< label > list)
 Assignment to an initializer list. More...
 
void operator= (const label &val)
 Assignment of all entries to the given value. More...
 
void operator= (const Foam::zero)
 Assignment of all entries to zero. More...
 
void operator= (List< label > &&list)
 Move assignment. Takes constant time. More...
 
void operator= (DynamicList< label, SizeMin > &&list)
 Move assignment. Takes constant time. More...
 
void operator= (SortableList< label > &&list)
 Move assignment. Takes constant time. More...
 
void operator= (SLList< label > &&list)
 Move assignment. Takes constant time. More...
 
IstreamreadList (Istream &is)
 Read List from Istream, discarding contents of existing List. More...
 
IstreamreadList (Istream &is)
 
IstreamreadList (Istream &is)
 
void shallowCopy (const UList< label > &)=delete
 No shallowCopy permitted. More...
 
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type set (const label i, bool val=true)
 A bitSet::set() method for a list of bool. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from List< label >
static const List< label > & null ()
 Return a null List. More...
 

Detailed Description

'Cuts' a mesh with a surface.

Divides cells into three types

  • cut, i.e. any of the edges of the cell is split or any edge of the surface pierces any of the faces of the cell.
  • outside: cell can be reached by Meshwave from any of the supplied outside points (without crossing any cut cell)
  • inside: all other.

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
  • point classification:
    • point used by meshType cells only
    • point used by non-meshType cells only
    • point used by both types ('mixed')
  • hanging cells: meshType cells using mixed points only. These cells would have all their vertices on the surface when extracting the meshType cells.
  • regionEdges: edges where the cells using it are of mixed type. Or more precise when walking around the edge and looking at the different types of the cells there are more than two regions with same type.

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)

  • regionPoints: like regionEdges but now for points. Points where subsetting the mesh would cause a multiply connected outside surface (connected across point, not edge)
Source files

Definition at line 117 of file cellClassification.H.

Member Enumeration Documentation

◆ cType

enum cType

Type of cell.

Enumerator
NOTSET 
INSIDE 
OUTSIDE 
CUT 

Definition at line 127 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 138 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

◆ ClassName()

ClassName ( "cellClassification"  )

◆ mesh()

const polyMesh& mesh ( ) const
inline

Definition at line 220 of file cellClassification.H.

◆ 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().

Here is the call 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 Foam::endl(), forAll, and Foam::Pout.

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 Foam::endl(), pFaces, 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 871 of file cellClassification.C.

References Foam::BitOps::count(), Foam::endl(), and os().

Here is the call graph for this function:

◆ operator=()

void operator= ( const cellClassification rhs)

Definition at line 883 of file cellClassification.C.

References List< T >::operator=().

Here is the call graph for this function:

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