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))
83 triad::uniform(vector::uniform(vGreat))
117 if (
set(0) &&
set(1) && !
set(2))
121 else if (
set(0) &&
set(2) && !
set(1))
125 else if (
set(1) &&
set(2) && !
set(0))
133 for (
int i=0; i<2; i++)
137 (
set(0) &&
set(1)) ?
mag(
operator[](0) &
operator[](1)) : vGreat
141 (
set(0) &&
set(2)) ?
mag(
operator[](0) &
operator[](2)) : vGreat
145 (
set(1) &&
set(2)) ?
mag(
operator[](1) &
operator[](2)) : vGreat
148 if (o01 < o02 && o01 < o12)
198 if (t2.
set(i) && !
set(i))
209 if (
set() && t2.
set())
222 scalar mostAligned = -1;
228 if (correspondence[
k] == j)
238 scalar maga =
mag(a);
240 if (maga > mostAligned)
242 correspondence[i] = j;
249 operator[](i) += signd[i]*t2.operator[](correspondence[i]);
261 mag(v &
operator[](0)),
262 mag(v &
operator[](1)),
263 mag(v &
operator[](2))
270 mostAligned.
x() > mostAligned.
y()
271 && mostAligned.
x() > mostAligned.
z()
274 mav = mostAligned.
x();
277 else if (mostAligned.
y() > mostAligned.
z())
279 mav = mostAligned.
y();
284 mav = mostAligned.
z();
311 mag(
operator[](0).
x()) >
mag(
operator[](1).
x())
312 &&
mag(
operator[](0).
x()) >
mag(
operator[](2).
x())
317 if (
mag(
operator[](1).
y()) >
mag(
operator[](2).
y()))
330 mag(
operator[](1).
x()) >
mag(
operator[](2).
x())
335 if (
mag(
operator[](0).
y()) >
mag(
operator[](2).
y()))
350 if (
mag(
operator[](0).
y()) >
mag(
operator[](1).
y()))
362 if (t[0].
x() < 0) t[0] *= -1;
363 if (t[1].
y() < 0) t[1] *= -1;
364 if (t[2].
z() < 0) t[2] *= -1;
408 scalar sumDifference = 0;
412 if (!tmpA.
set(dir) || !tmpB.
set(dir))
418 (tmpA[dir] & tmpB[dir])
419 /(
mag(tmpA[dir])*
mag(tmpA[dir]) + small);
421 cosPhi =
min(
max(cosPhi, -1), 1);
423 sumDifference +=
mag(cosPhi - 1);
426 return (sumDifference/3);
dimensionedScalar sign(const dimensionedScalar &ds)
static const char *const typeName
scalar diff(const triad &A, const triad &B)
Return a quantity of the difference between two triads.
tensor R() const
The rotation tensor corresponding the quaternion.
void align(const vector &v)
Align this triad with the given vector v.
void operator=(const Vector< vector > &)
Tensor< Cmpt > T() const
Return transpose.
static const char *const componentNames[]
static const Form rootMin
Vector< scalar > vector
A scalar version of the templated Vector.
label k
Boltzmann constant.
tensor rotationTensor(const vector &n1, const vector &n2)
Rotational transformation tensor from unit vector n1 to n2.
bool set(const direction d) const
Is the vector in the direction d set.
void orthogonalise()
Orthogonalise this triad so that it is ortho-normal.
triad sortxyz() const
Sort the axes such that they are closest to the x, y and z axes.
Quaternion class used to perform rotations in 3D space.
Templated 3D Vector derived from VectorSpace adding construction from 3 components, element access using x(), y() and z() member functions and the inner-product (dot-product) and cross product operators.
friend Ostream & operator(Ostream &, const VectorSpace< Vector< vector >, vector, Ncmpts > &)
static vector orthogonal(const vector &v1, const vector &v2)
Return the vector orthogonal to the two provided.
Representation of a 3D Cartesian coordinate system as a Vector of vectors.
static const Form rootMax
void operator+=(const triad &t2)
Add the triad t2 to this triad.
#define R(A, B, C, D, E, F, K, M)
dimensioned< scalar > mag(const dimensioned< Type > &)
const vector & operator[](const direction) const
dimensionSet transform(const dimensionSet &)