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))
119 operator[](2) = orthogonal(
operator[](0),
operator[](1));
121 else if (set(0) && set(2) && !set(1))
123 operator[](1) = orthogonal(
operator[](0),
operator[](2));
125 else if (set(1) && set(2) && !set(0))
127 operator[](0) = orthogonal(
operator[](1),
operator[](2));
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)
150 operator[](2) = orthogonal(
operator[](0),
operator[](1));
163 operator[](1) = orthogonal(
operator[](0),
operator[](2));
176 operator[](0) = orthogonal(
operator[](1),
operator[](2));
198 if (t2.
set(i) && !set(i))
200 operator[](i) = t2.operator[](i);
209 if (set() && t2.
set())
222 scalar mostAligned = -1;
228 if (correspondence[
k] == j)
237 scalar a = operator[](i) & t2.operator[](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();
275 mostAligned = operator[](0);
277 else if (mostAligned.
y() > mostAligned.
z())
279 mav = mostAligned.
y();
280 mostAligned = operator[](1);
284 mav = mostAligned.
z();
285 mostAligned = operator[](2);
311 mag(
operator[](0).
x()) >
mag(
operator[](1).
x())
312 &&
mag(
operator[](0).
x()) >
mag(
operator[](2).
x())
315 t[0] = operator[](0);
317 if (
mag(
operator[](1).
y()) >
mag(
operator[](2).
y()))
319 t[1] = operator[](1);
320 t[2] = operator[](2);
324 t[1] = operator[](2);
325 t[2] = operator[](1);
330 mag(
operator[](1).
x()) >
mag(
operator[](2).
x())
333 t[0] = operator[](1);
335 if (
mag(
operator[](0).
y()) >
mag(
operator[](2).
y()))
337 t[1] = operator[](0);
338 t[2] = operator[](2);
342 t[1] = operator[](2);
343 t[2] = operator[](0);
348 t[0] = operator[](2);
350 if (
mag(
operator[](0).
y()) >
mag(
operator[](1).
y()))
352 t[1] = operator[](0);
353 t[2] = operator[](1);
357 t[1] = operator[](1);
358 t[2] = operator[](0);
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);
static const Foam::dimensionedScalar A("A", Foam::dimPressure, 611.21)
static const Foam::dimensionedScalar B("B", Foam::dimless, 18.678)
Tensor< Cmpt > T() const
Return transpose.
static const char *const componentNames[]
friend Ostream & operator(Ostream &, const VectorSpace< Form, Cmpt, Ncmpts > &)
static const Form rootMax
static const Form rootMin
static const char *const typeName
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
Quaternion class used to perform rotations in 3D space.
tensor R() const
The rotation tensor corresponding the quaternion.
Representation of a 3D Cartesian coordinate system as a Vector of vectors.
void align(const vector &v)
Align this triad with the given vector v.
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 operator=(const Vector< vector > &)
void orthogonalise()
Orthogonalise this triad so that it is ortho-normal.
tensor rotationTensor(const vector &n1, const vector &n2)
Rotational transformation tensor from unit vector n1 to n2.
dimensionedScalar sign(const dimensionedScalar &ds)
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
Vector< scalar > vector
A scalar version of the templated Vector.
scalar diff(const triad &A, const triad &B)
Return a quantity of the difference between two triads.
dimensionSet transform(const dimensionSet &)
dimensioned< scalar > mag(const dimensioned< Type > &)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
static scalar R(const scalar a, const scalar x)