41 triad::uniform(vector::uniform(0))
47 triad::uniform(vector::uniform(1))
53 triad::uniform(vector::uniform(vGreat))
59 triad::uniform(vector::uniform(-vGreat))
65 triad::uniform(vector::uniform(rootVGreat))
71 triad::uniform(vector::uniform(-rootVGreat))
77 triad::uniform(vector::uniform(NaN))
89 triad::uniform(vector::uniform(vGreat))
123 if (set(0) && set(1) && !set(2))
125 operator[](2) = orthogonal(
operator[](0),
operator[](1));
127 else if (set(0) && set(2) && !set(1))
129 operator[](1) = orthogonal(
operator[](0),
operator[](2));
131 else if (set(1) && set(2) && !set(0))
133 operator[](0) = orthogonal(
operator[](1),
operator[](2));
143 (set(0) && set(1)) ?
mag(
operator[](0) &
operator[](1)) : vGreat
147 (set(0) && set(2)) ?
mag(
operator[](0) &
operator[](2)) : vGreat
151 (set(1) && set(2)) ?
mag(
operator[](1) &
operator[](2)) : vGreat
154 if (o01 < o02 && o01 < o12)
156 operator[](2) = orthogonal(
operator[](0),
operator[](1));
169 operator[](1) = orthogonal(
operator[](0),
operator[](2));
182 operator[](0) = orthogonal(
operator[](1),
operator[](2));
204 if (t2.
set(i) && !set(i))
206 operator[](i) = t2.operator[](i);
215 if (set() && t2.
set())
228 scalar mostAligned = -1;
234 if (correspondence[
k] == j)
243 scalar a = operator[](i) & t2.operator[](j);
244 scalar maga =
mag(a);
246 if (maga > mostAligned)
248 correspondence[i] = j;
255 operator[](i) += signd[i]*t2.operator[](correspondence[i]);
267 mag(v &
operator[](0)),
268 mag(v &
operator[](1)),
269 mag(v &
operator[](2))
276 mostAligned.
x() > mostAligned.
y()
277 && mostAligned.
x() > mostAligned.
z()
280 mav = mostAligned.
x();
281 mostAligned = operator[](0);
283 else if (mostAligned.
y() > mostAligned.
z())
285 mav = mostAligned.
y();
286 mostAligned = operator[](1);
290 mav = mostAligned.
z();
291 mostAligned = operator[](2);
317 mag(
operator[](0).
x()) >
mag(
operator[](1).
x())
318 &&
mag(
operator[](0).
x()) >
mag(
operator[](2).
x())
321 t[0] = operator[](0);
323 if (
mag(
operator[](1).
y()) >
mag(
operator[](2).
y()))
325 t[1] = operator[](1);
326 t[2] = operator[](2);
330 t[1] = operator[](2);
331 t[2] = operator[](1);
336 mag(
operator[](1).
x()) >
mag(
operator[](2).
x())
339 t[0] = operator[](1);
341 if (
mag(
operator[](0).
y()) >
mag(
operator[](2).
y()))
343 t[1] = operator[](0);
344 t[2] = operator[](2);
348 t[1] = operator[](2);
349 t[2] = operator[](0);
354 t[0] = operator[](2);
356 if (
mag(
operator[](0).
y()) >
mag(
operator[](1).
y()))
358 t[1] = operator[](0);
359 t[2] = operator[](1);
363 t[1] = operator[](1);
364 t[2] = operator[](0);
368 if (t[0].
x() < 0) t[0] *= -1;
369 if (t[1].
y() < 0) t[1] *= -1;
370 if (t[2].z() < 0) t[2] *= -1;
414 scalar sumDifference = 0;
418 if (!tmpA.
set(dir) || !tmpB.
set(dir))
424 (tmpA[dir] & tmpB[dir])
425 /(
mag(tmpA[dir])*
mag(tmpA[dir]) + small);
427 cosPhi =
min(
max(cosPhi, -1), 1);
429 sumDifference +=
mag(cosPhi - 1);
432 return (sumDifference/3);
static const Foam::dimensionedScalar A("A", Foam::dimPressure, 611.21)
static const Foam::dimensionedScalar B("B", Foam::dimless, 18.678)
Tensor< Cmpt > T() const
Return transpose.
static const char *const componentNames[]
friend Ostream & operator(Ostream &, const VectorSpace< Form, Cmpt, Ncmpts > &)
static const Form rootMax
static const Form rootMin
static const char *const typeName
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
Quaternion class used to perform rotations in 3D space.
tensor R() const
The rotation tensor corresponding the quaternion.
Representation of a 3D Cartesian coordinate system as a Vector of vectors.
void align(const vector &v)
Align this triad with the given vector v.
bool set(const direction d) const
Is the vector in the direction d set.
triad sortxyz() const
Sort the axes such that they are closest to the x, y and z axes.
void operator+=(const triad &t2)
Add the triad t2 to this triad.
void operator=(const Vector< vector > &)
void orthogonalise()
Orthogonalise this triad so that it is ortho-normal.
tensor rotationTensor(const vector &n1, const vector &n2)
Rotational transformation tensor from unit vector n1 to n2.
dimensionedScalar sign(const dimensionedScalar &ds)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
Vector< scalar > vector
A scalar version of the templated Vector.
scalar diff(const triad &A, const triad &B)
Return a quantity of the difference between two triads.
dimensionSet transform(const dimensionSet &)
dimensioned< scalar > mag(const dimensioned< Type > &)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
static scalar R(const scalar a, const scalar x)