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;
89 const tensor& rotationTensor
95 + rotationTensor.
zz();
102 v_[0] = (rotationTensor.
zy() - rotationTensor.
yz())*s;
103 v_[1] = (rotationTensor.
xz() - rotationTensor.
zx())*s;
104 v_[2] = (rotationTensor.
yx() - rotationTensor.
xy())*s;
110 rotationTensor.
xx() > rotationTensor.
yy()
111 && rotationTensor.
xx() > rotationTensor.
zz()
117 + rotationTensor.
xx()
118 - rotationTensor.
yy()
119 - rotationTensor.
zz()
122 w_ = (rotationTensor.
zy() - rotationTensor.
yz())/s;
124 v_[1] = (rotationTensor.
xy() + rotationTensor.
yx())/s;
125 v_[2] = (rotationTensor.
xz() + rotationTensor.
zx())/s;
129 rotationTensor.
yy() > rotationTensor.
zz()
135 + rotationTensor.
yy()
136 - rotationTensor.
xx()
137 - rotationTensor.
zz()
140 w_ = (rotationTensor.
xz() - rotationTensor.
xz())/s;
141 v_[0] = (rotationTensor.
xy() + rotationTensor.
yx())/s;
143 v_[2] = (rotationTensor.
yz() + rotationTensor.
zy())/s;
150 + rotationTensor.
zz()
151 - rotationTensor.
xx()
152 - rotationTensor.
yy()
155 w_ = (rotationTensor.
yx() - rotationTensor.
xy())/s;
156 v_[0] = (rotationTensor.
xz() + rotationTensor.
zx())/s;
157 v_[1] = (rotationTensor.
yz() + rotationTensor.
zy())/s;
192 return *
this/
mag(*
this);
216 return (
conjugate(*this).mulq0v(u)*(*this)).
v();
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());
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())
void operator-=(const quaternion &)
dimensionedScalar sqrt(const dimensionedScalar &ds)
tmp< fvMatrix< Type > > operator*(const DimensionedField< scalar, volMesh > &, const fvMatrix< Type > &)
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
vector eulerAngles(const quaternion &q) const
Return a vector of euler angles (rotations in radians about.
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< GeometricField< Type, fvPatchField, volMesh > > operator&(const fvMatrix< Type > &, const DimensionedField< Type, volMesh > &)
dimensioned< scalar > mag(const dimensioned< Type > &)
Tensor< scalar > tensor
Tensor of scalars.
dimensionedScalar atan2(const dimensionedScalar &x, const dimensionedScalar &y)
void operator/=(const quaternion &)
dimensioned< scalar > magSqr(const dimensioned< Type > &)
const vector & v() const
Vector part of the quaternion ( = axis of rotation)
Quaternion class used to perform rotations in 3D space.
void operator*=(const quaternion &)
tensor R() const
The rotation tensor corresponding the quaternion.
tmp< fvMatrix< Type > > operator-(const fvMatrix< Type > &)
vector transform(const vector &v) const
Rotate the given vector.
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
scalar w() const
Scalar part of the quaternion ( = cos(theta/2) for rotation)
dimensionedScalar operator/(const scalar s1, const dimensionedScalar &ds2)
quaternion()
Construct null.
bool operator!=(const particle &, const particle &)
A class representing the concept of 0 used to avoid unnecessary manipulations for objects that are kn...
dimensionedScalar cos(const dimensionedScalar &ds)
void operator=(const quaternion &)
quaternion conjugate(const quaternion &q)
Return the conjugate of the given quaternion.
quaternion normalized() const
Vector< scalar > vector
A scalar version of the templated Vector.
vector invTransform(const vector &v) const
Rotate the given vector anti-clockwise.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
quaternion normalize(const quaternion &q)
Return the normalized (unit) quaternion of the given quaternion.
void operator+=(const quaternion &)
dimensionedScalar asin(const dimensionedScalar &ds)
bool equal(const T &s1, const T &s2)
dimensionedScalar sin(const dimensionedScalar &ds)