42 cylinderToCell::typeName,
43 "\n Usage: cylinderToCell (point1X point1Y point1Z)" 44 " (point2X point2Y point2Z) radius\n\n" 45 " Select all cells with cell centre within bounding cylinder\n\n" 51 void Foam::cylinderToCell::combine(topoSet&
set,
const bool add)
const 53 const vector axis = point2_ - point1_;
54 const scalar rad2 =
sqr(radius_);
55 const scalar magAxis2 =
magSqr(axis);
61 vector d = ctrs[celli] - point1_;
62 scalar magD = d & axis;
64 if ((magD > 0) && (magD < magAxis2))
66 scalar d2 = (d & d) -
sqr(magD)/magAxis2;
69 addOrDelete(
set, celli, add);
102 radius_(dict.
lookup<scalar>(
"radius"))
113 point1_(checkIs(is)),
114 point2_(checkIs(is)),
135 Info<<
" Adding cells with centre within cylinder, with point1 = " 136 << point1_ <<
", point2 = " << point2_ <<
" and radius = " 143 Info<<
" Removing cells with centre within cylinder, with point1 = " 144 << point1_ <<
", point2 = " << point2_ <<
" and radius = " #define forAll(list, i)
Loop across all elements in list.
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.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &) const
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.
setAction
Enumeration defining the valid actions.
cylinderToCell(const polyMesh &mesh, const vector &point1, const vector &point2, const scalar radius)
Construct from components.
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if successful.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
virtual ~cylinderToCell()
Destructor.
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.