41 void Foam::cylinderToCell::combine(topoSet& set,
const bool add)
const
43 const vector axis = point2_ - point1_;
44 const scalar rad2 =
sqr(radius_);
45 const scalar magAxis2 =
magSqr(axis);
51 vector d = ctrs[celli] - point1_;
52 scalar magD = d & axis;
54 if ((magD > 0) && (magD < magAxis2))
56 scalar d2 = (d & d) -
sqr(magD)/magAxis2;
112 Info<<
" Adding cells with centre within cylinder, with point1 = "
113 << point1_ <<
", point2 = " << point2_ <<
" and radius = "
120 Info<<
" Removing cells with centre within cylinder, with point1 = "
121 << point1_ <<
", point2 = " << point2_ <<
" and radius = "
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
A topoSetSource to select cells based on cell centres inside a cylinder.
virtual ~cylinderToCell()
Destructor.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &) const
cylinderToCell(const polyMesh &mesh, const vector &point1, const vector &point2, const scalar radius)
Construct from components.
A list of keyword definitions, which are a keyword followed by any number of values (e....
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
ITstream & lookupBackwardsCompatible(const wordList &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream, trying a list of keywords.
Mesh consisting of general polyhedral cells.
const vectorField & cellCentres() const
Base class of a source for a topoSet.
void addOrDelete(topoSet &set, const label celli, const bool) const
Add (if bool) celli to set or delete celli from set.
setAction
Enumeration defining the valid actions.
General set of labels of mesh quantity (points, cells, faces).
A class for handling words, derived from string.
addToRunTimeSelectionTable(polyPatch, mergedCyclicPolyPatch, word)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionSet dimLength
vectorField pointField
pointField is a vectorField.
Vector< scalar > vector
A scalar version of the templated Vector.
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
defineTypeNameAndDebug(combustionModel, 0)
treeBoundBox combine(const treeBoundBox &a, const treeBoundBox &b)
dimensioned< scalar > magSqr(const dimensioned< Type > &)