84 radius_(
dict.get<scalar>(
"radius"))
136 if (regions_.empty())
139 regions_[0] =
"region0";
147 return eMeshPtr_().points().size();
153 return eMeshPtr_().points();
163 centres = eMeshPtr_().points();
184 const scalar nearestDist =
Foam::sqrt(nearestDistSqr[i]);
185 const scalar searchDistSqr =
Foam::sqr(nearestDist+radius_);
188 info[i] = tree.findNearest(
samples[i], searchDistSqr);
194 const scalar
s(
mag(d));
203 const scalar distToSurface = radius_-
s;
204 if (
mag(distToSurface) > nearestDist)
210 info[i].setPoint(info[i].hitPoint() + d/
s*radius_);
238 (rawLambdas-rawLambdas[0])
239 /(rawLambdas.
last()-rawLambdas[0])
247 const pointIndexHit startInfo = tree.findNearest(start, maxDistSqr);
248 curvePoints[0] = startInfo.
hitPoint();
249 axialVecs[0] = edges[startInfo.
index()].vec(
points);
251 const pointIndexHit endInfo = tree.findNearest(end, maxDistSqr);
260 scalar endDistance = -1.0;
264 const point& start = curvePoints[0];
267 label edgei = startInfo.
index();
268 const edge& startE = edges[edgei];
270 label pointi = startE[0];
271 if ((startE.
vec(
points)&(end-start)) > 0)
276 curveLambdas[pointi] =
mag(
points[pointi]-curvePoints[0]);
278 curveLambdas[otherPointi] = -
mag(
points[otherPointi]-curvePoints[0]);
286 const labelList& pEdges = pointEdges[pointi];
287 if (pEdges.
size() == 1)
291 else if (pEdges.
size() != 2)
294 <<
" is not a single path. This is not supported"
299 label oldEdgei = edgei;
300 if (pEdges[0] == oldEdgei)
309 if (edgei == endInfo.
index())
311 endDistance = curveLambdas[pointi] +
mag(end-
points[pointi]);
320 label oldPointi = pointi;
321 pointi = edges[edgei].otherVertex(oldPointi);
323 if (curveLambdas[pointi] >= 0)
328 curveLambdas[pointi] =
329 curveLambdas[oldPointi] + edges[edgei].mag(
points);
335 if (curveLambdas[i] >= 0)
337 curveLambdas[i] /= endDistance;
350 for (label i = 1; i < curvePoints.
size()-1; i++)
352 interpolator.
valueWeights(lambdas[i], indices, weights);
354 if (indices.
size() == 1)
357 label pointi = indices[0];
359 label edge0 = pointEdges[pointi][0];
360 const edge& e0 = edges[edge0];
362 curvePoints[i] = weights[0]*
p0;
364 else if (indices.
size() == 2)
368 axialVecs[i] = p1-
p0;
369 curvePoints[i] = weights[0]*
p0+weights[1]*p1;
372 axialVecs /=
mag(axialVecs);
387 radialStart = start-curvePoints[0];
402 vector projectedEnd = radialEnd;
406 qProjectedEnd =
quaternion(projectedEnd, 0.0);
411 for (label i = 1; i < lambdas.
size()-1; i++)
419 info[i] =
pointIndexHit(
true, curvePoints[i]+radius_*radialDir, 0);
460 normal[i] = info[i].hitPoint()-curvePt.
hitPoint();
465 normal[i].removeCollinear(axialVec);
Macros for easy insertion into run-time selection tables.
#define addNamedToRunTimeSelectionTable(baseType, thisType, argNames, lookupName)
Add to construction table with 'lookupName' as the key.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
void setSize(const label n)
Alias for resize()
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
label index() const noexcept
Return the hit index.
const point_type & hitPoint() const
Return hit point. Fatal if not hit.
void size(const label n)
Older name for setAddressableSize.
T & last()
Return the last element of the list.
Vector< Cmpt > & normalise(const scalar tol=ROOTVSMALL)
Inplace normalise the vector by its magnitude.
Vector< Cmpt > & removeCollinear(const Vector< Cmpt > &unitVec)
A bounding box defined in terms of min/max extrema points.
const point & min() const
Minimum describing the bounding box.
const point & max() const
Maximum describing the bounding box.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Mesh data needed to do the Finite Area discretisation.
const pointField & points() const noexcept
Return points.
const edgeList & edges() const noexcept
Return edges.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
label otherVertex(const label pointLabel) const
Given the point label for one vertex, return the other one.
vector vec(const UList< point > &pts) const
Return the vector (end - start)
Non-pointer based hierarchical recursive searching.
virtual bool valueWeights(const scalar t, labelList &indices, scalarField &weights) const
Calculate weights and indices to calculate t from samples.
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
constant condensation/saturation model.
virtual const pointField & points() const
Return raw points.
const labelListList & pointEdges() const
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
Quaternion class used to perform rotations in 3D space.
vector transform(const vector &v) const
Rotate the given vector.
Searching on edgeMesh with constant radius.
virtual ~searchableExtrudedCircle()
Destructor.
virtual label size() const
Range of local indices that can be returned.
virtual void boundingSpheres(pointField ¢res, scalarField &radiusSqr) const
Get bounding spheres (centre and radius squared), one per element.
virtual tmp< pointField > points() const
Get the points that define the surface.
virtual void getNormal(const List< pointIndexHit > &, vectorField &normal) const
From a set of points and indices get the normal.
virtual void getRegion(const List< pointIndexHit > &, labelList ®ion) const
From a set of points and indices get the region.
virtual const wordList & regions() const
Names of regions.
virtual void findParametricNearest(const point &start, const point &end, const scalarField &lambdas, const scalarField &nearestDistSqr, List< pointIndexHit > &) const
Unique to parametric geometry: given points find.
virtual void findNearest(const pointField &sample, const scalarField &nearestDistSqr, List< pointIndexHit > &) const
virtual tmp< pointField > coordinates() const
Get representative set of element coordinates.
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
virtual const boundBox & bounds() const
Return const reference to boundBox.
A class for managing temporary objects.
Standard boundBox with extra functionality for use in octree.
Holds data for octree to work on an edges subset.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
const volScalarField & p0
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
PointIndexHit< point > pointIndexHit
A PointIndexHit for 3D points.
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
static constexpr const zero Zero
Global zero (0)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
quaternion slerp(const quaternion &qa, const quaternion &qb, const scalar t)
Spherical linear interpolation of quaternions.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
#define forAll(list, i)
Loop across all elements in list.
scalarField samples(nIntervals, Zero)