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))
90 const dictionary&
dict
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.
const vectorField & cellCentres() const
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.
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.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
const unitSet & lookup(const word &unitName)
Lookup and return the named unit from the table.
addToRunTimeSelectionTable(polyPatch, mergedCyclicPolyPatch, word)
void add(GeometricField< typename typeOfSum< Type1, Type2 >::type, GeoMesh, PrimitiveField1 > &gf, const GeometricField< Type1, GeoMesh, PrimitiveField2 > &gf1, const GeometricField< Type2, GeoMesh, PrimitiveField3 > &gf2)
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionSet & dimLength
vectorField pointField
pointField is a vectorField.
vector point
Point is a vector.
tmp< DimensionedField< typename outerProduct< Type, Type >::type, GeoMesh, Field >> sqr(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
Vector< scalar > vector
A scalar version of the templated Vector.
treeBoundBox combine(const treeBoundBox &a, const treeBoundBox &b)
tmp< DimensionedField< scalar, GeoMesh, Field > > magSqr(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
defineTypeNameAndDebug(atmosphericBoundaryLayer, 0)