Go to the documentation of this file.
34 if (
mag(
C[0]) > VSMALL)
40 if (
mag(
C[1]) > VSMALL)
46 if (
mag(
C[2]) > VSMALL)
53 <<
"At least one plane coefficient must have a value"
62 if (magUnitVector < VSMALL)
65 <<
"Plane normal defined with zero length"
80 basePoint_ = (point1 + point2 + point3)/3;
81 vector line12 = point1 - point2;
82 vector line23 = point2 - point3;
87 ||
mag(line23) < VSMALL
88 ||
mag(point3-point1) < VSMALL
92 <<
"Bad points:" << point1 <<
' ' << point2 <<
' ' << point3
96 unitVector_ = line12 ^ line23;
97 scalar magUnitVector(
mag(unitVector_));
99 if (magUnitVector < VSMALL)
102 <<
"Plane normal defined with zero length" <<
nl
103 <<
"Bad points:" << point1 <<
' ' << point2 <<
' ' << point3
107 unitVector_ /= magUnitVector;
116 unitVector_(normalVector),
121 if (magUnitVector > VSMALL)
128 <<
"plane normal has zero length. basePoint:" <<
basePoint_
137 unitVector_(normalVector),
138 basePoint_(basePoint)
142 if (magUnitVector > VSMALL)
149 <<
"plane normal has zero length. basePoint:" <<
basePoint_
170 calcPntAndVec(a,
b,
c);
180 const word planeType(
dict.lookup(
"planeType"));
182 if (planeType ==
"planeEquation")
195 else if (planeType ==
"embeddedPoints")
205 else if (planeType ==
"pointAndNormal")
216 <<
"Invalid plane type: " << planeType <<
nl
217 <<
"Valid options include: planeEquation, embeddedPoints and "
232 if (magUnitVector > VSMALL)
239 <<
"plane normal has zero length. basePoint:" <<
basePoint_
266 scalar magX =
mag(unitVector_.x());
267 scalar magY =
mag(unitVector_.y());
268 scalar magZ =
mag(unitVector_.z());
275 C[1] = unitVector_.y()/unitVector_.x();
276 C[2] = unitVector_.z()/unitVector_.x();
280 C[0] = unitVector_.x()/unitVector_.z();
281 C[1] = unitVector_.y()/unitVector_.z();
289 C[0] = unitVector_.x()/unitVector_.y();
291 C[2] = unitVector_.z()/unitVector_.y();
295 C[0] = unitVector_.x()/unitVector_.z();
296 C[1] = unitVector_.y()/unitVector_.z();
301 C[3] = -
C[0] * basePoint_.x()
302 -
C[1] * basePoint_.y()
303 -
C[2] * basePoint_.z();
312 return p - unitVector_*((
p - basePoint_) & unitVector_);
319 return mag((
p - basePoint_) & unitVector_);
330 scalar denom =
stabilise((dir & unitVector_), VSMALL);
332 return ((basePoint_ - pnt0) & unitVector_)/denom;
347 const point& p1 = refPoint();
357 scalar magX =
mag(dir.
x());
358 scalar magY =
mag(dir.
y());
359 scalar magZ =
mag(dir.
z());
397 pt[i1] = (n2[i2]*n1p1 - n1[i2]*n2p2) / (n1[i1]*n2[i2] - n2[i1]*n1[i2]);
398 pt[i2] = (n2[i1]*n1p1 - n1[i1]*n2p2) / (n1[i2]*n2[i1] - n1[i1]*n2[i2]);
417 coeffs1[0],coeffs1[1],coeffs1[2],
418 coeffs2[0],coeffs2[1],coeffs2[2],
419 coeffs3[0],coeffs3[1],coeffs3[2]
422 vector b(coeffs1[3],coeffs2[3],coeffs3[3]);
424 return (
inv(a) & (-
b));
430 const scalar angle((
p - basePoint_) & unitVector_);
432 return (angle < 0 ? FLIP : NORMAL);
438 const vector mirroredPtDir =
p - nearestPoint(
p);
440 if ((
normal() & mirroredPtDir) > 0)
455 os <<
indent <<
"pointAndNormalDict" <<
nl
scalar distance(const point &p) const
Return distance from the given point to the plane.
Templated 3D tensor derived from VectorSpace adding construction from 9 components,...
const vector & normal() const
Return plane normal.
void calcPntAndVec(const scalarList &C)
Calculates basePoint and normal vector given plane coefficients.
point nearestPoint(const point &p) const
Return nearest point in the plane for the given point.
A class for handling words, derived from string.
vector unitVector_
Plane normal.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
plane(const vector &normalVector)
Construct from normal vector through the origin.
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< scalar > mag(const dimensioned< Type > &)
Ostream & incrIndent(Ostream &os)
Increment the indent level.
Geometric class that creates a 2D plane and can return the intersection point between a line and the ...
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
tmp< DimensionedField< scalar, GeoMesh > > stabilise(const DimensionedField< scalar, GeoMesh > &dsf, const dimensioned< scalar > &ds)
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
void writeDict(Ostream &) const
Write to dictionary.
Ostream & operator<<(Ostream &, const edgeMesh &)
FixedList< scalar, 4 > planeCoeffs() const
Return coefficients for the.
bool operator!=(const particle &, const particle &)
A list of keyword definitions, which are a keyword followed by any number of values (e....
point basePoint_
Base point.
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
errorManip< error > abort(error &err)
A direction and a reference point.
Ostream & indent(Ostream &os)
Indent stream.
Vector< scalar > vector
A scalar version of the templated Vector.
scalar distance(const vector &p1, const vector &p2)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
ray planeIntersect(const plane &) const
Return the cutting line between this plane and another.
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A 1D vector of objects of type <T> with a fixed size <Size>.
Ostream & writeKeyword(const keyType &)
Write the keyword followed by an appropriate indentation.
const point & refPoint() const
Return or return plane base point.
const dimensionedScalar c
Speed of light in a vacuum.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
side sideOfPlane(const point &p) const
Return the side of the plane that the point is on.
Graphite solid properties.
scalar normalIntersect(const point &pnt0, const vector &dir) const
Return cut coefficient for plane and line defined by.
point planePlaneIntersect(const plane &, const plane &) const
Return the cutting point between this plane and two other planes.
point mirror(const point &p) const
Mirror the supplied point in the plane. Return the mirrored point.
A normal distribution model.
A class representing the concept of 0 used to avoid unnecessary manipulations for objects that are kn...