42 cylinderToCell::typeName,
43 "\n Usage: cylinderToCell (p1X p1Y p1Z) (p2X p2Y p2Z) radius\n\n" 44 " Select all cells with cell centre within bounding cylinder\n\n" 50 void Foam::cylinderToCell::combine(topoSet&
set,
const bool add)
const 52 const vector axis = p2_ - p1_;
53 const scalar rad2 =
sqr(radius_);
54 const scalar magAxis2 =
magSqr(axis);
60 vector d = ctrs[celli] - p1_;
61 scalar magD = d & axis;
63 if ((magD > 0) && (magD < magAxis2))
65 scalar d2 = (d & d) -
sqr(magD)/magAxis2;
68 addOrDelete(
set, celli, add);
135 Info<<
" Adding cells with centre within cylinder, with p1 = " 136 << p1_ <<
", p2 = " << p2_ <<
" and radius = " << radius_ <<
endl;
142 Info<<
" Removing cells with centre within cylinder, with p1 = " 143 << p1_ <<
", p2 = " << p2_ <<
" and radius = " << radius_ <<
endl;
#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)
cylinderToCell(const polyMesh &mesh, const vector &p1, const vector &p2, const scalar radius)
Construct from components.
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.
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
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 & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.