Loading...
Searching...
No Matches
zoneToCell Class Reference

A topoSetCellSource to convert cellZone(s) to a cellSet. More...

#include <zoneToCell.H>

Inheritance diagram for zoneToCell:
Collaboration diagram for zoneToCell:

Public Member Functions

 TypeName ("zoneToCell")
 Runtime type information.
 zoneToCell (const polyMesh &mesh, const wordRes &zoneSelector)
 Construct from mesh and zones selector.
 zoneToCell (const polyMesh &mesh, const wordRe &zoneName)
 Construct from mesh and single zone selector.
 zoneToCell (const polyMesh &mesh, const labelUList &zoneIDs)
 Construct from mesh and specified zone IDs.
 zoneToCell (const polyMesh &mesh, const dictionary &dict)
 Construct from dictionary.
 zoneToCell (const polyMesh &mesh, Istream &is)
 Construct from Istream.
virtual ~zoneToCell ()=default
 Destructor.
const wordReszones () const noexcept
 Return the current zones selector.
void zones (const wordRes &zoneSelector)
 Define the zones selector.
void zones (const wordRe &zoneName)
 Define the zones selector with a single zone selector.
void zones (const labelUList &zoneIDs)
 Define the cellZone IDs to use (must exist).
void zones (const label zoneID)
 Define the cellZone ID to use (must exist).
virtual void applyToSet (const topoSetSource::setAction action, topoSet &set) const
 Apply specified action to the topoSet.
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.
 topoSetCellSource (const polyMesh &mesh, const dictionary &dict)
 Construct from mesh, use "verbose" entry if present.
autoPtr< topoSetCellSourceclone () const
 Clone (disallowed).
virtual ~topoSetCellSource ()=default
 Destructor.
virtual topoSetSource::sourceType setType () const
 The source category is a cellSet.
Public Member Functions inherited from topoSetSource
 TypeName ("topoSetSource")
 Runtime type information.
 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.
 topoSetSource (const polyMesh &mesh, const dictionary &dict)
 Construct from mesh, use "verbose" entry if present.
autoPtr< topoSetSourceclone () const
 Clone (disallowed).
virtual ~topoSetSource ()=default
 Destructor.
const polyMeshmesh () const noexcept
 Reference to the mesh.
bool verbose () const noexcept
 Get output verbosity.
bool verbose (bool on) noexcept
 Enable/disable verbose output.
void verbose (const dictionary &dict)
 Use "verbose" entry (if present) to enable/disable verbose output.
bool hasTransform () const noexcept
 True if coordinate transform is active.
tmp< pointFieldtransform (const pointField &points) const
 Coordinate transform (optionally) coordinates. Returns reference to input data if no transform is active.

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 , SUBTRACT , NEW , SUBSET ,
  INVERT , CLEAR , REMOVE , LIST ,
  IGNORE , DELETE = SUBTRACT
}
 Enumeration defining various 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.
static autoPtr< topoSetCellSourceNew (const word &sourceType, const polyMesh &mesh, Istream &is)
 Return a reference to the selected source type.
Static Public Member Functions inherited from topoSetSource
static IstreamcheckIs (Istream &is)
 Check state of stream.
static bool isSetSource (const sourceType t) noexcept
 True if a "set" source.
static bool isZoneSource (const sourceType t) noexcept
 True if a "zone" source.
static bool isCell (const sourceType t) noexcept
 True if "cell" geometric type.
static bool isFace (const sourceType t) noexcept
 True if "face" geometric type.
static bool isPoint (const sourceType t) noexcept
 True if "point" geometric type.
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.
static autoPtr< topoSetSourceNew (const word &topoSetSourceType, const polyMesh &mesh, Istream &is)
 Return a reference to the selected topoSetSource.
static setAction toAction (const word &actionName)
 Deprecated(2018-07) convert string to action.
static bool readNames (const dictionary &dict, wordList &names)
 Helper: extract wordList of patches/zones from dictionary. Returns.
Static Public Attributes inherited from topoSetSource
static const Enum< setActionactionNames
 The setActions enum text. Names: "new", add", "subtract", "subset", "invert", "clear", "remove", "list", "ignore".
static const Enum< setActioncombineNames
 The setAction enum text when combining selections. Names: "use", "add", "subtract", "subset", "invert", "ignore".
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.
void addOrDelete (topoSet &set, const labelUList &labels, const bool add) const
 Add or delete labels from set. Add when 'add' is true.
void addOrDelete (topoSet &set, const bitSet &labels, const bool add) const
 Add or delete labels from set. Add when 'add' is true.
 topoSetSource (const topoSetSource &)=delete
 No copy construct.
void operator= (const topoSetSource &)=delete
 No copy assignment.
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.
Protected Attributes inherited from topoSetSource
const polyMeshmesh_
 Reference to the mesh.
bool verbose_
 Output verbosity (default: true).
autoPtr< solidBodyMotionFunctiontransformPtr_
 Optional transformation for geometric data.
