Go to the documentation of this file.
40 v_((
sin(0.5*theta)/
mag(d))*d)
46 const scalar cosTheta,
50 scalar cosHalfTheta2 = 0.5*(cosTheta + 1);
51 w_ =
sqrt(cosHalfTheta2);
55 v_ =
sqrt(1 - cosHalfTheta2)*d;
59 v_ = (
sqrt(1 - cosHalfTheta2)/
mag(d))*d;
192 return *
this/
mag(*
this);
198 operator/=(
mag(*
this));
237 scalar w2 =
sqr(
w());
238 scalar x2 =
sqr(v().
x());
239 scalar y2 =
sqr(v().
y());
240 scalar z2 =
sqr(v().z());
242 scalar txy = 2*v().x()*v().y();
243 scalar twz = 2*
w()*v().z();
244 scalar txz = 2*v().x()*v().z();
245 scalar twy = 2*
w()*v().y();
246 scalar tyz = 2*v().y()*v().z();
247 scalar twx = 2*
w()*v().x();
251 w2 + x2 - y2 - z2, txy - twz, txz + twy,
252 txy + twz, w2 - x2 + y2 - z2, tyz - twx,
253 txz - twy, tyz + twx, w2 - x2 - y2 + z2
262 const scalar&
w = q.
w();
267 2*(
w*v.
x() + v.
y()*v.
z()),
273 2*(
w*v.
z() + v.
x()*v.
y()),
310 w() =
w()*q.
w() - (v() & q.
v());
311 v() = w0*q.
v() + q.
w()*v() + (v() ^ q.
v());
316 return operator*=(
inv(q));
367 scalar magSqrq =
magSqr(q);
420 return q1.
w()*q2.
w() + (q1.
v() & q2.
v());
432 q1.
w()*q2.w() - (q1.
v() & q2.v()),
433 q1.
w()*q2.v() + q2.w()*q1.
v() + (q1.
v() ^ q2.v())
Templated 3D tensor derived from VectorSpace adding construction from 9 components,...
volScalarField w(IOobject("w", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE), mesh, dimensionedScalar("w", dimensionSet(0, 0, 0, 0, 0, 0, 0), 0.0))
tmp< GeometricField< Type, fvPatchField, volMesh > > operator&(const fvMatrix< Type > &, const DimensionedField< Type, volMesh > &)
void operator/=(const quaternion &)
dimensionedScalar sin(const dimensionedScalar &ds)
Tensor< scalar > tensor
Tensor of scalars.
dimensionedScalar atan2(const dimensionedScalar &x, const dimensionedScalar &y)
quaternion normalized() const
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
dimensioned< scalar > mag(const dimensioned< Type > &)
Quaternion class used to perform rotations in 3D space.
void operator*=(const quaternion &)
void operator+=(const quaternion &)
tmp< fvMatrix< Type > > operator-(const fvMatrix< Type > &)
void operator=(const quaternion &)
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
scalar w_
Scalar part of the quaternion ( = cos(theta/2) for rotation)
bool operator!=(const particle &, const particle &)
quaternion()
Construct null.
scalar w() const
Scalar part of the quaternion ( = cos(theta/2) for rotation)
Vector< scalar > vector
A scalar version of the templated Vector.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
tmp< fvMatrix< Type > > operator*(const DimensionedField< scalar, volMesh > &, const fvMatrix< Type > &)
dimensionedScalar operator/(const scalar s1, const dimensionedScalar &ds2)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedScalar sqrt(const dimensionedScalar &ds)
quaternion mulq0v(const vector &v) const
Multiply vector v by quaternion as if v is a pure quaternion.
void operator-=(const quaternion &)
const vector & v() const
Vector part of the quaternion ( = axis of rotation)
vector invTransform(const vector &v) const
Rotate the given vector anti-clockwise.
tensor R() const
The rotation tensor corresponding the quaternion.
quaternion conjugate(const quaternion &q)
Return the conjugate of the given quaternion.
tensor rotationTensor(const vector &n1, const vector &n2)
vector eulerAngles(const quaternion &q) const
Return a vector of euler angles (rotations in radians about.
bool equal(const T &s1, const T &s2)
dimensioned< scalar > magSqr(const dimensioned< Type > &)
dimensionedScalar asin(const dimensionedScalar &ds)
quaternion normalize(const quaternion &q)
Return the normalized (unit) quaternion of the given quaternion.
vector transform(const vector &v) const
Rotate the given vector.
vector v_
Vector part of the quaternion ( = axis of rotation)
A class representing the concept of 0 used to avoid unnecessary manipulations for objects that are kn...
dimensionedScalar cos(const dimensionedScalar &ds)