topoSetSource Class Referenceabstract

Base class of a source for a topoSet. More...

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

Classes

class  addToUsageTable
 Class with constructor to add usage string to table. More...
 
class  iNew
 Class used for the read-construction of. More...
 

Public Types

enum  sourceType {
  UNKNOWN_SOURCE = 0, SET_SOURCE = 0x10, ZONE_SOURCE = 0x20, CELL_TYPE = 0x1,
  FACE_TYPE = 0x2, POINT_TYPE = 0x4, CELLSET_SOURCE = (CELL_TYPE | SET_SOURCE), FACESET_SOURCE = (FACE_TYPE | SET_SOURCE),
  POINTSET_SOURCE = (POINT_TYPE | SET_SOURCE), 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, SUBTRACT, SUBSET, INVERT,
  CLEAR, NEW, REMOVE, LIST,
  DELETE = SUBTRACT
}
 Enumeration defining the valid actions. More...
 

Public Member Functions

 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 (disallowed) More...
 
virtual ~topoSetSource ()=default
 Destructor. More...
 
const polyMeshmesh () const
 Reference to the mesh. More...
 
bool verbose () const
 Return the current verbosity. More...
 
void verbose (bool on)
 Set the current verbosity. More...
 
virtual sourceType setType () const =0
 The source category (set/zone, cell/face/point) More...
 
virtual void applyToSet (const topoSetSource::setAction action, topoSet &set) const =0
 Apply specified action to the topoSet. More...
 

Static Public Member Functions

static IstreamcheckIs (Istream &is)
 Check state of stream. More...
 
static bool isSetSource (const sourceType t)
 True if a "set" source. More...
 
static bool isZoneSource (const sourceType t)
 True if a "zone" source. More...
 
static bool isCell (const sourceType t)
 True if "cell" geometric type. More...
 
static bool isFace (const sourceType t)
 True if "face" geometric type. More...
 
static bool isPoint (const sourceType t)
 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

static const Enum< setActionactionNames
 The setActions text representations. More...
 

Protected Member Functions

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

static bool check (labelList &list, const label maxLabel)
 Detect and remove any values less than 0 or ge maxLabel. More...
 

Protected Attributes

const polyMeshmesh_
 Reference to the mesh. More...
 
bool verbose_
 Verbosity (default: true) More...
 

Static Protected Attributes

static const string illegalSource_
 
static HashTable< string > * usageTablePtr_ = nullptr
 A table of usage strings. More...
 

Detailed Description

Base class of a source for a topoSet.

Implementer must modify the given set (see applyToSet) according to its function and the setAction (one of add/delete/new).

Source files

Definition at line 66 of file topoSetSource.H.

Member Enumeration Documentation

◆ sourceType

enum sourceType

Enumeration defining the types of sources.

Enumerator
UNKNOWN_SOURCE 

Placeholder.

SET_SOURCE 

Source based on topoSet.

ZONE_SOURCE 

Source based on mesh zone.

CELL_TYPE 

Geometric type is "cell".

FACE_TYPE 

Geometric type is "face".

POINT_TYPE 

Geometric type is "point".

CELLSET_SOURCE 

Cells as set.

FACESET_SOURCE 

Faces as set.

POINTSET_SOURCE 

Points as set.

CELLZONE_SOURCE 

Cells as zone.

FACEZONE_SOURCE 

Faces as zone.

POINTZONE_SOURCE 

Points as zone.

CELLSETSOURCE 
FACESETSOURCE 
POINTSETSOURCE 
CELLZONESOURCE 
FACEZONESOURCE 
POINTZONESOURCE 

Definition at line 73 of file topoSetSource.H.

◆ setAction

enum setAction

Enumeration defining the valid actions.

Enumerator
ADD 

Add elements to the set.

SUBTRACT 

Subtract elements from the set.

SUBSET 

Subset with elements in the set.

INVERT 

Invert the elements in the set.

CLEAR 

Clear the set, possibly creating it.

NEW 

Create a new set and ADD elements to it.

REMOVE 

Remove the set (from the file system)

LIST 

Print contents of the set.

DELETE 
Deprecated:
(2018-10) Alias for SUBTRACT

Definition at line 99 of file topoSetSource.H.

Constructor & Destructor Documentation

◆ topoSetSource() [1/2]

topoSetSource ( const topoSetSource )
protecteddelete

No copy construct.

◆ topoSetSource() [2/2]

topoSetSource ( const polyMesh mesh)
explicit

Construct from components.

Definition at line 231 of file topoSetSource.C.

◆ ~topoSetSource()

virtual ~topoSetSource ( )
virtualdefault

Destructor.

Member Function Documentation

◆ check()

bool check ( labelList list,
const label  maxLabel 
)
staticprotected

Detect and remove any values less than 0 or ge maxLabel.

Returns
false if invalid elements were detected (and removed)

Definition at line 73 of file topoSetSource.C.

References List< T >::resize().

Here is the call graph for this function:

◆ addOrDelete() [1/3]

void addOrDelete ( topoSet set,
const label  id,
const bool  add 
) const
protected

Add or delete id from set. Add when 'add' is true.

Definition at line 170 of file topoSetSource.C.

References Foam::add(), and Foam::BitOps::set().

Here is the call graph for this function:

◆ addOrDelete() [2/3]

void addOrDelete ( topoSet set,
const labelUList labels,
const bool  add 
) const
protected

Add or delete labels from set. Add when 'add' is true.

Definition at line 188 of file topoSetSource.C.

