'Cuts' a mesh with a surface. More...
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... | |
![]() | |
typedef SubList< T > | 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 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. 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 &) |
![]() | |
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... | |
T & | newElmt (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 polyMesh & | mesh_ |
Reference to mesh. More... | |
Additional Inherited Members | |
![]() | |
static const List< T > & | null () |
Return a null List. More... | |
![]() | |
void | size (const label) |
Override size to be inconsistent with allocated storage. More... | |
'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.
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)
Definition at line 115 of file cellClassification.H.
enum cType |
Type of cell.
Enumerator | |
---|---|
NOTSET | |
INSIDE | |
OUTSIDE | |
CUT |
Definition at line 125 of file cellClassification.H.
enum 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.
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 | ( | 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.
cellClassification | ( | const cellClassification & | cType | ) |
Construct as copy.
Definition at line 521 of file cellClassification.C.
|
staticprivate |
Count number of occurrences of elem in list.
Definition at line 51 of file cellClassification.C.
References forAll.
|
private |
Mark all faces intersected by or intersecting surface.
Definition at line 76 of file cellClassification.C.
References boundBox::avgDim(), Foam::constant::electromagnetic::e, PrimitivePatch< Face, FaceList, PointField, PointType >::edges(), Foam::endl(), indexedOctree::findLine(), forAll, PointIndexHit< Point >::hit(), PointIndexHit< Point >::hitPoint(), PointIndexHit< Point >::index(), PrimitivePatch< Face, FaceList, PointField, PointType >::localPoints(), Foam::mag(), boundBox::max(), boundBox::min(), Foam::Pout, indexedOctree::shapes(), triSurfaceSearch::surface(), triSurfaceSearch::tree(), Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().
|
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().
|
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().
|
private |
Return true if cell uses only points with status=mixed.
Definition at line 399 of file cellClassification.C.
|
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().
ClassName | ( | "cellClassification" | ) |
|
inline |
Definition at line 218 of file cellClassification.H.
References cellClassification::mesh_.
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().
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().
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.
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().
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.
void writeStats | ( | Ostream & | os | ) | const |
Write statistics on cell types to Ostream.
Definition at line 872 of file cellClassification.C.
References Foam::endl().
void operator= | ( | const cellClassification & | rhs | ) |
Definition at line 884 of file cellClassification.C.
References List::operator=().
|
private |
Reference to mesh.
Definition at line 149 of file cellClassification.H.
Referenced by cellClassification::mesh().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.