A topoSetSource to select cells based on relation to surface. More...
Public Member Functions | |
TypeName ("surfaceToCell") | |
Runtime type information. More... | |
surfaceToCell (const polyMesh &mesh, const fileName &surfName, const pointField &outsidePoints, const bool includeCut, const bool includeInside, const bool includeOutside, const bool useSurfaceOrientation, const scalar nearDist, const scalar curvature) | |
Construct from components. More... | |
surfaceToCell (const polyMesh &mesh, const fileName &surfName, const triSurface &surf, const triSurfaceSearch &querySurf, const pointField &outsidePoints, const bool includeCut, const bool includeInside, const bool includeOutside, const bool useSurfaceOrientation, const scalar nearDist, const scalar curvature) | |
Construct from components (supplied surface, surfaceSearch) More... | |
surfaceToCell (const polyMesh &mesh, const dictionary &dict) | |
Construct from dictionary. More... | |
surfaceToCell (const polyMesh &mesh, Istream &) | |
Construct from Istream. More... | |
virtual | ~surfaceToCell () |
Destructor. More... | |
virtual sourceType | setType () const |
virtual void | applyToSet (const topoSetSource::setAction action, topoSet &) const |
![]() | |
TypeName ("topoSetSource") | |
Runtime type information. More... | |
declareRunTimeSelectionTable (autoPtr, topoSetSource, word,(const polyMesh &mesh, const dictionary &dict),(mesh, dict)) | |
declareRunTimeSelectionTable (autoPtr, topoSetSource, istream,(const polyMesh &mesh, Istream &is),(mesh, is)) | |
topoSetSource (const polyMesh &mesh) | |
Construct from components. More... | |
autoPtr< topoSetSource > | clone () const |
Clone. More... | |
virtual | ~topoSetSource () |
Destructor. More... | |
const polyMesh & | mesh () const |
Private Member Functions | |
bool | differingPointNormals (const triSurfaceSearch &querySurf, const vector &span, const label cellI, const label cellTriI, Map< label > &pointToNearest) const |
Return true if surface normal of nearest points to vertices on. More... | |
void | combine (topoSet &set, const bool add) const |
Depending on surface add to or delete from cellSet. More... | |
void | checkSettings () const |
Check values at construction time. More... | |
const triSurfaceSearch & | querySurf () const |
Static Private Member Functions | |
static label | getNearest (const triSurfaceSearch &querySurf, const label pointI, const point &pt, const vector &searchSpan, Map< label > &cache) |
Find index of nearest triangle to point. Returns triangle or -1 if. More... | |
Private Attributes | |
const fileName | surfName_ |
Name of surface file. More... | |
const pointField | outsidePoints_ |
Points which are outside. More... | |
const bool | includeCut_ |
Include cut cells. More... | |
const bool | includeInside_ |
Include inside cells. More... | |
const bool | includeOutside_ |
Include outside cells. More... | |
const bool | useSurfaceOrientation_ |
Determine inside/outside purely using geometric test. More... | |
const scalar | nearDist_ |
If > 0 : include cells with distance from cellCentre to surface. More... | |
const scalar | curvature_ |
If > -1 : include cells with normals at nearest surface points. More... | |
const triSurface * | surfPtr_ |
triSurface to search on. On pointer since can be external. More... | |
const triSurfaceSearch * | querySurfPtr_ |
Search engine on surface. More... | |
const bool | IOwnPtrs_ |
Whether I allocated above surface ptrs or whether they are. More... | |
Static Private Attributes | |
static addToUsageTable | usage_ |
Add usage string. More... | |
Additional Inherited Members | |
![]() | |
enum | sourceType { CELLSETSOURCE, FACESETSOURCE, POINTSETSOURCE, CELLZONESOURCE, FACEZONESOURCE, POINTZONESOURCE } |
Enumeration defining the types of sources. More... | |
enum | setAction { CLEAR, NEW, INVERT, ADD, DELETE, SUBSET, LIST, REMOVE } |
Enumeration defining the valid actions. More... | |
![]() | |
static setAction | toAction (const word &actionName) |
Convert string to action. More... | |
static Istream & | checkIs (Istream &is) |
Check state of stream. More... | |
static const string & | usage (const word &name) |
static autoPtr< topoSetSource > | New (const word &topoSetSourceType, const polyMesh &mesh, const dictionary &dict) |
Return a reference to the selected topoSetSource. More... | |
static autoPtr< topoSetSource > | New (const word &topoSetSourceType, const polyMesh &mesh, Istream &is) |
Return a reference to the selected topoSetSource. More... | |
![]() | |
void | addOrDelete (topoSet &set, const label cellI, const bool) const |
Add (if bool) cellI to set or delete cellI from set. More... | |
![]() | |
const polyMesh & | mesh_ |
![]() | |
static HashTable< string > * | usageTablePtr_ = NULL |
A table of usage strings. More... | |
A topoSetSource to select cells based on relation to surface.
Definition at line 60 of file surfaceToCell.H.
surfaceToCell | ( | const polyMesh & | mesh, |
const fileName & | surfName, | ||
const pointField & | outsidePoints, | ||
const bool | includeCut, | ||
const bool | includeInside, | ||
const bool | includeOutside, | ||
const bool | useSurfaceOrientation, | ||
const scalar | nearDist, | ||
const scalar | curvature | ||
) |
Construct from components.
Definition at line 359 of file surfaceToCell.C.
surfaceToCell | ( | const polyMesh & | mesh, |
const fileName & | surfName, | ||
const triSurface & | surf, | ||
const triSurfaceSearch & | querySurf, | ||
const pointField & | outsidePoints, | ||
const bool | includeCut, | ||
const bool | includeInside, | ||
const bool | includeOutside, | ||
const bool | useSurfaceOrientation, | ||
const scalar | nearDist, | ||
const scalar | curvature | ||
) |
Construct from components (supplied surface, surfaceSearch)
Definition at line 389 of file surfaceToCell.C.
surfaceToCell | ( | const polyMesh & | mesh, |
const dictionary & | dict | ||
) |
Construct from dictionary.
Definition at line 421 of file surfaceToCell.C.
surfaceToCell | ( | const polyMesh & | mesh, |
Istream & | is | ||
) |
Construct from Istream.
Definition at line 447 of file surfaceToCell.C.
|
virtual |
Destructor.
Definition at line 471 of file surfaceToCell.C.
References Foam::deleteDemandDrivenData().
|
staticprivate |
Find index of nearest triangle to point. Returns triangle or -1 if.
not found within search span. Cache result under pointI.
Definition at line 67 of file surfaceToCell.C.
References PointIndexHit< Point >::index(), and triSurfaceSearch::nearest().
|
private |
Return true if surface normal of nearest points to vertices on.
cell differ from that on cell centre. Points cached in pointToNearest.
Definition at line 98 of file surfaceToCell.C.
References f(), PrimitivePatch< Face, FaceList, PointField, PointType >::faceNormals(), forAll, mesh, points, and triSurfaceSearch::surface().
Referenced by surfaceToCell::combine().
Depending on surface add to or delete from cellSet.
Calculate for each searchPoint inside/outside status.
Add/remove cells using set
Definition at line 149 of file surfaceToCell.C.
References Foam::add(), topoSetSource::addOrDelete(), Foam::constant::universal::c, primitiveMesh::cellCentres(), surfaceToCell::curvature_, cellClassification::CUT, surfaceToCell::differingPointNormals(), Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, meshSearch::findCell(), forAll, PointIndexHit< Point >::hit(), PointIndexHit< Point >::hitPoint(), surfaceToCell::includeCut_, surfaceToCell::includeInside_, surfaceToCell::includeOutside_, PointIndexHit< Point >::index(), Foam::Info, cellClassification::INSIDE, Foam::mag(), topoSetSource::mesh_, primitiveMesh::nCells(), surfaceToCell::nearDist_, triSurfaceSearch::nearest(), cellClassification::OUTSIDE, surfaceToCell::outsidePoints_, surfaceToCell::querySurf(), Foam::returnReduce(), and surfaceToCell::useSurfaceOrientation_.
|
private |
Check values at construction time.
Definition at line 323 of file surfaceToCell.C.
References Foam::endl(), Foam::exit(), Foam::FatalError, and FatalErrorInFunction.
|
inlineprivate |
Definition at line 141 of file surfaceToCell.H.
References surfaceToCell::querySurfPtr_.
Referenced by surfaceToCell::combine().
TypeName | ( | "surfaceToCell" | ) |
Runtime type information.
|
inlinevirtual |
Implements topoSetSource.
Definition at line 205 of file surfaceToCell.H.
References topoSetSource::CELLSETSOURCE.
|
virtual |
Implements topoSetSource.
Definition at line 484 of file surfaceToCell.C.
References topoSetSource::ADD, Foam::ListListOps::combine(), topoSetSource::DELETE, Foam::endl(), Foam::Info, and topoSetSource::NEW.
|
staticprivate |
Add usage string.
Definition at line 68 of file surfaceToCell.H.
|
private |
Name of surface file.
Definition at line 71 of file surfaceToCell.H.
|
private |
Points which are outside.
Definition at line 74 of file surfaceToCell.H.
Referenced by surfaceToCell::combine().
|
private |
Include cut cells.
Definition at line 77 of file surfaceToCell.H.
Referenced by surfaceToCell::combine().
|
private |
Include inside cells.
Definition at line 80 of file surfaceToCell.H.
Referenced by surfaceToCell::combine().
|
private |
Include outside cells.
Definition at line 83 of file surfaceToCell.H.
Referenced by surfaceToCell::combine().
|
private |
Determine inside/outside purely using geometric test.
(does not allow includeCut)
Definition at line 87 of file surfaceToCell.H.
Referenced by surfaceToCell::combine().
|
private |
If > 0 : include cells with distance from cellCentre to surface.
less than nearDist.
Definition at line 91 of file surfaceToCell.H.
Referenced by surfaceToCell::combine().
|
private |
If > -1 : include cells with normals at nearest surface points.
varying more than curvature_.
Definition at line 95 of file surfaceToCell.H.
Referenced by surfaceToCell::combine().
|
private |
triSurface to search on. On pointer since can be external.
Definition at line 98 of file surfaceToCell.H.
|
private |
Search engine on surface.
Definition at line 101 of file surfaceToCell.H.
Referenced by surfaceToCell::querySurf().
|
private |
Whether I allocated above surface ptrs or whether they are.
external.
Definition at line 105 of file surfaceToCell.H.
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.