References Foam::add(), and Foam::BitOps::set().

Here is the call graph for this function:

◆ addOrDelete() [3/3]

void addOrDelete ( topoSet set,
const bitSet labels,
const bool  add 
) const
protected

Add or delete labels from set. Add when 'add' is true.

Definition at line 206 of file topoSetSource.C.

References Foam::add(), and Foam::BitOps::set().

Here is the call graph for this function:

◆ operator=()

void operator= ( const topoSetSource )
protecteddelete

No copy assignment.

◆ TypeName()

TypeName ( "topoSetSource"  )

Runtime type information.

◆ checkIs()

Foam::Istream & checkIs ( Istream is)
static

Check state of stream.

Definition at line 155 of file topoSetSource.C.

References IOstream::eof(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, and IOstream::good().

Here is the call graph for this function:

◆ isSetSource()

static bool isSetSource ( const sourceType  t)
inlinestatic

True if a "set" source.

Definition at line 202 of file topoSetSource.H.

References topoSetSource::SET_SOURCE.

◆ isZoneSource()

static bool isZoneSource ( const sourceType  t)
inlinestatic

True if a "zone" source.

Definition at line 208 of file topoSetSource.H.

References topoSetSource::ZONE_SOURCE.

◆ isCell()

static bool isCell ( const sourceType  t)
inlinestatic

True if "cell" geometric type.

Definition at line 214 of file topoSetSource.H.

References topoSetSource::CELL_TYPE.

◆ isFace()

static bool isFace ( const sourceType  t)
inlinestatic

True if "face" geometric type.

Definition at line 220 of file topoSetSource.H.

References topoSetSource::FACE_TYPE.

◆ isPoint()

static bool isPoint ( const sourceType  t)
inlinestatic

True if "point" geometric type.

Definition at line 226 of file topoSetSource.H.

References topoSetSource::POINT_TYPE.

◆ declareRunTimeSelectionTable() [1/2]

declareRunTimeSelectionTable ( autoPtr  ,
topoSetSource  ,
word  ,
(const polyMesh &mesh, const dictionary &dict ,
(mesh, dict  
)

◆ declareRunTimeSelectionTable() [2/2]

declareRunTimeSelectionTable ( autoPtr  ,
topoSetSource  ,
istream  ,
(const polyMesh &mesh, Istream &is)  ,
(mesh, is)   
)

◆ usage()

static const string& usage ( const word name)
inlinestatic

Definition at line 283 of file topoSetSource.H.

References topoSetSource::illegalSource_, Foam::name(), and topoSetSource::usageTablePtr_.

Here is the call graph for this function:

◆ clone()

autoPtr<topoSetSource> clone ( ) const
inline

Clone (disallowed)

Definition at line 300 of file topoSetSource.H.

References NotImplemented.

◆ New() [1/2]

Foam::autoPtr< Foam::topoSetSource > New ( const word topoSetSourceType,
const polyMesh mesh,
const dictionary dict 
)
static

Return a reference to the selected topoSetSource.

Definition at line 109 of file topoSetSource.C.

References dict, Foam::exit(), Foam::FatalIOError, FatalIOErrorInLookup, and mesh.

Referenced by topoSetSource::iNew::operator()().

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

◆ New() [2/2]

Foam::autoPtr< Foam::topoSetSource > New ( const word topoSetSourceType,
const polyMesh mesh,
Istream is 
)
static

Return a reference to the selected topoSetSource.

Definition at line 133 of file topoSetSource.C.

References Foam::exit(), Foam::FatalError, FatalErrorInLookup, and mesh.

Here is the call graph for this function:

◆ mesh()

const polyMesh& mesh ( ) const
inline

Reference to the mesh.

Definition at line 333 of file topoSetSource.H.

References topoSetSource::mesh_.

◆ verbose() [1/2]

bool verbose ( ) const
inline

Return the current verbosity.

Definition at line 339 of file topoSetSource.H.

References topoSetSource::verbose_.

◆ verbose() [2/2]

void verbose ( bool  on)
inline

Set the current verbosity.

Definition at line 345 of file topoSetSource.H.

References topoSetSource::verbose_.

◆ setType()

virtual sourceType setType ( ) const
pure virtual

The source category (set/zone, cell/face/point)

Implemented in topoSetCellZoneSource, topoSetFaceZoneSource, topoSetPointZoneSource, topoSetCellSource, topoSetFaceSource, and topoSetPointSource.

◆ applyToSet()

◆ toAction()

static setAction toAction ( const word actionName)
inlinestatic

Deprecated(2018-07) convert string to action.

Deprecated:
(2018-07) - use actionNames[] directly

Definition at line 368 of file topoSetSource.H.

Member Data Documentation

◆ actionNames

const Foam::Enum< Foam::topoSetSource::setAction > actionNames
static

The setActions text representations.

Definition at line 113 of file topoSetSource.H.

◆ illegalSource_

const Foam::string illegalSource_
staticprotected

Definition at line 118 of file topoSetSource.H.

Referenced by topoSetSource::usage().

◆ usageTablePtr_

Foam::HashTable< Foam::string > * usageTablePtr_ = nullptr
staticprotected

◆ mesh_

const polyMesh& mesh_
protected

Reference to the mesh.

Definition at line 151 of file topoSetSource.H.

Referenced by topoSetSource::mesh().

◆ verbose_

bool verbose_
protected

Verbosity (default: true)

Definition at line 154 of file topoSetSource.H.

Referenced by topoSetSource::verbose().


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