Go to the documentation of this file.
48 const vector a = p2_ - p1_;
52 const scalar asqr = a & a;
53 const scalar bsqr =
b &
b;
54 const scalar adotb = a &
b;
56 const scalar denom = asqr*bsqr - adotb*adotb;
58 if (
mag(denom) < VSMALL)
65 const scalar fact = 0.5*(bsqr - adotb)/denom;
67 point centre = 0.5*a + fact*((a ^
b) ^ a);
72 const vector r1(p1_ - centre);
73 const vector r2(p2_ - centre);
74 const vector r3(p3_ - centre);
80 if (((r1 ^ r2) & (r1 ^ r3)) < 0.0)
82 angle_ = 360.0 - angle_;
91 if (
mag(arcAxis)/(
mag(r1)*
mag(r3)) < 0.001)
104 return coordSystem::cylindrical(
"arc", centre, arcAxis, r1);
110 Foam::blockEdges::arcEdge::arcEdge
119 p1_(points_[start_]),
126 Foam::blockEdges::arcEdge::arcEdge
136 p1_(points_[start_]),
147 if (lambda < -SMALL || lambda > 1 + SMALL)
150 <<
"Parameter out of range, lambda = " <<
lambda
158 else if (
lambda > 1 - SMALL)
scalar length() const
The length of the curve.
Unit conversion functions.
Define a curved edge that is parameterized for 0<lambda<1 between the start and end point.
defineTypeNameAndDebug(arcEdge, 0)
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
addToRunTimeSelectionTable(blockEdge, arcEdge, Istream)
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
constexpr scalar radToDeg(const scalar rad) noexcept
Conversion from radians to degrees.
A cylindrical coordinate system (r-theta-z). The coordinate system angle theta is always in radians.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
point position(const scalar lambda) const
The point corresponding to the curve parameter [0-1].
dimensionedScalar lambda("lambda", dimTime/sqr(dimLength), laminarTransport)
Macros for easy insertion into run-time selection tables.
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
errorManip< error > abort(error &err)
Vector< scalar > vector
A scalar version of the templated Vector.
constexpr scalar degToRad(const scalar deg) noexcept
Conversion from degrees to radians.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensionedScalar acos(const dimensionedScalar &ds)
Container for searchableSurfaces. The collection is specified as a dictionary. For example,...
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Defines the arcEdge of a circle in terms of 3 points on its circumference.
vector point
Point is a vector.