FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

cellClassification Class Reference

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

#include <meshTools/cellClassification.H>


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

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 polyMesh &  mesh () 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 &)

Member Enumeration Documentation

enum cType

Type of cell.

Enumerator:
NOTSET 
INSIDE 
OUTSIDE 
CUT 

Definition at line 128 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 139 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 484 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 505 of file cellClassification.C.

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

cellClassification ( const cellClassification &   cType  )

Construct as copy.

Definition at line 526 of file cellClassification.C.


Member Function Documentation

ClassName ( "cellClassification"    )
const polyMesh& mesh (  ) const [inline]

Definition at line 221 of file cellClassification.H.

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

Definition at line 539 of file cellClassification.C.

References cellClassification::CUT, and forAll.

Referenced by surfaceSets::getSurfaceSets().

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

Sets vertex neighbours of meshType cells to fillType.

Definition at line 625 of file cellClassification.C.

References forAll.

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

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

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

References Foam::endl(), forAll, Foam::Pout, and List< T >::size().

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

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

void writeStats ( Ostream &   os  ) const

Write statistics on cell types to Ostream.

Definition at line 884 of file cellClassification.C.

References Foam::endl().

void operator= ( const cellClassification &   rhs  )

Definition at line 896 of file cellClassification.C.

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


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