35#ifndef Foam_VectorSpaceOps_H
36#define Foam_VectorSpaceOps_H
46template<direction N, direction I=0>
52 template<
class Input,
class Output>
53 static inline void copy_n(Input input, Output result)
65 template<
class Output,
class T>
66 static inline void fill_n(Output result,
const T& val)
80 template<
class V,
class S,
class EqOp>
81 static inline void eqOpS(V& vs,
const S&
s,
EqOp eo)
94 template<
class S,
class V,
class EqOp>
95 static inline void SeqOp(S&
s,
const V& vs,
EqOp eo)
108 template<
class V1,
class V2,
class EqOp>
109 static inline void eqOp(V1& vs1,
const V2& vs2,
EqOp eo)
113 eo(vs1.v_[
I], vs2.v_[
I]);
124 template<
class V,
class V1,
class S,
class BinaryOp>
125 static inline void opVS(V& vs,
const V1& vs1,
const S&
s, BinaryOp bop)
129 vs.v_[
I] = bop(vs1.v_[
I],
s);
140 template<
class V,
class S,
class V1,
class BinaryOp>
141 static inline void opSV(V& vs,
const S&
s,
const V1& vs1, BinaryOp bop)
145 vs.v_[
I] = bop(
s, vs1.v_[
I]);
156 template<
class V,
class V1,
class BinaryOp>
157 static inline void op(V& vs,
const V1& vs1,
const V1& vs2, BinaryOp bop)
161 vs.v_[
I] = bop(vs1.v_[
I], vs2.v_[
I]);
172struct VectorSpaceOps<
N,
N>
174 template<
class Input,
class Output>
175 static inline void copy_n(Input, Output) {}
177 template<
class Output,
class T>
178 static inline void fill_n(Output,
const T&) {}
180 template<
class V,
class S,
class EqOp>
181 static inline void eqOpS(V&,
const S&,
EqOp) {}
183 template<
class S,
class V,
class EqOp>
184 static inline void SeqOp(S&,
const V&,
EqOp) {}
186 template<
class V1,
class V2,
class EqOp>
187 static inline void eqOp(V1&,
const V2&,
EqOp) {}
189 template<
class V,
class V1,
class S,
class BinaryOp>
190 static inline void opVS(V&,
const V1&,
const S&, BinaryOp) {}
192 template<
class V,
class S,
class V1,
class BinaryOp>
193 static inline void opSV(V&,
const S&,
const V1&, BinaryOp) {}
195 template<
class V,
class V1,
class BinaryOp>
196 static inline void op(V&,
const V1&,
const V1&, BinaryOp) {}
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.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 const Identity< scalar > I
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
static void copy_n(Input, Output)
static void SeqOp(S &, const V &, EqOp)
static void opVS(V &, const V1 &, const S &, BinaryOp)
static void fill_n(Output, const T &)
static void eqOpS(V &, const S &, EqOp)
static void op(V &, const V1 &, const V1 &, BinaryOp)
static void opSV(V &, const S &, const V1 &, BinaryOp)
static void eqOp(V1 &, const V2 &, EqOp)
Recursive execution. Terminating at <N>, starting at index <I>.
static void opSV(V &vs, const S &s, const V1 &vs1, BinaryOp bop)
Apply the binary operation between scalar and vector-space data and assign the result.
static void fill_n(Output result, const T &val)
Somewhat equivalent to std::fill_n() but with templated loops.
static void SeqOp(S &s, const V &vs, EqOp eo)
Apply the inplace binary reduction operation.
static void eqOpS(V &vs, const S &s, EqOp eo)
Apply the binary assignment operation to each vector-space component.
static void copy_n(Input input, Output result)
Somewhat equivalent to std::copy_n() but with templated loops.
static void op(V &vs, const V1 &vs1, const V1 &vs2, BinaryOp bop)
Apply the binary operation between two vector-space data and assign the result.
static void eqOp(V1 &vs1, const V2 &vs2, EqOp eo)
Apply the inplace binary assignment operation to the components.
static void opVS(V &vs, const V1 &vs1, const S &s, BinaryOp bop)
Apply the binary operation between vector-space and scalar data and assign the result.
const Vector< label > N(dict.get< Vector< label > >("N"))