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++)
135 scalar o01 =
mag(
operator[](0) &
operator[](1));
136 scalar o02 =
mag(
operator[](0) &
operator[](2));
137 scalar o12 =
mag(
operator[](1) &
operator[](2));
139 if (o01 < o02 && o01 < o12)
189 if (t2.
set(i) && !
set(i))
200 if (
set() && t2.
set())
213 scalar mostAligned = -1;
219 if (correspondance[
k] == j)
229 scalar maga =
mag(a);
231 if (maga > mostAligned)
233 correspondance[i] = j;
240 operator[](i) += signd[i]*t2.operator[](correspondance[i]);
252 mag(v &
operator[](0)),
253 mag(v &
operator[](1)),
254 mag(v &
operator[](2))
261 mostAligned.
x() > mostAligned.
y()
262 && mostAligned.
x() > mostAligned.
z()
265 mav = mostAligned.
x();
268 else if (mostAligned.
y() > mostAligned.
z())
270 mav = mostAligned.
y();
275 mav = mostAligned.
z();
302 mag(
operator[](0).
x()) >
mag(
operator[](1).
x())
303 &&
mag(
operator[](0).
x()) >
mag(
operator[](2).
x())
308 if (
mag(
operator[](1).
y()) >
mag(
operator[](2).
y()))
321 mag(
operator[](1).
x()) >
mag(
operator[](2).
x())
326 if (
mag(
operator[](0).
y()) >
mag(
operator[](2).
y()))
341 if (
mag(
operator[](0).
y()) >
mag(
operator[](1).
y()))
353 if (t[0].
x() < 0) t[0] *= -1;
354 if (t[1].
y() < 0) t[1] *= -1;
355 if (t[2].
z() < 0) t[2] *= -1;
399 scalar sumDifference = 0;
403 if (!tmpA.
set(dir) || !tmpB.
set(dir))
409 (tmpA[dir] & tmpB[dir])
410 /(
mag(tmpA[dir])*
mag(tmpA[dir]) + SMALL);
412 cosPhi =
min(
max(cosPhi, -1), 1);
414 sumDifference +=
mag(cosPhi - 1);
417 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.
const vector & operator[](const direction) const
void align(const vector &v)
Align this triad with the given vector v.
void operator=(const Vector< vector > &)
triad sortxyz() const
Sort the axes such that they are closest to the x, y and z axes.
static const char *const componentNames[]
tensor R() const
The rotation tensor corresponding the quaternion.
static const Form rootMax
Vector< scalar > vector
A scalar version of the templated Vector.
label k
Boltzmann constant.
void orthogonalize()
Orthogonalize this triad so that it is ortho-normal.
tensor rotationTensor(const vector &n1, const vector &n2)
Rotational transformation tensor from vector n1 to n2.
static const Form rootMin
bool set(const direction d) const
Is the vector in the direction d set.
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.
Tensor< Cmpt > T() const
Return transpose.
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.
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 > &)
dimensionSet transform(const dimensionSet &)