42 cylinderAnnulusToCell::typeName,
43 "\n Usage: cylinderAnnulusToCell (point1X point1Y point1Z)" 44 " (point2X point2Y point2Z) outerRadius innerRadius\n\n" 45 " Select all cells with cell centre within bounding cylinder annulus\n\n" 51 void Foam::cylinderAnnulusToCell::combine(topoSet&
set,
const bool add)
const 53 const vector axis = point2_ - point1_;
54 const scalar orad2 =
sqr(outerRadius_);
55 const scalar irad2 =
sqr(innerRadius_);
56 const scalar magAxis2 =
magSqr(axis);
62 vector d = ctrs[celli] - point1_;
63 scalar magD = d & axis;
65 if ((magD > 0) && (magD < magAxis2))
67 scalar d2 = (d & d) -
sqr(magD)/magAxis2;
68 if ((d2 < orad2) && (d2 > irad2))
70 addOrDelete(
set, celli, add);
84 const scalar outerRadius,
85 const scalar innerRadius
91 outerRadius_(outerRadius),
92 innerRadius_(innerRadius)
105 outerRadius_(dict.
lookup<scalar>(
"outerRadius")),
106 innerRadius_(dict.
lookup<scalar>(
"innerRadius"))
117 point1_(checkIs(is)),
118 point2_(checkIs(is)),
140 Info<<
" Adding cells with centre within cylinder annulus," 142 << point1_ <<
", point2 = " << point2_ <<
" and outer radius = " 143 << outerRadius_ <<
" and inner radius = " << innerRadius_ <<
endl;
149 Info<<
" Removing cells with centre within cylinder, with point1 = " 150 << point1_ <<
", point2 = " << point2_ <<
" and outer radius = " 151 << outerRadius_ <<
" and inner radius " << innerRadius_ <<
endl;
#define forAll(list, i)
Loop across all elements in list.
virtual ~cylinderAnnulusToCell()
A list of keyword definitions, which are a keyword followed by any number of values (e...
dimensionedSymmTensor sqr(const dimensionedVector &dv)
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Ostream & endl(Ostream &os)
Add newline and flush stream.
Vector< scalar > vector
A scalar version of the templated Vector.
AccessType combine(const List< T > &, AccessOp aop=accessOp< T >())
Combines sublists into one big list.
Macros for easy insertion into run-time selection tables.
Base class of a source for a topoSet.
vectorField pointField
pointField is a vectorField.
cylinderAnnulusToCell(const polyMesh &mesh, const vector &point1, const vector &point2, const scalar outerRadius, const scalar innerRadius)
Construct from components.
setAction
Enumeration defining the valid actions.
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if successful.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &) const
dimensioned< scalar > magSqr(const dimensioned< Type > &)
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
General set of labels of mesh quantity (points, cells, faces).
Class with constructor to add usage string to table.
Mesh consisting of general polyhedral cells.
ITstream & lookupBackwardsCompatible(const wordList &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream, trying a list of keywords.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.