Static Protected Attributes inherited from topoSetSource
static const string illegalSource_
static HashTable< string > * usageTablePtr_ = nullptr
 A table of usage strings.

Detailed Description

A topoSetCellSource to convert cellZone(s) to a cellSet.

Operands:

Operand Type Location
input cellZone(s) $FOAM_CASE/constant/polyMesh/cellZones
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      zoneToCell;

    // Conditional mandatory entries
    // Select one of the below

    // Option-1
    zones
    (
        <cellZoneName0>
        <cellZoneName1>
        ...
    );

    // Option-2
    zone     <cellZoneName>;
}

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: zoneToCell word yes -

Options for the action entry:

      new      | Create a new cellSet from selected cells
      add      | Add selected cells into this cellsSet
      subtract | Remove selected cells from this cellSet

Options for the conditional mandatory entries:

      Entry    | Description                | Type     | Req'd  | Dflt
      zones    | Names of input cellZones   | wordRes  | cond'l | -
      zone     | Name of input cellZone     | wordRe   | cond'l | -
Note
The order of precedence among the conditional mandatory entries from the highest to the lowest is zones, and zone.
See also
Source files

Definition at line 156 of file zoneToCell.H.

Constructor & Destructor Documentation

◆ zoneToCell() [1/5]

zoneToCell ( const polyMesh & mesh,
const wordRes & zoneSelector )

Construct from mesh and zones selector.

Definition at line 137 of file zoneToCell.C.

References topoSetSource::mesh(), and topoSetCellSource::topoSetCellSource().

Referenced by zoneToCell().

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

◆ zoneToCell() [2/5]

zoneToCell ( const polyMesh & mesh,
const wordRe & zoneName )

Construct from mesh and single zone selector.

Definition at line 148 of file zoneToCell.C.

References topoSetSource::mesh(), and topoSetCellSource::topoSetCellSource().

Here is the call graph for this function:

◆ zoneToCell() [3/5]

zoneToCell ( const polyMesh & mesh,
const labelUList & zoneIDs )

Construct from mesh and specified zone IDs.

Definition at line 159 of file zoneToCell.C.

References topoSetSource::mesh(), topoSetCellSource::topoSetCellSource(), and zoneIDs.

Here is the call graph for this function:

◆ zoneToCell() [4/5]

zoneToCell ( const polyMesh & mesh,
const dictionary & dict )

Construct from dictionary.

Definition at line 171 of file zoneToCell.C.

References dict, topoSetSource::mesh(), and topoSetCellSource::topoSetCellSource().

Here is the call graph for this function:

◆ zoneToCell() [5/5]

zoneToCell ( const polyMesh & mesh,
Istream & is )

Construct from Istream.

Definition at line 189 of file zoneToCell.C.

References topoSetSource::checkIs(), topoSetSource::mesh(), and zoneToCell().

Here is the call graph for this function:

◆ ~zoneToCell()

virtual ~zoneToCell ( )
virtualdefault

Destructor.

References applyToSet(), Foam::noexcept, zoneIDs, and zones().

Here is the call graph for this function:

Member Function Documentation

◆ TypeName()

TypeName ( "zoneToCell" )

Runtime type information.

References dict, topoSetSource::mesh(), and zoneIDs.

Here is the call graph for this function:

◆ zones() [1/5]

const Foam::wordRes & zones ( ) const
noexcept

Return the current zones selector.

Definition at line 201 of file zoneToCell.C.

References Foam::noexcept.

Referenced by ~zoneToCell().

Here is the caller graph for this function:

◆ zones() [2/5]

void zones ( const wordRes & zoneSelector)

Define the zones selector.

Definition at line 207 of file zoneToCell.C.

References List< T >::clear().

Here is the call graph for this function:

◆ zones() [3/5]

void zones ( const wordRe & zoneName)

Define the zones selector with a single zone selector.

Definition at line 214 of file zoneToCell.C.

References wordRe::clear(), and List< T >::resize().

Here is the call graph for this function:

◆ zones() [4/5]

void zones ( const labelUList & zoneIDs)

Define the cellZone IDs to use (must exist).

Clears the zone name matcher

Definition at line 222 of file zoneToCell.C.

References List< T >::clear(), and zoneIDs.

Here is the call graph for this function:

◆ zones() [5/5]

void zones ( const label zoneID)

Define the cellZone ID to use (must exist).

Clears the zone name matcher

Definition at line 229 of file zoneToCell.C.

References List< T >::clear().

Here is the call graph for this function:

◆ applyToSet()

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

Apply specified action to the topoSet.

Implements topoSetSource.

Definition at line 237 of file zoneToCell.C.

References topoSetSource::ADD, Foam::endl(), Foam::flatOutput(), Foam::Info, topoSetSource::NEW, topoSetSource::SUBTRACT, and topoSetSource::verbose_.

Referenced by ~zoneToCell().

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

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