OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

cellClassification Class Reference

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

Inheritance diagram for cellClassification:
Collaboration diagram for cellClassification:

List of all members.


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 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.
 cellClassification (const polyMesh &mesh, const labelList &cellType)
 Construct from mesh and type for every cell.
 cellClassification (const cellClassification &)
 Construct as copy.
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.
label fillHangingCells (const label meshType, const label fillType, const label maxIter)
 Find hanging cells (cells with all points on outside) and set their.
label fillRegionEdges (const label meshType, const label fillType, const label maxIter)
 Find regionEdges and fill one neighbour. Iterate until nothing.
label fillRegionPoints (const label meshType, const label fillType, const label maxIter)
 Find regionPoints and fill all neighbours. Iterate until nothing.
void writeStats (Ostream &os) const
 Write statistics on cell types to Ostream.
void operator= (const cellClassification &)

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 113 of file cellClassification.H.


Member Enumeration Documentation

enum cType

Type of cell.

Enumerator:
NOTSET 
INSIDE 
OUTSIDE 
CUT 

Definition at line 123 of file cellClassification.H.

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 ( 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 474 of file cellClassification.C.

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 495 of file cellClassification.C.

cellClassification ( const cellClassification cType  ) 

Construct as copy.

Definition at line 516 of file cellClassification.C.


Member Function Documentation

ClassName ( "cellClassification"   ) 

const polyMesh& mesh (  )  const [inline]

Definition at line 226 of file cellClassification.H.

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

Definition at line 529 of file cellClassification.C.

References cellClassification::CUT, forAll, cellClassification::MIXED, primitiveMesh::nPoints(), and primitiveMesh::pointCells().

Referenced by surfaceSets::getSurfaceSets().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Sets vertex neighbours of meshType cells to fillType.

Definition at line 615 of file cellClassification.C.

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 672 of file cellClassification.C.

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 729 of file cellClassification.C.

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 798 of file cellClassification.C.

void writeStats ( Ostream os  )  const

Write statistics on cell types to Ostream.

Definition at line 874 of file cellClassification.C.

void operator= ( const cellClassification rhs  ) 

Definition at line 886 of file cellClassification.C.


The documentation for this class was generated from the following files:
Copyright © 2000-2009 OpenCFD Ltd