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>
61 template<
class Form,
class Cmpt, direction Ncmpts>
62 template<
class Form2,
class Cmpt2>
72 template<
class Form,
class Cmpt, direction Ncmpts>
73 template<
class SubVector, direction BStart>
84 vsType::nComponents >= BStart + nComponents,
85 "Requested block size > VectorSpace size" 92 template<
class Form,
class Cmpt, direction Ncmpts>
99 template<
class Form,
class Cmpt, direction Ncmpts>
109 <<
"index out of range" 118 template<
class Form,
class Cmpt, direction Ncmpts>
128 <<
"index out of range" 137 template<
class Form,
class Cmpt, direction Ncmpts>
148 <<
"index out of range" 157 template<
class Form,
class Cmpt, direction Ncmpts>
168 <<
"index out of range" 177 template<
class Form,
class Cmpt, direction Ncmpts>
186 template<
class Form,
class Cmpt, direction Ncmpts>
187 template<
class SubVector, direction BStart>
198 template<
class Form,
class Cmpt, direction Ncmpts>
199 inline const Cmpt& VectorSpace<Form, Cmpt, Ncmpts>::operator[]
208 <<
"index out of range" 217 template<
class Form,
class Cmpt, direction Ncmpts>
218 inline Cmpt& VectorSpace<Form, Cmpt, Ncmpts>::operator[]
227 <<
"index out of range" 236 template<
class Form,
class Cmpt, direction Ncmpts>
237 template<
class SubVector, direction BStart>
249 <<
"index out of range" 254 return vs_[BStart + i];
258 template<
class Form,
class Cmpt, direction Ncmpts>
259 template<
class SubVector, direction BStart>
272 <<
"index out of range" 284 return vs_[BStart + i];
288 template<
class Form,
class Cmpt, direction Ncmpts>
289 inline void VectorSpace<Form, Cmpt, Ncmpts>::operator=
298 template<
class Form,
class Cmpt, direction Ncmpts>
299 inline void VectorSpace<Form, Cmpt, Ncmpts>::operator+=
308 template<
class Form,
class Cmpt, direction Ncmpts>
309 inline void VectorSpace<Form, Cmpt, Ncmpts>::operator-=
318 template<
class Form,
class Cmpt, direction Ncmpts>
325 template<
class Form,
class Cmpt, direction Ncmpts>
326 inline void VectorSpace<Form, Cmpt, Ncmpts>::operator*=
335 template<
class Form,
class Cmpt, direction Ncmpts>
336 inline void VectorSpace<Form, Cmpt, Ncmpts>::operator/=
347 template<
class Form,
class Cmpt, direction Ncmpts>
358 template<
class Form,
class Cmpt, direction Ncmpts>
372 template<
class Form,
class Cmpt, direction Ncmpts>
384 template<
class Form,
class Cmpt, direction Ncmpts>
392 return static_cast<const Form&
>(v);
397 template<
class Form,
class Cmpt, direction Ncmpts>
405 return sqr(static_cast<const Form&>(v));
409 template<
class Form,
class Cmpt, direction Ncmpts>
421 template<
class Form,
class Cmpt, direction Ncmpts>
431 template<
class Form,
class Cmpt, direction Ncmpts>
444 template<
class Form,
class Cmpt, direction Ncmpts>
457 template<
class Form,
class Cmpt, direction Ncmpts>
470 template<
class Form,
class Cmpt, direction Ncmpts>
483 template<
class Form,
class Cmpt, direction Ncmpts>
489 Cmpt cMax = vs.
v_[0];
495 template<
class Form,
class Cmpt, direction Ncmpts>
501 Cmpt cMin = vs.
v_[0];
507 template<
class Form,
class Cmpt, direction Ncmpts>
519 template<
class Form,
class Cmpt, direction Ncmpts>
528 template<
class Form,
class Cmpt, direction Ncmpts>
534 Cmpt product = vs.
v_[0];
540 template<
class Form,
class Cmpt, direction Ncmpts>
552 template<
class Form,
class Cmpt, direction Ncmpts>
565 template<
class Form,
class Cmpt, direction Ncmpts>
578 template<
class Form,
class Cmpt, direction Ncmpts>
592 inline Type
dot(
const scalar
s,
const Type& t)
599 inline Type
dot(
const Type& t,
const scalar
s)
607 class Form1,
class Cmpt1,
direction Ncmpts1,
608 class Form2,
class Cmpt2,
direction Ncmpts2
616 return static_cast<const Form1&
>(t1) & static_cast<const Form2&>(t2);
622 template<
class Form,
class Cmpt, direction Ncmpts>
623 inline Form
operator-
634 template<
class Form,
class Cmpt, direction Ncmpts>
635 inline Form
operator+
646 template<
class Form,
class Cmpt, direction Ncmpts>
647 inline Form
operator-
659 template<
class Form,
class Cmpt, direction Ncmpts>
660 inline Form
operator*
672 template<
class Form,
class Cmpt, direction Ncmpts>
673 inline Form
operator*
685 template<
class Form,
class Cmpt, direction Ncmpts>
686 inline Form
operator/
725 template<
class Form,
class Cmpt, direction Ncmpts>
726 inline Cmpt
operator&&
732 Cmpt ddProd = vs1.
v_[0]*vs2.
v_[0];
735 ddProd += vs1.
v_[i]*vs2.
v_[i];
741 template<
class Form,
class Cmpt, direction Ncmpts>
742 inline bool operator==
751 if (!(eq &= (
equal(vs1.
v_[i], vs2.
v_[i]))))
break;
757 template<
class Form,
class Cmpt, direction Ncmpts>
758 inline bool operator!=
764 return !(vs1 == vs2);
768 template<
class Form,
class Cmpt, direction Ncmpts>
769 inline bool operator>
778 if (!(gt &= vs1.
v_[i] > vs2.
v_[i]))
break;
784 template<
class Form,
class Cmpt, direction Ncmpts>
785 inline bool operator<
794 if (!(lt &= vs1.
v_[i] < vs2.
v_[i]))
break;
800 template<
class Form,
class Cmpt, direction Ncmpts>
801 inline bool operator>=
811 template<
class Form,
class Cmpt, direction Ncmpts>
812 inline bool operator<=
static void opVS(V &vs, const V1 &vs1, const S &s, Op o)
void cmptMax(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
Cmpt cmptProduct(const VectorSpace< Form, Cmpt, Ncmpts > &vs)
const ConstBlock< SubVector, BStart > block() const
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static void eqOpS(V &vs, const S &s, EqOp eo)
tmp< DimensionedField< typename DimensionedField< Type, GeoMesh >::cmptType, GeoMesh >> cmptAv(const DimensionedField< Type, GeoMesh > &df)
void operator=(const VectorSpace< Form, Cmpt, Ncmpts > &)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Traits classes for inner and outer products of primitives.
VectorSpace()
Construct null.
Cmpt cmptSum(const VectorSpace< Form, Cmpt, Ncmpts > &vs)
dimensionedScalar sqrt(const dimensionedScalar &ds)
Traits class for primitives.
Combination-Reduction operation for a parallel run.
void replace(const direction, const Cmpt &)
void dot(FieldField< Field1, typename innerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
dimensioned< Type > cmptDivide(const dimensioned< Type > &, const dimensioned< Type > &)
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
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))
static void SeqOp(S &s, const V &vs, EqOp eo)
errorManip< error > abort(error &err)
Scalar cmptPow(const Scalar s1, const Scalar s2)
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
void cmptMag(FieldField< Field, Type > &cf, const FieldField< Field, Type > &f)
dimensioned< scalar > magSqr(const dimensioned< Type > &)
static direction size()
Return the number of elements in the VectorSpace = Ncmpts.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
friend Ostream & operator(Ostream &, const VectorSpace< Form, Cmpt, Ncmpts > &)
symmTypeOfRank< typename pTraits< arg1 >::cmptType, arg2 *direction(pTraits< arg1 >::rank) >::type type
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Scalar minMod(const Scalar s1, const Scalar s2)
tmp< DimensionedField< scalar, GeoMesh > > stabilise(const DimensionedField< scalar, GeoMesh > &dsf, const dimensioned< scalar > &ds)
const Cmpt & component(const direction) const
bool equal(const T &s1, const T &s2)
static void opSV(V &vs, const S &s, const V1 &vs1, Op o)
const dimensionedScalar c
Speed of light in a vacuum.
static Form uniform(const Cmpt &s)
Return a VectorSpace with all elements = s.
A class representing the concept of 0 used to avoid unnecessary manipulations for objects that are kn...
dimensioned< scalar > mag(const dimensioned< Type > &)
static void eqOp(V1 &vs1, const V2 &vs2, EqOp eo)
void cmptMin(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
static void op(V &vs, const V1 &vs1, const V1 &vs2, Op o)
label & setComponent(label &l, const direction)
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
typeOfRank< typename pTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank)-2 >::type type
Cmpt v_[Ncmpts]
The components of this vector space.