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))
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));
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])
400 sumDifference +=
mag(cosPhi - 1);
403 return (sumDifference/3);
static const Foam::dimensionedScalar A("", Foam::dimPressure, 611.21)
static const Foam::dimensionedScalar B("", Foam::dimless, 18.678)
#define R(A, B, C, D, E, F, K, M)
Tensor< Cmpt > T() const
Return non-Hermitian transpose.
Vector< Cmpt > z() const
Extract vector for row 2.
Vector< Cmpt > y() const
Extract vector for row 1.
Vector< Cmpt > x() const
Extract vector for row 0.
static const char *const componentNames[]
const Cmpt & operator[](const direction) const
static Form uniform(const Cmpt &s)
Return a VectorSpace with all elements = s.
static const Form rootMin
static const Form rootMax
friend Ostream & operator(Ostream &, const VectorSpace< Form, Cmpt, Ncmpts > &)
static const char *const typeName
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
const vector & x() const noexcept
const vector & z() const noexcept
const vector & y() const noexcept
Quaternion class used to perform rotations in 3D space.
tensor R() const
The rotation tensor corresponding to the quaternion.
Representation of a 3D Cartesian coordinate system as a Vector of row vectors.
void align(const vector &v)
Align this triad with the given vector v.
triad()
Default construct as 'unset'.
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 orthogonalise()
Inplace orthogonalise so that it is ortho-normal.
static vector orthogonal(const vector &v1, const vector &v2)
Return the vector orthogonal to the two provided.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
void set(List< bool > &bools, const labelUList &locations)
Set the listed locations (assign 'true').
dimensionedScalar sign(const dimensionedScalar &ds)
tensor rotationTensor(const vector &n1, const vector &n2)
Rotational transformation tensor from vector n1 to n2.
refinementData transform(const tensor &, const refinementData val)
No-op rotational transform for base types.
dimensionSet clamp(const dimensionSet &a, const dimensionSet &range)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
scalar diff(const triad &A, const triad &B)
Return a quantity of the difference between two triads.