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>
315 template<
class Form,
class Cmpt, direction Ncmpts>
327 template<
class Form,
class Cmpt, direction Ncmpts>
338 template<
class Form,
class Cmpt, direction Ncmpts>
352 template<
class Form,
class Cmpt, direction Ncmpts>
364 template<
class Form,
class Cmpt, direction Ncmpts>
372 return static_cast<const Form&
>(v);
377 template<
class Form,
class Cmpt, direction Ncmpts>
385 return sqr(
static_cast<const Form&
>(v));
389 template<
class Form,
class Cmpt, direction Ncmpts>
401 template<
class Form,
class Cmpt, direction Ncmpts>
411 template<
class Form,
class Cmpt, direction Ncmpts>
417 const scalar magVs =
mag(vs);
418 return magVs > 0 ? vs/magVs :
Zero;
422 template<
class Form,
class Cmpt, direction Ncmpts>
435 template<
class Form,
class Cmpt, direction Ncmpts>
448 template<
class Form,
class Cmpt, direction Ncmpts>
461 template<
class Form,
class Cmpt, direction Ncmpts>
474 template<
class Form,
class Cmpt, direction Ncmpts>
480 Cmpt cMax = vs.
v_[0];
486 template<
class Form,
class Cmpt, direction Ncmpts>
492 Cmpt cMin = vs.
v_[0];
498 template<
class Form,
class Cmpt, direction Ncmpts>
510 template<
class Form,
class Cmpt, direction Ncmpts>
519 template<
class Form,
class Cmpt, direction Ncmpts>
525 Cmpt product = vs.
v_[0];
531 template<
class Form,
class Cmpt, direction Ncmpts>
543 template<
class Form,
class Cmpt, direction Ncmpts>
555 template<
class Form,
class Cmpt, direction Ncmpts>
568 template<
class Form,
class Cmpt, direction Ncmpts>
581 template<
class Form,
class Cmpt, direction Ncmpts>
595 inline Type
dot(
const scalar
s,
const Type& t)
602 inline Type
dot(
const Type& t,
const scalar
s)
610 class Form1,
class Cmpt1,
direction Ncmpts1,
611 class Form2,
class Cmpt2,
direction Ncmpts2
619 return static_cast<const Form1&
>(t1) &
static_cast<const Form2&
>(t2);
623 template<
class Form,
class Cmpt, direction Ncmpts>
629 index = vs[index] > vs[i] ? index : i;
635 template<
class Form,
class Cmpt, direction Ncmpts>
641 index = vs[index] < vs[i] ? index : i;
649 template<
class Form,
class Cmpt, direction Ncmpts>
650 inline Form
operator-
661 template<
class Form,
class Cmpt, direction Ncmpts>
662 inline Form
operator+
673 template<
class Form,
class Cmpt, direction Ncmpts>
674 inline Form
operator-
686 template<
class Form,
class Cmpt, direction Ncmpts>
687 inline Form
operator*
699 template<
class Form,
class Cmpt, direction Ncmpts>
700 inline Form
operator*
712 template<
class Form,
class Cmpt, direction Ncmpts>
713 inline Form
operator/
752 template<
class Form,
class Cmpt, direction Ncmpts>
753 inline Cmpt
operator&&
759 Cmpt ddProd = vs1.v_[0]*vs2.v_[0];
762 ddProd += vs1.v_[i]*vs2.v_[i];
768 template<
class Form,
class Cmpt, direction Ncmpts>
769 inline bool operator==
778 if (!(eq &= (
equal(vs1.v_[i], vs2.v_[i]))))
break;
784 template<
class Form,
class Cmpt, direction Ncmpts>
785 inline bool operator!=
791 return !(vs1 == vs2);
795 template<
class Form,
class Cmpt, direction Ncmpts>
796 inline bool operator>
805 if (!(gt &= vs1.v_[i] > vs2.v_[i]))
break;
811 template<
class Form,
class Cmpt, direction Ncmpts>
812 inline bool operator<
821 if (!(lt &= vs1.v_[i] < vs2.v_[i]))
break;
827 template<
class Form,
class Cmpt, direction Ncmpts>
828 inline bool operator>=
838 template<
class Form,
class Cmpt, direction Ncmpts>
839 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)
dimensioned< scalar > mag(const dimensioned< Type > &)
Form normalised(const VectorSpace< Form, Cmpt, Ncmpts > &vs)
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.