Go to the documentation of this file.
52 <<
"Span should have two positive and one zero entry. Now:"
55 else if (span[dir] < VSMALL)
73 <<
"Span should have two positive and one zero entry. Now:"
85 const scalar nearestDistSqr
98 info.
rawPoint()[normalDir_] = origin_[normalDir_];
103 if (dir != normalDir_)
105 if (info.
rawPoint()[dir] < origin_[dir])
107 info.
rawPoint()[dir] = origin_[dir];
109 else if (info.
rawPoint()[dir] > origin_[dir]+span_[dir])
111 info.
rawPoint()[dir] = origin_[dir]+span_[dir];
141 const vector dir(end-start);
143 if (
mag(dir[normalDir_]) < VSMALL)
150 scalar t = (origin_[normalDir_]-start[normalDir_]) / dir[normalDir_];
160 info.
rawPoint()[normalDir_] = origin_[normalDir_];
165 if (dir != normalDir_)
167 if (info.
rawPoint()[dir] < origin_[dir])
173 else if (info.
rawPoint()[dir] > origin_[dir]+span_[dir])
188 bb.
min()[normalDir_] -= 1
e-6;
189 bb.
max()[normalDir_] += 1
e-6;
194 <<
"bb:" << bb <<
endl
195 <<
"origin_:" << origin_ <<
endl
196 <<
"span_:" << span_ <<
endl
197 <<
"normalDir_:" << normalDir_ <<
endl
219 normalDir_(calcNormal(span_))
223 Info<<
"searchablePlate::searchablePlate :"
224 <<
" origin:" << origin_
225 <<
" origin+span:" << origin_+span_
230 bounds() =
boundBox(origin_, origin_ + span_);
243 normalDir_(calcNormal(span_))
247 Info<<
"searchablePlate::searchablePlate :"
248 <<
" origin:" << origin_
249 <<
" origin+span:" << origin_+span_
254 bounds() =
boundBox(origin_, origin_ + span_);
268 if (regions_.empty())
271 regions_[0] =
"region0";
290 centres[0] = origin_ + 0.5*span_;
292 radiusSqr.setSize(1);
306 pts[2] = origin_ + span_;
308 if (span_.x() < span_.y() && span_.x() < span_.z())
310 pts[1] = origin_ +
point(0, span_.y(), 0);
311 pts[3] = origin_ +
point(0, 0, span_.z());
313 else if (span_.y() < span_.z())
315 pts[1] = origin_ +
point(span_.x(), 0, 0);
316 pts[3] = origin_ +
point(0, 0, span_.z());
320 pts[1] = origin_ +
point(span_.x(), 0, 0);
321 pts[3] = origin_ +
point(0, span_.y(), 0);
332 (origin_.x() + span_.x()) >= bb.
min().
x()
333 && origin_.x() <= bb.
max().
x()
334 && (origin_.y() + span_.y()) >= bb.
min().
y()
335 && origin_.y() <= bb.
max().
y()
336 && (origin_.z() + span_.z()) >= bb.
min().
z()
337 && origin_.z() <= bb.
max().
z()
353 info[i] = findNearest(
samples[i], nearestDistSqr[i]);
369 info[i] = findLine(start[i], end[i]);
381 findLine(start, end, info);
393 findLine(start, end, nearestInfo);
398 if (nearestInfo[pointI].hit())
401 info[pointI][0] = nearestInfo[pointI];
405 info[pointI].
clear();
432 normal[i][normalDir_] = 1.0;
444 <<
"Volume type not supported for plate."
vectorField pointField
pointField is a vectorField.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
void setIndex(const label index)
const point & max() const
Maximum describing the bounding box.
#define forAll(list, i)
Loop across all elements in list.
A class for managing temporary objects.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
Standard boundBox + extra functionality for use in octree.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
bool hit() const
Is there a hit.
@ nComponents
Number of components in this vector space.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual bool overlaps(const boundBox &bb) const
Does any part of the surface overlap the supplied bound box?
dimensioned< scalar > mag(const dimensioned< Type > &)
static const char * componentNames[]
virtual tmp< pointField > points() const
Get the points that define the surface.
scalarField samples(nIntervals, 0)
virtual void findLineAll(const pointField &start, const pointField &end, List< List< pointIndexHit > > &) const
Get all intersections in order from start to end.
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
const Point & rawPoint() const
Return point with no checking.
Pre-declare SubField and related Field type.
searchablePlate(const searchablePlate &)
Disallow default bitwise copy construct.
const Point & hitPoint() const
Return hit point.
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
const point & min() const
Minimum describing the bounding box.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Macros for easy insertion into run-time selection tables.
errorManip< error > abort(error &err)
const double e
Elementary charge.
errorManipArg< error, int > exit(error &err, const int errNo=1)
void setSize(const label)
Reset size of List.
static direction calcNormal(const point &)
Calculate normal direction from span.
virtual ~searchablePlate()
Destructor.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
bool contains(const vector &dir, const point &) const
Contains point (inside or on edge) and moving in direction.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
virtual tmp< pointField > coordinates() const
Get representative set of element coordinates.
virtual void findLineAny(const pointField &start, const pointField &end, List< pointIndexHit > &) const
Return any intersection on segment from start to end.
void clear()
Clear the list, i.e. set size to zero.
pointIndexHit findLine(const point &start, const point &end) const
A bounding box defined in terms of the points at its extremities.
virtual const wordList & regions() const
Names of regions.
void size(const label)
Override size to be inconsistent with allocated storage.
vector point
Point is a vector.
virtual void getNormal(const List< pointIndexHit > &, vectorField &normal) const
From a set of points and indices get the normal.
virtual void boundingSpheres(pointField ¢res, scalarField &radiusSqr) const
Get bounding spheres (centre and radius squared), one per element.
defineTypeNameAndDebug(combustionModel, 0)
pointIndexHit findNearest(const point &sample, const scalar nearestDistSqr) const
dimensioned< scalar > magSqr(const dimensioned< Type > &)
virtual void getVolumeType(const pointField &, List< volumeType > &) const
Determine type (inside/outside/mixed) for point. unknown if.
virtual void getRegion(const List< pointIndexHit > &, labelList ®ion) const
From a set of points and indices get the region.
A normal distribution model.