Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes
surfaceToCell Class Reference

A topoSetSource to select cells based on relation to surface. More...

Inheritance diagram for surfaceToCell:
Inheritance graph
[legend]
Collaboration diagram for surfaceToCell:
Collaboration graph
[legend]

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
 
- Public Member Functions inherited from topoSetSource
 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< topoSetSourceclone () const
 Clone. More...
 
virtual ~topoSetSource ()
 Destructor. More...
 
const polyMeshmesh () 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 triSurfaceSearchquerySurf () 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 triSurfacesurfPtr_
 triSurface to search on. On pointer since can be external. More...
 
const triSurfaceSearchquerySurfPtr_
 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

- Public Types inherited from topoSetSource
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 Public Member Functions inherited from topoSetSource
static setAction toAction (const word &actionName)
 Convert string to action. More...
 
static IstreamcheckIs (Istream &is)
 Check state of stream. More...
 
static const stringusage (const word &name)
 
static autoPtr< topoSetSourceNew (const word &topoSetSourceType, const polyMesh &mesh, const dictionary &dict)
 Return a reference to the selected topoSetSource. More...
 
static autoPtr< topoSetSourceNew (const word &topoSetSourceType, const polyMesh &mesh, Istream &is)
 Return a reference to the selected topoSetSource. More...
 
- Protected Member Functions inherited from topoSetSource
void addOrDelete (topoSet &set, const label cellI, const bool) const
 Add (if bool) cellI to set or delete cellI from set. More...
 
- Protected Attributes inherited from topoSetSource
const polyMeshmesh_
 
- Static Protected Attributes inherited from topoSetSource
static HashTable< string > * usageTablePtr_ = NULL
 A table of usage strings. More...
 

Detailed Description

A topoSetSource to select cells based on relation to surface.

Selects:

Source files

Definition at line 60 of file surfaceToCell.H.

Constructor & Destructor Documentation

◆ surfaceToCell() [1/4]

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() [2/4]

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() [3/4]

surfaceToCell ( const polyMesh mesh,
const dictionary dict 
)

Construct from dictionary.

Definition at line 421 of file surfaceToCell.C.

◆ surfaceToCell() [4/4]

surfaceToCell ( const polyMesh mesh,
Istream is 
)

Construct from Istream.

Definition at line 447 of file surfaceToCell.C.

◆ ~surfaceToCell()

~surfaceToCell ( )
virtual

Destructor.

Definition at line 471 of file surfaceToCell.C.

References Foam::deleteDemandDrivenData().

Here is the call graph for this function:

Member Function Documentation

◆ getNearest()

Foam::label getNearest ( const triSurfaceSearch querySurf,
const label  pointI,
const point pt,
const vector searchSpan,
Map< label > &  cache 
)
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().

Here is the call graph for this function:

◆ differingPointNormals()

bool differingPointNormals ( const triSurfaceSearch querySurf,
const vector span,
const label  cellI,
const label  cellTriI,
Map< label > &  pointToNearest 
) const
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ combine()

void combine ( topoSet set,
const bool  add 
) const
private

◆ checkSettings()

void checkSettings ( ) const
private

Check values at construction time.

Definition at line 323 of file surfaceToCell.C.

References Foam::endl(), Foam::exit(), Foam::FatalError, and FatalErrorInFunction.

Here is the call graph for this function:

◆ querySurf()

const triSurfaceSearch& querySurf ( ) const
inlineprivate

Definition at line 141 of file surfaceToCell.H.

References surfaceToCell::querySurfPtr_.

Referenced by surfaceToCell::combine().

Here is the caller graph for this function:

◆ TypeName()

TypeName ( "surfaceToCell"  )

Runtime type information.

◆ setType()

virtual sourceType setType ( ) const
inlinevirtual

Implements topoSetSource.

Definition at line 205 of file surfaceToCell.H.

References topoSetSource::CELLSETSOURCE.

◆ applyToSet()

void applyToSet ( const topoSetSource::setAction  action,
topoSet set 
) const
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.

Here is the call graph for this function:

Field Documentation

◆ usage_

Add usage string.

Definition at line 68 of file surfaceToCell.H.

◆ surfName_

const fileName surfName_
private

Name of surface file.

Definition at line 71 of file surfaceToCell.H.

◆ outsidePoints_

const pointField outsidePoints_
private

Points which are outside.

Definition at line 74 of file surfaceToCell.H.

Referenced by surfaceToCell::combine().

◆ includeCut_

const bool includeCut_
private

Include cut cells.

Definition at line 77 of file surfaceToCell.H.

Referenced by surfaceToCell::combine().

◆ includeInside_

const bool includeInside_
private

Include inside cells.

Definition at line 80 of file surfaceToCell.H.

Referenced by surfaceToCell::combine().

◆ includeOutside_

const bool includeOutside_
private

Include outside cells.

Definition at line 83 of file surfaceToCell.H.

Referenced by surfaceToCell::combine().

◆ useSurfaceOrientation_

const bool useSurfaceOrientation_
private

Determine inside/outside purely using geometric test.

(does not allow includeCut)

Definition at line 87 of file surfaceToCell.H.

Referenced by surfaceToCell::combine().

◆ nearDist_

const scalar nearDist_
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().

◆ curvature_

const scalar curvature_
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().

◆ surfPtr_

const triSurface* surfPtr_
private

triSurface to search on. On pointer since can be external.

Definition at line 98 of file surfaceToCell.H.

◆ querySurfPtr_

const triSurfaceSearch* querySurfPtr_
private

Search engine on surface.

Definition at line 101 of file surfaceToCell.H.

Referenced by surfaceToCell::querySurf().

◆ IOwnPtrs_

const bool IOwnPtrs_
private

Whether I allocated above surface ptrs or whether they are.

external.

Definition at line 105 of file surfaceToCell.H.


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