30 #include <type_traits>
39 template<
class Form,
class Cmpt, direction Ncmpts>
44 template<
class Form,
class Cmpt, direction Ncmpts>
51 template<
class Form,
class Cmpt, direction Ncmpts>
52 template<
class Form2,
class Cmpt2>
62 template<
class Form,
class Cmpt, direction Ncmpts>
63 template<
class SubVector, direction BStart>
75 "Requested block size > VectorSpace size"
82 template<
class Form,
class Cmpt, direction Ncmpts>
89 template<
class Form,
class Cmpt, direction Ncmpts>
99 <<
"index out of range"
108 template<
class Form,
class Cmpt, direction Ncmpts>
118 <<
"index out of range"
127 template<
class Form,
class Cmpt, direction Ncmpts>
138 <<
"index out of range"
147 template<
class Form,
class Cmpt, direction Ncmpts>
158 <<
"index out of range"
167 template<
class Form,
class Cmpt, direction Ncmpts>
176 template<
class Form,
class Cmpt, direction Ncmpts>
177 template<
class SubVector, direction BStart>
179 ConstBlock<SubVector, BStart>
188 template<
class Form,
class Cmpt, direction Ncmpts>
198 <<
"index out of range"
207 template<
class Form,
class Cmpt, direction Ncmpts>
217 <<
"index out of range"
226 template<
class Form,
class Cmpt, direction Ncmpts>
227 template<
class SubVector, direction BStart>
230 ConstBlock<SubVector, BStart>::operator[]
239 <<
"index out of range"
244 return vs_[BStart + i];
248 template<
class Form,
class Cmpt, direction Ncmpts>
249 template<
class SubVector, direction BStart>
262 <<
"index out of range"
274 return vs_[BStart + i];
278 template<
class Form,
class Cmpt, direction Ncmpts>
288 template<
class Form,
class Cmpt, direction Ncmpts>
298 template<
class Form,
class Cmpt, direction Ncmpts>
305 template<
class Form,
class Cmpt, direction Ncmpts>
306 template<
class Type,
class Enable>
316 template<
class Form,
class Cmpt, direction Ncmpts>
317 template<
class Type,
class Enable>
329 template<
class Form,
class Cmpt, direction Ncmpts>
340 template<
class Form,
class Cmpt, direction Ncmpts>
354 template<
class Form,
class Cmpt, direction Ncmpts>
366 template<
class Form,
class Cmpt, direction Ncmpts>
374 return static_cast<const Form&
>(v);
379 template<
class Form,
class Cmpt, direction Ncmpts>
387 return sqr(
static_cast<const Form&
>(v));
391 template<
class Form,
class Cmpt, direction Ncmpts>
408 template<
class Form,
class Cmpt, direction Ncmpts>
414 return sqrt(
magSqr(
static_cast<const Form&
>(vs)));
418 template<
class Form,
class Cmpt, direction Ncmpts>
424 const auto magVs =
mag(vs);
425 return magVs > 0 ? vs/magVs :
Zero;
429 template<
class Form,
class Cmpt, direction Ncmpts>
442 template<
class Form,
class Cmpt, direction Ncmpts>
455 template<
class Form,
class Cmpt, direction Ncmpts>
468 template<
class Form,
class Cmpt, direction Ncmpts>
481 template<
class Form,
class Cmpt, direction Ncmpts>
487 Cmpt cMax = vs.
v_[0];
493 template<
class Form,
class Cmpt, direction Ncmpts>
499 Cmpt cMin = vs.
v_[0];
505 template<
class Form,
class Cmpt, direction Ncmpts>
517 template<
class Form,
class Cmpt, direction Ncmpts>
526 template<
class Form,
class Cmpt, direction Ncmpts>
532 Cmpt product = vs.
v_[0];
538 template<
class Form,
class Cmpt, direction Ncmpts>
550 template<
class Form,
class Cmpt, direction Ncmpts>
562 template<
class Form,
class Cmpt, direction Ncmpts>
575 template<
class Form,
class Cmpt, direction Ncmpts>
588 template<
class Form,
class Cmpt, direction Ncmpts>
603 class Form1,
class Cmpt1,
direction Ncmpts1,
604 class Form2,
class Cmpt2,
direction Ncmpts2
612 return static_cast<const Form1&
>(t1) &
static_cast<const Form2&
>(t2);
616 template<
class Form,
class Cmpt, direction Ncmpts>
622 index = vs[index] > vs[i] ? index : i;
628 template<
class Form,
class Cmpt, direction Ncmpts>
634 index = vs[index] < vs[i] ? index : i;
642 template<
class Form,
class Cmpt, direction Ncmpts>
643 inline Form
operator-
654 template<
class Form,
class Cmpt, direction Ncmpts>
655 inline Form
operator+
666 template<
class Form,
class Cmpt, direction Ncmpts>
667 inline Form
operator-
685 class Enable = EnableRank0<Type>
687 inline Form
operator*
705 class Enable = EnableRank0<Type>
707 inline Form
operator*
725 class Enable = EnableRank0<Type>
727 inline Form
operator/
739 template<
class Form,
class Cmpt, direction Ncmpts>
740 inline Cmpt
operator&&
746 Cmpt ddProd = vs1.v_[0]*vs2.v_[0];
749 ddProd += vs1.v_[i]*vs2.v_[i];
755 template<
class Form,
class Cmpt, direction Ncmpts>
756 inline bool operator==
765 if (!(eq &= (
equal(vs1.v_[i], vs2.v_[i]))))
break;
771 template<
class Form,
class Cmpt, direction Ncmpts>
772 inline bool operator!=
778 return !(vs1 == vs2);
782 template<
class Form,
class Cmpt, direction Ncmpts>
783 inline bool operator>
792 if (!(gt &= vs1.v_[i] > vs2.v_[i]))
break;
798 template<
class Form,
class Cmpt, direction Ncmpts>
799 inline bool operator<
808 if (!(lt &= vs1.v_[i] < vs2.v_[i]))
break;
814 template<
class Form,
class Cmpt, direction Ncmpts>
815 inline bool operator>=
825 template<
class Form,
class Cmpt, direction Ncmpts>
826 inline bool operator<=
static void opVS(V &vs, const V1 &vs1, const S &s, Op o)
static void opSV(V &vs, const S &s, const V1 &vs1, Op o)
static void SeqOp(S &s, const V &vs, EqOp eo)
static void eqOpS(V &vs, const S &s, EqOp eo)
static void eqOp(V1 &vs1, const V2 &vs2, EqOp eo)
static void op(V &vs, const V1 &vs1, const V1 &vs2, Op o)
static const direction nComponents
Number of components in this vector space.
friend Ostream & operator(Ostream &, const VectorSpace< Form, Cmpt, Ncmpts > &)
const Cmpt & component(const direction) const
static const direction nComponents
Number of components in this vector space.
void replace(const direction, const Cmpt &)
VectorSpace()
Construct null.
const ConstBlock< SubVector, BStart > block() const
Cmpt v_[Ncmpts]
The components of this vector space.
static Form uniform(const Cmpt &s)
Return a VectorSpace with all elements = s.
static direction size()
Return the number of elements in the VectorSpace = Ncmpts.
void operator=(const Foam::zero)
typeOfRank< typename pTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank) - 2 >::type type
Traits class for primitives.
symmTypeOfRank< typename pTraits< arg1 >::cmptType, arg2 *direction(pTraits< arg1 >::rank) >::type type
A class representing the concept of 0 used to avoid unnecessary manipulations for objects that are kn...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
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.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
const dimensionedScalar c
Speed of light in a vacuum.
bool equal(const T &s1, const T &s2)
tmp< DimensionedField< scalar, GeoMesh > > stabilise(const DimensionedField< scalar, GeoMesh > &dsf, const dimensioned< scalar > &ds)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
label findMax(const ListType &, const label start=0)
Find index of max element (and larger than given element).
Cmpt cmptProduct(const VectorSpace< Form, Cmpt, Ncmpts > &vs)
label & setComponent(label &l, const direction)
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
errorManip< error > abort(error &err)
void cmptMin(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
void dot(FieldField< Field1, typename innerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Scalar minMod(const Scalar s1, const Scalar s2)
tmp< DimensionedField< typename DimensionedField< Type, GeoMesh >::cmptType, GeoMesh >> cmptAv(const DimensionedField< Type, GeoMesh > &df)
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensionSet normalised(const dimensionSet &)
dimensioned< scalar > mag(const dimensioned< Type > &)
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
dimensionSet cmptMag(const dimensionSet &)
void cmptMax(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
dimensioned< Type > cmptDivide(const dimensioned< Type > &, const dimensioned< Type > &)
label findMin(const ListType &, const label start=0)
Find index of min element (and less than given element).
Scalar cmptPow(const Scalar s1, const Scalar s2)
Cmpt cmptSum(const VectorSpace< Form, Cmpt, Ncmpts > &vs)
dimensioned< scalar > magSqr(const dimensioned< Type > &)
Scalar cmptSqr(const Scalar s)
Combination-Reduction operation for a parallel run.
Traits classes for inner and outer products of primitives.