Implementation of cellLooper. Does pure geometric cut through cell. More...
Public Member Functions | |
TypeName ("geomCellLooper") | |
Runtime type information. More... | |
geomCellLooper (const polyMesh &mesh) | |
Construct from components. More... | |
virtual | ~geomCellLooper () |
Destructor. More... | |
virtual bool | cut (const vector &refDir, const label cellI, const boolList &vertIsCut, const boolList &edgeIsCut, const scalarField &edgeWeight, labelList &loop, scalarField &loopWeights) const |
Create cut along circumference of cellI. Gets current mesh cuts. More... | |
virtual bool | cut (const plane &cutPlane, const label cellI, const boolList &vertIsCut, const boolList &edgeIsCut, const scalarField &edgeWeight, labelList &loop, scalarField &loopWeights) const |
Same but now also base point of cut provided (instead of always. More... | |
![]() | |
TypeName ("cellLooper") | |
Runtime type information. More... | |
declareRunTimeSelectionTable (autoPtr, cellLooper, word,(const polyMesh &mesh),(mesh)) | |
cellLooper (const polyMesh &mesh) | |
Construct from components. More... | |
autoPtr< cellLooper > | clone () const |
Clone. More... | |
virtual | ~cellLooper () |
Destructor. More... | |
![]() | |
edgeVertex (const polyMesh &mesh) | |
Construct from mesh. More... | |
const polyMesh & | mesh () const |
bool | isEdge (const label eVert) const |
label | getEdge (const label eVert) const |
label | getVertex (const label eVert) const |
label | vertToEVert (const label vertI) const |
label | edgeToEVert (const label edgeI) const |
point | coord (const label cut, const scalar weight) const |
label | cutPairToEdge (const label cut0, const label cut1) const |
Ostream & | writeCut (Ostream &os, const label cut, const scalar) const |
Write cut description to Ostream. More... | |
Ostream & | writeCuts (Ostream &os, const labelList &, const scalarField &) const |
Write cut descriptions to Ostream. More... | |
Static Public Member Functions | |
static scalar | snapTol () |
static void | setSnapTol (const scalar tol) |
![]() | |
static autoPtr< cellLooper > | New (const word &type, const polyMesh &mesh) |
Return a reference to the selected cellLooper. More... | |
![]() | |
static void | updateLabels (const labelList &map, List< refineCell > &) |
Update refine list from map. Used to update cell/face labels. More... | |
static void | updateLabels (const labelList &map, Map< label > &) |
Update map from map. Used to update cell/face labels. More... | |
static void | updateLabels (const labelList &map, labelHashSet &) |
Update map from map. Used to update cell/face labels. More... | |
static bool | isEdge (const primitiveMesh &mesh, const label eVert) |
Is eVert an edge? More... | |
static label | getEdge (const primitiveMesh &mesh, const label eVert) |
Convert eVert to edge label. More... | |
static label | getVertex (const primitiveMesh &mesh, const label eVert) |
Convert eVert to vertex label. More... | |
static label | vertToEVert (const primitiveMesh &mesh, const label vertI) |
Convert pointI to eVert. More... | |
static label | edgeToEVert (const primitiveMesh &mesh, const label edgeI) |
Convert edgeI to eVert. More... | |
static point | coord (const primitiveMesh &, const label cut, const scalar weight) |
Return coordinate of cut (uses weight if edgeCut) More... | |
static label | cutPairToEdge (const primitiveMesh &, const label cut0, const label cut1) |
Find mesh edge (or -1) between two cuts. More... | |
Private Member Functions | |
scalar | minEdgeLen (const label vertI) const |
Min length of attached edges. More... | |
bool | cutEdge (const plane &cutPlane, const label edgeI, scalar &weight) const |
Return true and set weight if edge is cut. More... | |
label | snapToVert (const scalar tol, const label edgeI, const scalar weight) const |
Snaps cut through edge by cut through vertex (if weight closer than. More... | |
void | getBase (const vector &n, vector &e0, vector &e1) const |
Gets two (random) vectors perpendicular to n and each other to be. More... | |
bool | edgeEndsCut (const labelList &, const label index) const |
Return true if the cut edge at loop[index] is inbetween the cuts. More... | |
geomCellLooper (const geomCellLooper &) | |
Disallow default bitwise copy construct. More... | |
void | operator= (const geomCellLooper &) |
Disallow default bitwise assignment. More... | |
Static Private Attributes | |
static const scalar | pointEqualTol_ = 1e-3 |
Tolerance for point equal test. Fraction of edge length. More... | |
static scalar | snapTol_ = 0.1 |
Tolerance for cut through edges to get snapped to edge end point. More... | |
Additional Inherited Members | |
![]() | |
labelList | getVertFacesNonEdge (const label cellI, const label edgeI, const label vertI) const |
Get faces (on cell) connected to vertI which are not using edgeI. More... | |
label | getFirstVertEdge (const label faceI, const label vertI) const |
Get first edge connected to vertI and on faceI. More... | |
labelList | getVertEdgesNonFace (const label cellI, const label faceI, const label vertI) const |
Get edges (on cell) connected to vertI which are not on faceI. More... | |
label | getMisAlignedEdge (const vector &refDir, const label cellI) const |
Return edge from cellEdges that is most perpendicular. More... | |
Implementation of cellLooper. Does pure geometric cut through cell.
Handles all cell shapes in the same way: cut edges with plane through cell centre and normal in direction of provided direction. Snaps cuts close to edge endpoints (close = snapTol * minEdgeLen) to vertices.
Currently determines cuts through edges (and edge endpoints close to plane) in random order and then sorts them acc. to angle. Could be converted to use walk but problem is that face can be cut multiple times (since does not need to be convex). Another problem is that edges parallel to plane might not be cut. So these are handled by looking at the distance from edge endpoints to the plane.
Definition at line 63 of file geomCellLooper.H.
|
private |
Disallow default bitwise copy construct.
geomCellLooper | ( | const polyMesh & | mesh | ) |
Construct from components.
Definition at line 214 of file geomCellLooper.C.
|
virtual |
Destructor.
Definition at line 222 of file geomCellLooper.C.
|
private |
Min length of attached edges.
Definition at line 62 of file geomCellLooper.C.
References Foam::e, primitiveMesh::edges(), forAll, edgeVertex::mesh(), Foam::min(), primitiveMesh::pointEdges(), and points.
Return true and set weight if edge is cut.
Definition at line 81 of file geomCellLooper.C.
References Foam::e, primitiveMesh::edges(), mesh, plane::normalIntersect(), polyMesh::points(), and s().
|
private |
Snaps cut through edge by cut through vertex (if weight closer than.
tol to 0 or 1). Returns vertex label snapped to or -1.
Definition at line 111 of file geomCellLooper.C.
References Foam::e, primitiveMesh::edges(), and mesh.
Gets two (random) vectors perpendicular to n and each other to be.
used as base.
Definition at line 134 of file geomCellLooper.C.
References Foam::mag(), n, and Vector< Cmpt >::x().
Return true if the cut edge at loop[index] is inbetween the cuts.
through the edge end points.
Definition at line 179 of file geomCellLooper.C.
References Foam::e, primitiveMesh::edges(), and mesh.
|
private |
Disallow default bitwise assignment.
TypeName | ( | "geomCellLooper" | ) |
Runtime type information.
|
inlinestatic |
Definition at line 129 of file geomCellLooper.H.
References geomCellLooper::snapTol_.
Referenced by cellCuts::check(), and cellCuts::validEdgeLoop().
|
inlinestatic |
Definition at line 134 of file geomCellLooper.H.
References geomCellLooper::snapTol_.
|
virtual |
Create cut along circumference of cellI. Gets current mesh cuts.
Cut along circumference is expressed as loop of cuts plus weights for cuts along edges (only valid for edge cuts). Return true if successful cut.
Implements cellLooper.
Reimplemented in topoCellLooper, and hexCellLooper.
Definition at line 229 of file geomCellLooper.C.
References mesh.
Referenced by hexCellLooper::cut().
|
virtual |
Same but now also base point of cut provided (instead of always.
cell centre)
Implements cellLooper.
Reimplemented in topoCellLooper, and hexCellLooper.
Definition at line 255 of file geomCellLooper.C.
References DynamicList::append(), primitiveMesh::cellEdges(), primitiveMesh::cells(), plane::distance(), Foam::e, primitiveMesh::edges(), Foam::endl(), Foam::findIndex(), forAll, HashTable::found(), SortableList::indices(), HashSet< Key, Hash >::insert(), Foam::mag(), mesh, plane::normal(), points, polyMesh::points(), Foam::Pout, Foam::pseudoAngle(), List::setSize(), DynamicList::shrink(), List::size(), SortableList::sort(), List::transfer(), and Vector< scalar >::zero.
|
staticprivate |
Tolerance for point equal test. Fraction of edge length.
Definition at line 71 of file geomCellLooper.H.
|
staticprivate |
Tolerance for cut through edges to get snapped to edge end point.
Fraction of length of minimum connected edge length.
Definition at line 75 of file geomCellLooper.H.
Referenced by geomCellLooper::setSnapTol(), and geomCellLooper::snapTol().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.