41 void Foam::truncatedConeToCell::combine(topoSet& set,
const bool add)
const
43 const vector axis = point2_ - point1_;
44 const scalar magAxisSquared =
magSqr(axis);
50 const vector d = ctrs[celli] - point1_;
51 const scalar magD = d & axis;
53 if ((magD > 0) && (magD < magAxisSquared))
55 const scalar d2 =
magSqr(d) -
sqr(magD)/magAxisSquared;
56 const scalar radiusAtCell =
57 radius1_ + (radius2_ - radius1_)*magD/(axis&axis);
59 if (d2 <=
sqr(radiusAtCell))
117 Info<<
" Adding cells with centre within cone, with point1 = "
119 <<
", point2 = " << point2_
120 <<
" and radii = " << radius1_ <<
" to " << radius2_ <<
endl;
126 Info<<
" Removing cells with centre within cone, with point1 = "
128 <<
", point2 = " << point2_
129 <<
" and radii = " << radius1_ <<
" to " << radius2_ <<
endl;
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
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 topoSetSource to select cells with centres inside a truncated cone.
virtual ~truncatedConeToCell()
Destructor.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &) const
truncatedConeToCell(const polyMesh &mesh, const vector &point1, const vector &point2, const scalar radius1, const scalar radius2)
Construct from components.
A class for handling words, derived from string.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
addToRunTimeSelectionTable(polyPatch, mergedCyclicPolyPatch, word)
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.
defineTypeNameAndDebug(combustionModel, 0)
void sqr(LagrangianPatchField< typename outerProduct< Type, Type >::type > &f, const LagrangianPatchField< Type > &f1)
void magSqr(LagrangianPatchField< scalar > &f, const LagrangianPatchField< Type > &f1)
void add(LagrangianPatchField< typename typeOfSum< Type1, Type2 >::type > &f, const LagrangianPatchField< Type1 > &f1, const LagrangianPatchField< Type2 > &f2)
treeBoundBox combine(const treeBoundBox &a, const treeBoundBox &b)