Go to the documentation of this file.
43 triad::uniform(vector::uniform(0))
49 triad::uniform(vector::uniform(1))
55 triad::uniform(vector::uniform(VGREAT))
61 triad::uniform(vector::uniform(-VGREAT))
67 triad::uniform(vector::uniform(ROOTVGREAT))
73 triad::uniform(vector::uniform(-ROOTVGREAT))
85 triad::uniform(vector::uniform(VGREAT))
111 if (set(0) && set(1) && !set(2))
113 operator[](2) = orthogonal(
operator[](0),
operator[](1));
115 else if (set(0) && set(2) && !set(1))
117 operator[](1) = orthogonal(
operator[](0),
operator[](2));
119 else if (set(1) && set(2) && !set(0))
121 operator[](0) = orthogonal(
operator[](1),
operator[](2));
127 for (
int i=0; i<2; i++)
129 scalar o01 =
mag(
operator[](0) &
operator[](1));
130 scalar o02 =
mag(
operator[](0) &
operator[](2));
131 scalar o12 =
mag(
operator[](1) &
operator[](2));
133 if (o01 < o02 && o01 < o12)
135 operator[](2) = orthogonal(
operator[](0),
operator[](1));
148 operator[](1) = orthogonal(
operator[](0),
operator[](2));
161 operator[](0) = orthogonal(
operator[](1),
operator[](2));
183 if (t2.
set(i) && !set(i))
185 operator[](i) = t2.operator[](i);
194 if (set() && t2.
set())
207 scalar mostAligned = -1;
213 if (correspondance[
k] == j)
222 scalar a = operator[](i) & t2.operator[](j);
223 scalar maga =
mag(a);
225 if (maga > mostAligned)
227 correspondance[i] = j;
234 operator[](i) += signd[i]*t2.operator[](correspondance[i]);
246 mag(v &
operator[](0)),
247 mag(v &
operator[](1)),
248 mag(v &
operator[](2))
255 mostAligned.
x() > mostAligned.
y()
256 && mostAligned.
x() > mostAligned.
z()
259 mav = mostAligned.
x();
260 mostAligned = operator[](0);
262 else if (mostAligned.
y() > mostAligned.
z())
264 mav = mostAligned.
y();
265 mostAligned = operator[](1);
269 mav = mostAligned.
z();
270 mostAligned = operator[](2);
296 mag(
operator[](0).
x()) >
mag(
operator[](1).
x())
297 &&
mag(
operator[](0).
x()) >
mag(
operator[](2).
x())
300 t[0] = operator[](0);
302 if (
mag(
operator[](1).
y()) >
mag(
operator[](2).
y()))
304 t[1] = operator[](1);
305 t[2] = operator[](2);
309 t[1] = operator[](2);
310 t[2] = operator[](1);
315 mag(
operator[](1).
x()) >
mag(
operator[](2).
x())
318 t[0] = operator[](1);
320 if (
mag(
operator[](0).
y()) >
mag(
operator[](2).
y()))
322 t[1] = operator[](0);
323 t[2] = operator[](2);
327 t[1] = operator[](2);
328 t[2] = operator[](0);
333 t[0] = operator[](2);
335 if (
mag(
operator[](0).
y()) >
mag(
operator[](1).
y()))
337 t[1] = operator[](0);
338 t[2] = operator[](1);
342 t[1] = operator[](1);
343 t[2] = operator[](0);
347 if (t[0].
x() < 0) t[0] *= -1;
348 if (t[1].
y() < 0) t[1] *= -1;
349 if (t[2].z() < 0) t[2] *= -1;
383 scalar sumDifference = 0;
387 if (!tmpA.
set(dir) || !tmpB.
set(dir))
393 (tmpA[dir] & tmpB[dir])
394 /(
mag(tmpA[dir])*
mag(tmpA[dir]) + SMALL);
401 return (sumDifference/3);
static const Form rootMax
const vector & x() const
Access to the vector x component.
static const char *const componentNames[]
void operator+=(const triad &t2)
Add the triad t2 to this triad.
static const Foam::dimensionedScalar B("", Foam::dimless, 18.678)
static const Foam::dimensionedScalar A("", Foam::dimPressure, 611.21)
dimensionedScalar sign(const dimensionedScalar &ds)
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
const vector & z() const
Access to the vector z component.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
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.
scalar diff(const triad &A, const triad &B)
Return a quantity of the difference between two triads.
#define R(A, B, C, D, E, F, K, M)
void orthogonalize()
Orthogonalize this triad so that it is ortho-normal.
void align(const vector &v)
Align this triad with the given vector v.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Vector< scalar > vector
A scalar version of the templated Vector.
static const Form rootMin
Representation of a 3D Cartesian coordinate system as a Vector of row vectors.
const vector & y() const
Access to the vector y component.
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
label k
Boltzmann constant.
Tensor< Cmpt > T() const
Return non-Hermitian transpose.
tensor R() const
The rotation tensor corresponding to the quaternion.
tensor rotationTensor(const vector &n1, const vector &n2)
Rotational transformation tensor from vector n1 to n2.
friend Ostream & operator(Ostream &, const VectorSpace< Vector< vector >, vector, Ncmpts > &)
bool set(const direction d) const
Is the vector in the direction d set.
static const char *const typeName