nearestToCell Class Reference

A topoSetCellSource to select cells whose cell centre nearest to given points. More...

Inheritance diagram for nearestToCell:
[legend]
Collaboration diagram for nearestToCell:
[legend]

Public Member Functions

 TypeName ("nearestToCell")
 Runtime type information. More...
 
 nearestToCell (const polyMesh &mesh, const pointField &points)
 Construct from components, copying points. More...
 
 nearestToCell (const polyMesh &mesh, pointField &&points)
 Construct from components, moving points. More...
 
 nearestToCell (const polyMesh &mesh, const dictionary &dict)
 Construct from dictionary. More...
 
 nearestToCell (const polyMesh &mesh, Istream &is)
 Construct from Istream. More...
 
virtual ~nearestToCell ()=default
 Destructor. More...
 
virtual void applyToSet (const topoSetSource::setAction action, topoSet &set) const
 Apply specified action to the topoSet. More...
 
- Public Member Functions inherited from topoSetCellSource
 declareRunTimeSelectionTable (autoPtr, topoSetCellSource, word,(const polyMesh &mesh, const dictionary &dict),(mesh, dict))
 
 declareRunTimeSelectionTable (autoPtr, topoSetCellSource, istream,(const polyMesh &mesh, Istream &is),(mesh, is))
 
 topoSetCellSource (const polyMesh &mesh)
 Construct from mesh. More...
 
 topoSetCellSource (const polyMesh &mesh, const dictionary &dict)
 Construct from mesh, use "verbose" entry if present. More...
 
autoPtr< topoSetCellSourceclone () const
 Clone (disallowed) More...
 
virtual ~topoSetCellSource ()=default
 Destructor. More...
 
virtual topoSetSource::sourceType setType () const
 The source category is a cellSet. More...
 
- 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, bool verbose=true)
 Construct from mesh, with preferred verbosity. More...
 
 topoSetSource (const polyMesh &mesh, const dictionary &dict)
 Construct from mesh, use "verbose" entry if present. More...
 
autoPtr< topoSetSourceclone () const
 Clone (disallowed) More...
 
virtual ~topoSetSource ()=default
 Destructor. More...
 
const polyMeshmesh () const noexcept
 Reference to the mesh. More...
 
bool verbose () const noexcept
 Get output verbosity. More...
 
bool verbose (bool on) noexcept
 Enable/disable verbose output. More...
 
void verbose (const dictionary &dict)
 Use "verbose" entry (if present) to enable/disable verbose output. More...
 

Additional Inherited Members

- Public Types inherited from topoSetSource
enum  sourceType {
  UNKNOWN_SOURCE = 0, CELL_TYPE = 0x1, FACE_TYPE = 0x2, POINT_TYPE = 0x4,
  SET_SOURCE = 0x10, CELLSET_SOURCE = (CELL_TYPE | SET_SOURCE), FACESET_SOURCE = (FACE_TYPE | SET_SOURCE), POINTSET_SOURCE = (POINT_TYPE | SET_SOURCE),
  ZONE_SOURCE = 0x20, CELLZONE_SOURCE = (CELL_TYPE | ZONE_SOURCE), FACEZONE_SOURCE = (FACE_TYPE | ZONE_SOURCE), POINTZONE_SOURCE = (POINT_TYPE | ZONE_SOURCE),
  CELLSETSOURCE = CELLSET_SOURCE, FACESETSOURCE = FACESET_SOURCE, POINTSETSOURCE = POINTSET_SOURCE, CELLZONESOURCE = CELLZONE_SOURCE,
  FACEZONESOURCE = FACEZONE_SOURCE, POINTZONESOURCE = POINTZONE_SOURCE
}
 Enumeration defining the types of sources. More...
 
enum  setAction {
  ADD, NEW, SUBTRACT, SUBSET,
  INVERT, CLEAR, REMOVE, LIST,
  DELETE = SUBTRACT
}
 Enumeration defining the valid actions. More...
 
- Static Public Member Functions inherited from topoSetCellSource
static autoPtr< topoSetCellSourceNew (const word &sourceType, const polyMesh &mesh, const dictionary &dict)
 Return a reference to the selected source type. More...
 
static autoPtr< topoSetCellSourceNew (const word &sourceType, const polyMesh &mesh, Istream &is)
 Return a reference to the selected source type. More...
 
