44 void Foam::blockEdges::arcEdge::calc(
const point& pA)
46 const tensor dps(pA - p0_, pA - p1_, (pA - p0_)^(pA - p1_));
47 const tensor pMs((p0_ + pA)/2, (p1_ + pA)/2, pA);
49 if (
det(dps) < vSmall)
52 <<
"Arc point " << pA <<
" lies on the line of edge " 58 &
vector(dps.
x() & pMs.
x(), dps.
y() & pMs.
y(), dps.
z() & pMs.
z());
60 const vector r0 = p0_ -
c, r1 = p1_ -
c;
61 const scalar cosT = (r0 & r1)/(
mag(r0)*
mag(r1));
63 if (((r0 ^ r1) & dps.
z()) > 0)
75 void Foam::blockEdges::arcEdge::calc(
const scalar theta,
const vector& axis)
77 if (0 >= theta || theta >= 360)
80 <<
"Arc angle for edge " <<
edge(start_, end_)
81 <<
" must take a value between 0 and 360 degrees" 85 const vector dp = p1_ - p0_;
87 const vector pM = (p0_ + p1_)/2;
90 const scalar l = dp & axis;
92 const vector chord = dp - l*axis;
93 const scalar magChord =
mag(chord);
95 centre_ = pM - l*axis/2 - rM*magChord/2/
tan(
degToRad(theta)/2);
114 p0_(points_[start_]),
121 token firstToken(is);
142 if (lambda < - small || lambda > 1 + small)
145 <<
"Parameter out of range, lambda = " << lambda
149 const scalar t = theta_*
lambda;
150 const vector r1 = p0_ - centre_, r2 = axis_ ^ r1;
152 return centre_ + r1*
cos(t) + r2*
sin(t) + axis_*length_*
lambda;
158 const vector r1 = p0_ - centre_;
dimensionedScalar acos(const dimensionedScalar &ds)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
point position(const scalar) const
Return the point position corresponding to the curve parameter.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Unit conversion functions.
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
A token holds items read from Istream.
void putBack(const token &)
Put back token.
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensionedScalar lambda(viscosity->lookup("lambda"))
Vector< scalar > vector
A scalar version of the templated Vector.
dimensionedScalar det(const dimensionedSphericalTensor &dt)
const dimensionedScalar c
Speed of light in a vacuum.
Macros for easy insertion into run-time selection tables.
An arcEdge between two points on a circle. The arc is defined either by a third point that the arc pa...
scalar degToRad(const scalar deg)
Conversion from degrees to radians.
arcEdge(const dictionary &dict, const label index, const searchableSurfaces &geometry, const pointField &points, Istream &)
Construct from Istream setting pointsList.
Form normalised(const VectorSpace< Form, Cmpt, Ncmpts > &vs)
dimensionedScalar cos(const dimensionedScalar &ds)
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
Container for searchableSurfaces.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if successful.
errorManip< error > abort(error &err)
dimensioned< scalar > magSqr(const dimensioned< Type > &)
dimensionedScalar sin(const dimensionedScalar &ds)
defineTypeNameAndDebug(arcEdge, 0)
addToRunTimeSelectionTable(blockEdge, arcEdge, Istream)
Define a curved edge that is parameterised for 0<lambda<1 between the start and end point...
dimensioned< scalar > mag(const dimensioned< Type > &)
scalar length() const
Return the length of the curve.
dimensionedScalar tan(const dimensionedScalar &ds)