71 ).objectPath(global())
93 bb.
min() -=
point(rootVSmall, rootVSmall, rootVSmall);
94 bb.
max() +=
point(rootVSmall, rootVSmall, rootVSmall);
126 if (regions_.empty())
129 regions_[0] =
"region0";
137 return eMeshPtr_().points().size();
143 return eMeshPtr_().points();
153 centres = eMeshPtr_().points();
174 info[i] = tree.findNearest(
samples[i], nearestDistSqr[i]);
179 info[i].setPoint(info[i].hitPoint() + d/
mag(d)*radius_);
205 (rawLambdas-rawLambdas[0])
206 /(rawLambdas.
last()-rawLambdas[0])
214 const pointIndexHit startInfo = tree.findNearest(start, maxDistSqr);
215 curvePoints[0] = startInfo.
hitPoint();
216 axialVecs[0] = edges[startInfo.
index()].vec(
points);
218 const pointIndexHit endInfo = tree.findNearest(end, maxDistSqr);
227 scalar endDistance = -1.0;
231 const point& start = curvePoints[0];
235 const edge& startE = edges[edgei];
237 label pointi = startE[0];
238 if ((startE.
vec(
points)&(end-start)) > 0)
243 curveLambdas[pointi] =
mag(
points[pointi]-curvePoints[0]);
245 curveLambdas[otherPointi] = -
mag(
points[otherPointi]-curvePoints[0]);
253 const labelList& pEdges = pointEdges[pointi];
254 if (pEdges.
size() == 1)
258 else if (pEdges.
size() != 2)
261 <<
" is not a single path. This is not supported"
266 label oldEdgei = edgei;
267 if (pEdges[0] == oldEdgei)
276 if (edgei == endInfo.
index())
278 endDistance = curveLambdas[pointi] +
mag(end-
points[pointi]);
287 label oldPointi = pointi;
288 pointi = edges[edgei].otherVertex(oldPointi);
290 if (curveLambdas[pointi] >= 0)
295 curveLambdas[pointi] =
296 curveLambdas[oldPointi] + edges[edgei].mag(
points);
302 if (curveLambdas[i] >= 0)
304 curveLambdas[i] /= endDistance;
317 for (
label i = 1; i < curvePoints.
size()-1; i++)
319 interpolator.
valueWeights(lambdas[i], indices, weights);
321 if (indices.
size() == 1)
324 label pointi = indices[0];
326 label edge0 = pointEdges[pointi][0];
327 const edge& e0 = edges[edge0];
329 curvePoints[i] = weights[0]*p0;
331 else if (indices.
size() == 2)
335 axialVecs[i] = p1-p0;
336 curvePoints[i] = weights[0]*p0+weights[1]*p1;
339 axialVecs /=
mag(axialVecs);
354 radialStart = start-curvePoints[0];
355 radialStart -= (radialStart&axialVecs[0])*axialVecs[0];
356 radialStart /=
mag(radialStart);
365 radialEnd -= (radialEnd&axialVecs.
last())*axialVecs.
last();
366 radialEnd /=
mag(radialEnd);
368 vector projectedEnd = radialEnd;
369 projectedEnd -= (projectedEnd&axialVecs[0])*axialVecs[0];
370 projectedEnd /=
mag(projectedEnd);
371 qProjectedEnd =
quaternion(projectedEnd, 0.0);
376 for (
label i = 1; i < lambdas.
size()-1; i++)
381 radialDir -= (radialDir&axialVecs[i])*axialVecs.
last();
382 radialDir /=
mag(radialDir);
384 info[i] =
pointIndexHit(
true, curvePoints[i]+radius_*radialDir, 0);
425 normal[i] = info[i].hitPoint()-curvePt.
hitPoint();
429 axialVec /=
mag(axialVec);
430 normal[i] -= (normal[i]&axialVec)*axialVec;
431 normal[i] /=
mag(normal[i]);
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
void size(const label)
Override size to be inconsistent with allocated storage.
void setSize(const label)
Reset size of List.
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
const Point & hitPoint() const
Return hit point.
label index() const
Return index.
T & last()
Return the last element of the list.
A bounding box defined in terms of the points at its extremities.
const point & min() const
Minimum point defining the bounding box.
const point & max() const
Maximum point defining the bounding box.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Points connected by edges.
const labelListList & pointEdges() const
Return edges.
const edgeList & edges() const
Return edges.
const pointField & points() const
Return points.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
vector vec(const pointField &) const
Return the vector (end - start)
label otherVertex(const label a) const
Given one vertex, return the other.
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.
Quaternion class used to perform rotations in 3D space.
vector transform(const vector &v) const
Rotate the given vector.
Surface geometry with a tube shape, which can be used with snappyHexMesh. The geometry is formed from...
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.
searchableExtrudedCircle(const IOobject &io, const dictionary &dict)
Construct from dictionary (used by searchableSurface)
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....
const boundBox & bounds() const
Return const reference to boundBox.
A class for managing temporary objects.
Standard boundBox + extra functionality for use in octree.
Holds data for octree to work on an edges subset.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
autoPtr< CompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const viscosity &viscosity)
errorManipArg< error, int > exit(error &err, const int errNo=1)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
addToRunTimeSelectionTable(polyPatch, mergedCyclicPolyPatch, word)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
PointIndexHit< point > pointIndexHit
word name(const bool)
Return a word representation of a bool.
const dimensionSet dimLength
vector point
Point is a vector.
Vector< scalar > vector
A scalar version of the templated Vector.
dimensioned< scalar > mag(const dimensioned< Type > &)
defineTypeNameAndDebug(combustionModel, 0)
labelList identityMap(const label len)
Create identity map (map[i] == i) of given length.
quaternion slerp(const quaternion &qa, const quaternion &qb, const scalar t)
Spherical linear interpolation of quaternions.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
scalarField samples(nIntervals, 0)