- Static Public Member Functions inherited from topoSetSource
static IstreamcheckIs (Istream &is)
 Check state of stream. More...
 
static bool isSetSource (const sourceType t) noexcept
 True if a "set" source. More...
 
static bool isZoneSource (const sourceType t) noexcept
 True if a "zone" source. More...
 
static bool isCell (const sourceType t) noexcept
 True if "cell" geometric type. More...
 
static bool isFace (const sourceType t) noexcept
 True if "face" geometric type. More...
 
static bool isPoint (const sourceType t) noexcept
 True if "point" geometric type. 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...
 
static setAction toAction (const word &actionName)
 Deprecated(2018-07) convert string to action. More...
 
- Static Public Attributes inherited from topoSetSource
static const Enum< setActionactionNames
 The setActions text representations. More...
 
- Protected Member Functions inherited from topoSetSource
void addOrDelete (topoSet &set, const label id, const bool add) const
 Add or delete id from set. Add when 'add' is true. More...
 
void addOrDelete (topoSet &set, const labelUList &labels, const bool add) const
 Add or delete labels from set. Add when 'add' is true. More...
 
void addOrDelete (topoSet &set, const bitSet &labels, const bool add) const
 Add or delete labels from set. Add when 'add' is true. More...
 
 topoSetSource (const topoSetSource &)=delete
 No copy construct. More...
 
void operator= (const topoSetSource &)=delete
 No copy assignment. More...
 
- Static Protected Member Functions inherited from topoSetSource
static bool check (labelList &list, const label maxLabel)
 Detect and remove any values less than 0 or ge maxLabel. More...
 
- Protected Attributes inherited from topoSetSource
const polyMeshmesh_
 Reference to the mesh. More...
 
bool verbose_
 Output verbosity (default: true) More...
 
- Static Protected Attributes inherited from topoSetSource
static const string illegalSource_
 
static HashTable< string > * usageTablePtr_ = nullptr
 A table of usage strings. More...
 

Detailed Description

A topoSetCellSource to select cells whose cell centre nearest to given points.

Operands:

Operand Type Location
output cellSet $FOAM_CASE/constant/polyMesh/sets/<set>
Usage
Minimal example by using system/topoSetDict.actions:
{
    // Mandatory (inherited) entries
    name        <name>;
    type        cellSet;
    action      <action>;

    // Mandatory entries
    source      nearestToCell;
    points
    (
        (<p1x> <p1y> <p1z>)
        (<p2x> <p2y> <p2z>)
        ...
    );
}

where the entries mean:

Property Description Type Req'd Dflt
name Name of cellSet word yes -
type Type name: cellSet word yes -
action Action applied on cells - see below word yes -
source Source name: nearestToCell word yes -
points List of selection points vectorList yes -

Options for the action entry:

      new      | Create a new cellSet from selected cells
      add      | Add selected cells into this cellSet
      subtract | Remove selected cells from this cellSet
See also
Source files

Definition at line 143 of file nearestToCell.H.

Constructor & Destructor Documentation

◆ nearestToCell() [1/4]

nearestToCell ( const polyMesh mesh,
const pointField points 
)

Construct from components, copying points.

Definition at line 104 of file nearestToCell.C.

◆ nearestToCell() [2/4]

nearestToCell ( const polyMesh mesh,
pointField &&  points 
)

Construct from components, moving points.

Definition at line 115 of file nearestToCell.C.

◆ nearestToCell() [3/4]

nearestToCell ( const polyMesh mesh,
const dictionary dict 
)

Construct from dictionary.

Definition at line 126 of file nearestToCell.C.

◆ nearestToCell() [4/4]

nearestToCell ( const polyMesh mesh,
Istream is 
)

Construct from Istream.

Definition at line 140 of file nearestToCell.C.

◆ ~nearestToCell()

virtual ~nearestToCell ( )
virtualdefault

Destructor.

Member Function Documentation

◆ TypeName()

TypeName ( "nearestToCell"  )

Runtime type information.

◆ applyToSet()

void applyToSet ( const topoSetSource::setAction  action,
topoSet set 
) const
virtual

Apply specified action to the topoSet.

Implements topoSetSource.

Definition at line 153 of file nearestToCell.C.

References topoSetSource::ADD, Foam::ListListOps::combine(), Foam::endl(), Foam::Info, topoSetSource::NEW, Foam::BitOps::set(), and topoSetSource::SUBTRACT.

Here is the call graph for this function:

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