42 sphereToCell::typeName,
43 "\n Usage: sphereToCell (centreX centreY centreZ) radius\n\n" 44 " Select all cells with cellCentre within bounding sphere\n\n" 50 void Foam::sphereToCell::combine(topoSet&
set,
const bool add)
const 54 const scalar radSquared = radius_*radius_;
58 scalar offset =
magSqr(centre_ - ctrs[celli]);
59 if (offset <= radSquared)
61 addOrDelete(
set, celli, add);
89 centre_(dict.
lookup(
"centre")),
102 centre_(checkIs(is)),
123 Info<<
" Adding cells with centre within sphere, with centre = " 124 << centre_ <<
" and radius = " << radius_ <<
endl;
130 Info<<
" Removing cells with centre within sphere, with centre = " 131 << centre_ <<
" 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...
virtual ~sphereToCell()
Destructor.
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.
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.
sphereToCell(const polyMesh &mesh, const vector ¢re, const scalar radius)
Construct from components.
vectorField pointField
pointField is a vectorField.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &) const
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)
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.