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))
113 if (
set(0) &&
set(1) && !
set(2))
115 operator[](2) = orthogonal(
operator[](0),
operator[](1));
117 else if (
set(0) &&
set(2) && !
set(1))
119 operator[](1) = orthogonal(
operator[](0),
operator[](2));
121 else if (
set(1) &&
set(2) && !
set(0))
123 operator[](0) = orthogonal(
operator[](1),
operator[](2));
129 for (
int i=0; i<2; i++)
131 scalar o01 =
Foam::mag(
operator[](0) &
operator[](1));
132 scalar o02 =
Foam::mag(
operator[](0) &
operator[](2));
133 scalar o12 =
Foam::mag(
operator[](1) &
operator[](2));
135 if (o01 < o02 && o01 < o12)
137 operator[](2) = orthogonal(
operator[](0),
operator[](1));
150 operator[](1) = orthogonal(
operator[](0),
operator[](2));
163 operator[](0) = orthogonal(
operator[](1),
operator[](2));
185 if (t2.set(i) && !
set(i))
187 operator[](i) = t2.operator[](i);
196 if (
set() && t2.set())
209 scalar mostAligned = -1;
215 if (correspondance[
k] == j)
224 scalar a = operator[](i) & t2.operator[](j);
227 if (maga > mostAligned)
229 correspondance[i] = j;
236 operator[](i) += signd[i]*t2.operator[](correspondance[i]);
257 mostAligned.x() > mostAligned.y()
258 && mostAligned.x() > mostAligned.z()
261 mav = mostAligned.x();
262 mostAligned = operator[](0);
264 else if (mostAligned.y() > mostAligned.z())
266 mav = mostAligned.y();
267 mostAligned = operator[](1);
271 mav = mostAligned.z();
272 mostAligned = operator[](2);
302 t[0] = operator[](0);
306 t[1] = operator[](1);
307 t[2] = operator[](2);
311 t[1] = operator[](2);
312 t[2] = operator[](1);
320 t[0] = operator[](1);
324 t[1] = operator[](0);
325 t[2] = operator[](2);
329 t[1] = operator[](2);
330 t[2] = operator[](0);
335 t[0] = operator[](2);
339 t[1] = operator[](0);
340 t[2] = operator[](1);
344 t[1] = operator[](1);
345 t[2] = operator[](0);
349 if (t[0].
x() < 0) t[0] *= -1;
350 if (t[1].
y() < 0) t[1] *= -1;
351 if (t[2].z() < 0) t[2] *= -1;
382 triad tmpA =
A.sortxyz();
383 triad tmpB =
B.sortxyz();
385 scalar sumDifference = 0;
389 if (!tmpA.set(dir) || !tmpB.set(dir))
395 (tmpA[dir] & tmpB[dir])
403 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 to the quaternion.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
void align(const vector &v)
Align this triad with the given vector v.
static const char *const componentNames[]
static const Form rootMin
const vector & y() const noexcept
Access to the vector y component.
triad()
Default construct as 'unset'.
label k
Boltzmann constant.
tensor rotationTensor(const vector &n1, const vector &n2)
Rotational transformation tensor from vector n1 to n2.
void orthogonalise()
Inplace orthogonalise 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.
const vector & x() const noexcept
Access to the vector x component.
friend Ostream & operator(Ostream &, const VectorSpace< Vector< vector >, vector, Ncmpts > &)
Representation of a 3D Cartesian coordinate system as a Vector of row vectors.
static const Form rootMax
const vector & z() const noexcept
Access to the vector z component.
void operator+=(const triad &t2)
Add the triad t2 to this triad.
#define R(A, B, C, D, E, F, K, M)
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
static const Foam::dimensionedScalar A("", Foam::dimPressure, 611.21)
Tensor of scalars, i.e. Tensor<scalar>.
static const Foam::dimensionedScalar B("", Foam::dimless, 18.678)
dimensionSet clamp(const dimensionSet &a, const dimensionSet &range)