14#include <dune/localfunctions/utility/field.hh>
31 template <
class F,
int dimD,
unsigned int deriv>
34 typedef LFETensor<F,dimD,deriv> This;
35 typedef LFETensor<F,dimD-1,deriv> BaseDim;
36 typedef LFETensor<F,dimD,deriv-1> BaseDeriv;
40 static const unsigned int size = BaseDim::size+BaseDeriv::size;
44 This &operator= (
const FF &f )
46 block() = field_cast< F >( f );
50 This &operator= (
const Block &b )
56 This &operator*= (
const field_type &f )
62 const field_type &operator[] (
const unsigned int i )
const
67 field_type &operator[] (
const unsigned int i )
76 const Block &block()
const
80 void axpy(
const F& a,
const This &y)
82 block().axpy(a,y.block());
85 void assign(
const LFETensor<Fy,dimD,deriv> &y)
93 template <
class F,
unsigned int deriv>
94 struct LFETensor<F,0,deriv>
96 static const int size = 0;
100 struct LFETensor<F,0,0>
102 static const int size = 1;
105 template <
class F,
int dimD>
106 class LFETensor<F,dimD,0>
108 typedef LFETensor<F,dimD,0> This;
111 typedef F field_type;
112 static const int size = 1;
116 This &operator= (
const FF &f )
118 block() = field_cast< F >( f );
122 This &operator= (
const Block &b )
128 This &operator*= (
const field_type &f )
134 const F &operator[] (
const unsigned int i )
const
139 F &operator[] (
const unsigned int i )
144 void axpy(
const F& a,
const This &y)
146 block().axpy(a,y.block());
149 void assign(
const LFETensor<Fy,dimD,0> &y)
158 const Block &block()
const
167 namespace DerivativeLayoutNS {
168 enum DerivativeLayout {value,derivative};
170 template <
class F,
int dimD,
int dimR,
unsigned int deriv,
171 DerivativeLayoutNS::DerivativeLayout layout>
175 template <
class F,
int dimD,
int dimR,
unsigned int deriv>
176 struct Derivatives<F,dimD,dimR,deriv,DerivativeLayoutNS::value>
177 :
public Derivatives<F,dimD,dimR,deriv-1,DerivativeLayoutNS::value>
179 typedef Derivatives<F,dimD,dimR,deriv,DerivativeLayoutNS::value> This;
180 typedef Derivatives<F,dimD,dimR,deriv-1,DerivativeLayoutNS::value> Base;
181 typedef LFETensor<F,dimD,deriv> ThisLFETensor;
184 typedef F field_type;
186 static const DerivativeLayoutNS::DerivativeLayout layout = DerivativeLayoutNS::value;
187 static const unsigned int dimDomain = dimD;
188 static const unsigned int dimRange = dimR;
189 constexpr static int size = Base::size+ThisLFETensor::size*dimR;
192 This &operator=(
const F& f)
202 template <
unsigned int dorder>
205 tensor<dorder>() = t;
208 This &operator=(
const Block &t)
214 This &operator*= (
const field_type &f )
220 void axpy(
const F &a,
const This &y)
222 block().
axpy(a,y.block());
227 void assign(
const Derivatives<Fy,dimD,dimR,deriv,DerivativeLayoutNS::value> &y)
233 void assign(
const Derivatives<Fy,dimD,dimR,deriv,DerivativeLayoutNS::derivative> &y)
236 for (
int rr=0; rr<dimR; ++rr)
237 tensor_[rr] = y[rr].
template tensor<deriv>()[0];
240 template <
class Fy,
int dimRy>
241 void assign(
const Derivatives<Fy,dimD,dimRy,deriv,DerivativeLayoutNS::value> &y,
unsigned int r)
243 assign<Fy,dimRy>(y.block(),r);
247 void assign(
unsigned int r,
const Derivatives<Fy,dimD,1,deriv,DerivativeLayoutNS::value> &y)
252 void assign(
unsigned int r,
const Derivatives<Fy,dimD,1,deriv,DerivativeLayoutNS::derivative> &y)
259 return reinterpret_cast<Block&
>(*this);
261 const Block &block()
const
263 return reinterpret_cast<const Block&
>(*this);
266 template <
unsigned int dorder>
270 const std::integral_constant<int,dorder> a = {};
273 template <
unsigned int dorder>
277 return tensor(std::integral_constant<int,dorder>());
279 template <
unsigned int dorder>
283 const std::integral_constant<int,dorder> a = {};
286 template <
unsigned int dorder>
290 const std::integral_constant<int,dorder> a = {};
293 ThisLFETensor &operator[](
int r) {
296 const ThisLFETensor &operator[](
int r)
const {
300 template <
class Fy,
int dimRy>
301 void assign(
const FieldVector<Fy,size*dimRy> &y,
unsigned int r)
303 Base::template assign<Fy,dimRy>(
reinterpret_cast<const FieldVector<Fy,Base::size*dimRy>&
>(y),r);
304 tensor_[0] =
reinterpret_cast<const FieldVector<Fy,ThisLFETensor::size>&
>(y[Base::size*dimRy+r*ThisLFETensor::size]);
307 void assign(
unsigned int r,
const FieldVector<Fy,size/dimR> &y)
309 Base::assign(r,
reinterpret_cast<const FieldVector<Fy,Base::size/dimR
>&>(y));
310 tensor_[r] =
reinterpret_cast<const FieldVector<Fy,ThisLFETensor::size>&
>(y[Base::size/dimR]);
313 template <
class Fy,
unsigned int dy>
314 void assign(
const Derivatives<Fy,dimD,dimR,dy,DerivativeLayoutNS::derivative> &y)
317 for (
int rr=0; rr<dimR; ++rr)
318 tensor_[rr] = y[rr].
template tensor<deriv>()[0];
321 template <
int dorder>
323 tensor(
const std::integral_constant<int,dorder> &dorderVar)
const
325 return Base::tensor(dorderVar);
328 tensor(
const std::integral_constant<int,deriv> &dorderVar)
const
332 template <
int dorder>
334 tensor(
const std::integral_constant<int,dorder> &dorderVar)
336 return Base::tensor(dorderVar);
339 tensor(
const std::integral_constant<int,deriv> &dorderVar)
346 template <
class F,
int dimD,
int dimR>
347 struct Derivatives<F,dimD,dimR,0,DerivativeLayoutNS::value>
349 typedef Derivatives<F,dimD,dimR,0,DerivativeLayoutNS::value> This;
350 typedef LFETensor<F,dimD,0> ThisLFETensor;
353 typedef F field_type;
355 static const DerivativeLayoutNS::DerivativeLayout layout = DerivativeLayoutNS::value;
356 static const unsigned int dimDomain = dimD;
357 static const unsigned int dimRange = dimR;
358 constexpr static int size = ThisLFETensor::size*dimR;
362 This &operator=(
const FF& f)
364 for (
int r=0; r<dimR; ++r)
365 tensor_[r] = field_cast<F>(f);
374 This &operator=(
const Block &t)
380 This &operator*= (
const field_type &f )
386 void axpy(
const F &a,
const This &y)
388 block().
axpy(a,y.block());
391 void assign(
const Derivatives<Fy,dimD,dimR,0,DerivativeLayoutNS::value> &y)
396 void assign(
const Derivatives<Fy,dimD,dimR,0,DerivativeLayoutNS::derivative> &y)
398 for (
int rr=0; rr<dimR; ++rr)
399 tensor_[rr] = y[rr].
template tensor<0>()[0];
401 template <
class Fy,
int dimRy>
402 void assign(
const Derivatives<Fy,dimD,dimRy,0,DerivativeLayoutNS::value> &y,
unsigned int r)
404 assign<Fy,dimRy>(y.block(),r);
407 void assign(
unsigned int r,
const Derivatives<Fy,dimD,1,0,DerivativeLayoutNS::value> &y)
409 tensor_[r].assign(y[0]);
412 void assign(
unsigned int r,
const Derivatives<Fy,dimD,1,0,DerivativeLayoutNS::derivative> &y)
414 tensor_[r].assign(y[0][0]);
419 return reinterpret_cast<Block&
>(*this);
421 const Block &block()
const
423 return reinterpret_cast<const Block&
>(*this);
426 ThisLFETensor &operator[](
int r) {
429 const ThisLFETensor &operator[](
int r)
const {
432 template <
int dorder>
441 template <
unsigned int dorder>
445 const std::integral_constant<int,dorder> a = {};
448 template <
unsigned int dorder>
452 const std::integral_constant<int,dorder> a = {};
458 tensor(
const std::integral_constant<int,0> &dorderVar)
const
463 tensor(
const std::integral_constant<int,0> &dorderVar)
467 template <
class Fy,
unsigned int dy>
468 void assign(
const Derivatives<Fy,dimD,dimR,dy,DerivativeLayoutNS::derivative> &y)
470 for (
int rr=0; rr<dimR; ++rr)
471 tensor_[rr] = y[rr].
template tensor<0>()[0];
473 template <
class Fy,
int dimRy>
474 void assign(
const FieldVector<Fy,size*dimRy> &y,
unsigned int r)
476 tensor_[0] =
reinterpret_cast<const FieldVector<Fy,ThisLFETensor::size>&
>(y[r*ThisLFETensor::size]);
479 void assign(
unsigned int r,
const FieldVector<Fy,size/dimR> &y)
487 template <
class F,
int dimD,
int dimR,
unsigned int deriv>
488 struct Derivatives<F,dimD,dimR,deriv,DerivativeLayoutNS::derivative>
490 typedef Derivatives<F,dimD,dimR,deriv,DerivativeLayoutNS::derivative> This;
491 typedef Derivatives<F,dimD,1,deriv,DerivativeLayoutNS::value> ScalarDeriv;
494 typedef F field_type;
496 static const DerivativeLayoutNS::DerivativeLayout layout = DerivativeLayoutNS::value;
497 static const unsigned int dimDomain = dimD;
498 static const unsigned int dimRange = dimR;
499 constexpr static int size = ScalarDeriv::size*dimR;
503 This &operator=(
const FF& f)
505 block() = field_cast<F>(f);
508 This &operator=(
const Block &t)
514 This &operator*= (
const field_type &f )
521 void axpy(
const FF &a,
const This &y)
523 block().axpy(field_cast<F>(a),y.block());
527 void assign(
const Derivatives<Fy,dimD,dimR,deriv,DerivativeLayoutNS::derivative> &y)
533 void assign(
const Derivatives<Fy,dimD,dimR,deriv,DerivativeLayoutNS::value> &y)
535 for (
unsigned int rr=0; rr<dimR; ++rr)
539 template <
class Fy,DerivativeLayoutNS::DerivativeLayout layouty>
540 void assign(
unsigned int r,
const Derivatives<Fy,dimD,1,deriv,layouty> &y)
542 deriv_[r].assign(r,y);
547 return reinterpret_cast<Block&
>(*this);
549 const Block &block()
const
551 return reinterpret_cast<const Block&
>(*this);
554 ScalarDeriv &operator[](
int r) {
557 const ScalarDeriv &operator[](
int r)
const {
567 template <
class Vec1,
class Vec2,
unsigned int deriv>
570 template <
class Field>
571 static void apply(
unsigned int r,
const Field &a,
572 const Vec1 &x, Vec2 &y)
577 template <
class F1,
int dimD,
int dimR,
581 struct LFETensorAxpy<Derivatives<F1,dimD,dimR,d,DerivativeLayoutNS::value>,Vec2,deriv>
583 typedef Derivatives<F1,dimD,dimR,d,DerivativeLayoutNS::value> Vec1;
584 template <
class Field>
585 static void apply(
unsigned int r,
const Field &a,
586 const Vec1 &x, Vec2 &y)
588 const FieldVector<F1,Vec2::size> &xx = x.template block<deriv>();
589 for (
int i=0; i<y.size; ++i)
593 template <
class F1,
int dimD,
int dimR,
597 struct LFETensorAxpy<Derivatives<F1,dimD,dimR,d,DerivativeLayoutNS::derivative>,Vec2,deriv>
599 typedef Derivatives<F1,dimD,dimR,d,DerivativeLayoutNS::derivative> Vec1;
600 template <
class Field>
601 static void apply(
unsigned int r,
const Field &a,
602 const Vec1 &x, Vec2 &y)
604 for (
int rr=0; rr<dimR; ++rr)
605 LFETensorAxpy<Derivatives<F1,dimD,1,d,DerivativeLayoutNS::value>,
606 Vec2,deriv>::apply(rr,a,x[rr],y);
609 template <
class F1,
int dimD,
613 struct LFETensorAxpy<Derivatives<F1,dimD,1,d,DerivativeLayoutNS::derivative>,Vec2,deriv>
615 typedef Derivatives<F1,dimD,1,d,DerivativeLayoutNS::derivative> Vec1;
616 template <
class Field>
617 static void apply(
unsigned int r,
const Field &a,
618 const Vec1 &x, Vec2 &y)
620 LFETensorAxpy<Derivatives<F1,dimD,1,d,DerivativeLayoutNS::value>,
621 Vec2,deriv>::apply(r,a,x[0],y);
624 template <
class F1,
int dimD,
628 struct LFETensorAxpy<Derivatives<F1,dimD,1,d,DerivativeLayoutNS::value>,Vec2,deriv>
630 typedef Derivatives<F1,dimD,1,d,DerivativeLayoutNS::value> Vec1;
631 template <
class Field>
632 static void apply(
unsigned int r,
const Field &a,
633 const Vec1 &x, Vec2 &y)
635 typedef LFETensor<F1,dimD,deriv> LFETensorType;
636 const unsigned int rr = r*LFETensorType::size;
637 const FieldVector<F1,LFETensorType::size> &xx = x.template block<deriv>();
638 for (
int i=0; i<FieldVector<F1,LFETensorType::size>::dimension; ++i)
646 template <
class Vec1,
class Vec2>
647 struct DerivativeAssign
649 static void apply(
unsigned int r,
const Vec1 &vec1,Vec2 &vec2)
654 template <
int dimD,
int dimR,
unsigned int deriv, DerivativeLayoutNS::DerivativeLayout layout,
656 struct DerivativeAssign<Derivatives<F1,dimD,dimR,deriv,layout>,
657 Derivatives<F2,dimD,dimR,deriv,layout> >
659 typedef Derivatives<F1,dimD,dimR,deriv,layout> Vec1;
660 typedef Derivatives<F2,dimD,dimR,deriv,layout> Vec2;
661 static void apply(
unsigned int r,
const Vec1 &vec1,Vec2 &vec2)
666 template <
int dimD,
int dimR,
unsigned int deriv,
668 struct DerivativeAssign<Derivatives<F1,dimD,dimR,deriv,DerivativeLayoutNS::value>,
669 Derivatives<F2,dimD,dimR,deriv,DerivativeLayoutNS::derivative> >
671 typedef Derivatives<F1,dimD,dimR,deriv,DerivativeLayoutNS::value> Vec1;
672 typedef Derivatives<F2,dimD,dimR,deriv,DerivativeLayoutNS::derivative> Vec2;
673 static void apply(
unsigned int r,
const Vec1 &vec1,Vec2 &vec2)
678 template <
int dimD,
int dimR,
unsigned int deriv,
680 struct DerivativeAssign<Derivatives<F1,dimD,dimR,deriv,DerivativeLayoutNS::derivative>,
681 Derivatives<F2,dimD,dimR,deriv,DerivativeLayoutNS::value> >
683 typedef Derivatives<F1,dimD,dimR,deriv,DerivativeLayoutNS::derivative> Vec1;
684 typedef Derivatives<F2,dimD,dimR,deriv,DerivativeLayoutNS::value> Vec2;
685 static void apply(
unsigned int r,
const Vec1 &vec1,Vec2 &vec2)
690 template <
int dimD,
int dimR,
unsigned int deriv,DerivativeLayoutNS::DerivativeLayout layout,
692 struct DerivativeAssign<Derivatives<F1,dimD,1,deriv,layout>,
693 Derivatives<F2,dimD,dimR,deriv,DerivativeLayoutNS::value> >
695 typedef Derivatives<F1,dimD,1,deriv,layout> Vec1;
696 typedef Derivatives<F2,dimD,dimR,deriv,DerivativeLayoutNS::value> Vec2;
697 static void apply(
unsigned int r,
const Vec1 &vec1,Vec2 &vec2)
702 template <
int dimD,
int dimR,
unsigned int deriv,DerivativeLayoutNS::DerivativeLayout layout,
704 struct DerivativeAssign<Derivatives<F1,dimD,1,deriv,layout>,
705 Derivatives<F2,dimD,dimR,deriv,DerivativeLayoutNS::derivative> >
707 typedef Derivatives<F1,dimD,1,deriv,layout> Vec1;
708 typedef Derivatives<F2,dimD,dimR,deriv,DerivativeLayoutNS::derivative> Vec2;
709 static void apply(
unsigned int r,
const Vec1 &vec1,Vec2 &vec2)
714 template <
int dimD,
unsigned int deriv,
716 struct DerivativeAssign<Derivatives<F1,dimD,1,deriv,DerivativeLayoutNS::value>,
717 Derivatives<F2,dimD,1,deriv,DerivativeLayoutNS::value> >
719 typedef Derivatives<F1,dimD,1,deriv,DerivativeLayoutNS::value> Vec1;
720 typedef Derivatives<F2,dimD,1,deriv,DerivativeLayoutNS::value> Vec2;
721 static void apply(
unsigned int r,
const Vec1 &vec1,Vec2 &vec2)
726 template <
int dimD,
unsigned int deriv,
728 struct DerivativeAssign<Derivatives<F1,dimD,1,deriv,DerivativeLayoutNS::derivative>,
729 Derivatives<F2,dimD,1,deriv,DerivativeLayoutNS::derivative> >
731 typedef Derivatives<F1,dimD,1,deriv,DerivativeLayoutNS::derivative> Vec1;
732 typedef Derivatives<F2,dimD,1,deriv,DerivativeLayoutNS::derivative> Vec2;
733 static void apply(
unsigned int r,
const Vec1 &vec1,Vec2 &vec2)
738 template <
int dimD,
unsigned int deriv,
740 struct DerivativeAssign<Derivatives<F1,dimD,1,deriv,DerivativeLayoutNS::derivative>,
741 Derivatives<F2,dimD,1,deriv,DerivativeLayoutNS::value> >
743 typedef Derivatives<F1,dimD,1,deriv,DerivativeLayoutNS::derivative> Vec1;
744 typedef Derivatives<F2,dimD,1,deriv,DerivativeLayoutNS::value> Vec2;
745 static void apply(
unsigned int r,
const Vec1 &vec1,Vec2 &vec2)
750 template <
int dimD,
unsigned int deriv,
752 struct DerivativeAssign<Derivatives<F1,dimD,1,deriv,DerivativeLayoutNS::value>,
753 Derivatives<F2,dimD,1,deriv,DerivativeLayoutNS::derivative> >
755 typedef Derivatives<F1,dimD,1,deriv,DerivativeLayoutNS::value> Vec1;
756 typedef Derivatives<F2,dimD,1,deriv,DerivativeLayoutNS::derivative> Vec2;
757 static void apply(
unsigned int r,
const Vec1 &vec1,Vec2 &vec2)
762 template <
int dimD,
unsigned int deriv,DerivativeLayoutNS::DerivativeLayout layout,
764 struct DerivativeAssign<Derivatives<F1,dimD,1,deriv,layout>,
767 typedef Derivatives<F1,dimD,1,deriv,layout> Vec1;
769 static void apply(
unsigned int r,
const Vec1 &vec1,Vec2 &vec2)
774 template <
int dimD,
int dimR,
775 class F1,
unsigned int deriv,
777 struct DerivativeAssign<Derivatives<F1,dimD,dimR,deriv,DerivativeLayoutNS::value>,FieldVector<F2,dimR> >
779 typedef Derivatives<F1,dimD,dimR,deriv,DerivativeLayoutNS::value> Vec1;
780 typedef FieldVector<F2,dimR> Vec2;
781 static void apply(
unsigned int r,
const Vec1 &vec1,Vec2 &vec2)
786 template <
int dimD,
int dimR,
787 class F1,
unsigned int deriv,
789 struct DerivativeAssign<Derivatives<F1,dimD,dimR,deriv,DerivativeLayoutNS::derivative>,FieldVector<F2,dimR> >
791 typedef Derivatives<F1,dimD,dimR,deriv,DerivativeLayoutNS::derivative> Vec1;
792 typedef FieldVector<F2,dimR> Vec2;
793 static void apply(
unsigned int r,
const Vec1 &vec1,Vec2 &vec2)
795 for (
int rr=0; rr<dimR; ++rr)
796 field_cast(vec1[rr].
template tensor<0>()[0].block(),vec2[rr]);
800 class F1,
unsigned int deriv,
802 struct DerivativeAssign<Derivatives<F1,dimD,1,deriv,DerivativeLayoutNS::value>,FieldVector<F2,dimR> >
804 typedef Derivatives<F1,dimD,1,deriv,DerivativeLayoutNS::value> Vec1;
805 typedef FieldVector<F2,dimR> Vec2;
806 static void apply(
unsigned int r,
const Vec1 &vec1,Vec2 &vec2)
808 field_cast(vec1.template tensor<0>()[0].block(),vec2[r]);
812 class F1,
unsigned int deriv,
814 struct DerivativeAssign<Derivatives<F1,dimD,1,deriv,DerivativeLayoutNS::derivative>,FieldVector<F2,dimR> >
816 typedef Derivatives<F1,dimD,1,deriv,DerivativeLayoutNS::derivative> Vec1;
817 typedef FieldVector<F2,dimR> Vec2;
818 static void apply(
unsigned int r,
const Vec1 &vec1,Vec2 &vec2)
820 field_cast(vec1[0].
template tensor<0>()[0].block(),vec2[r]);
824 class F1,
unsigned int deriv,
826 struct DerivativeAssign<Derivatives<F1,dimD,1,deriv,DerivativeLayoutNS::value>,FieldVector<F2,1> >
828 typedef Derivatives<F1,dimD,1,deriv,DerivativeLayoutNS::value> Vec1;
829 typedef FieldVector<F2,1> Vec2;
830 static void apply(
unsigned int r,
const Vec1 &vec1,Vec2 &vec2)
832 field_cast(vec1.template tensor<0>()[0].block(),vec2);
836 class F1,
unsigned int deriv,
838 struct DerivativeAssign<Derivatives<F1,dimD,1,deriv,DerivativeLayoutNS::derivative>,FieldVector<F2,1> >
840 typedef Derivatives<F1,dimD,1,deriv,DerivativeLayoutNS::derivative> Vec1;
841 typedef FieldVector<F2,1> Vec2;
842 static void apply(
unsigned int ,
const Vec1 &vec1,Vec2 &vec2)
844 field_cast(vec1[0].
template tensor<0>()[0].block(),vec2);
851 template <
class F,
int dimD,
unsigned int deriv>
852 std::ostream &operator<< ( std::ostream &out,
const LFETensor< F,dimD,deriv > &tensor )
854 return out << tensor.block();
857 template <
class F,
int dimD,
unsigned int deriv>
858 std::ostream &operator<< ( std::ostream &out,
const ScalarDerivatives< F,dimD,deriv > &d )
860 out <<
static_cast<const ScalarDerivatives< F,dimD,deriv-1
> &>(d);
861 out <<
" , " << d.tensor() << std::endl;
864 template <
class F,
int dimD>
865 std::ostream &operator<< ( std::ostream &out,
const ScalarDerivatives< F,dimD,0 > &d )
867 out << d.tensor() << std::endl;
871 template <
class F,
int dimD,
int dimR,
unsigned int deriv>
872 std::ostream &operator<< ( std::ostream &out,
const Derivatives< F,dimD,dimR,deriv,DerivativeLayoutNS::derivative > &d )
876 for (
int r=1; r<dimR; ++r)
878 out <<
" , " << d[r];
880 out <<
" ) " << std::endl;
883 template <
class F,
int dimD,
int dimR,
unsigned int deriv>
884 std::ostream &operator<< ( std::ostream &out,
const Derivatives< F,dimD,dimR,deriv,DerivativeLayoutNS::value > &d )
886 out <<
static_cast<const Derivatives< F,dimD,dimR,deriv-1,DerivativeLayoutNS::value
> &>(d);
889 for (
int r=1; r<dimR; ++r)
891 out <<
" , " << d[r];
893 out <<
" ) " << std::endl;
896 template <
class F,
int dimD,
int dimR>
897 std::ostream &operator<< ( std::ostream &out,
const Derivatives< F,dimD,dimR,0,DerivativeLayoutNS::derivative > &d )
901 for (
int r=1; r<dimR; ++r)
903 out <<
" , " << d[r];
905 out <<
" ) " << std::endl;
908 template <
class F,
int dimD,
int dimR>
909 std::ostream &operator<< ( std::ostream &out,
const Derivatives< F,dimD,dimR,0,DerivativeLayoutNS::value > &d )
913 for (
int r=1; r<dimR; ++r)
915 out <<
" , " << d[r];
917 out <<
" ) " << std::endl;
920 template <
class F,
int dimD,
int dimR,
unsigned int deriv,DerivativeLayoutNS::DerivativeLayout layout>
921 std::ostream &operator<< ( std::ostream &out,
const std::vector<Derivatives< F,dimD,dimR,deriv,layout > > &y )
923 out <<
"Number of basis functions: " << y.size() << std::endl;
924 for (
unsigned int i=0; i<y.size(); ++i)
926 out <<
"Base " << i <<
" : " << std::endl;
derived_type & axpy(const field_type &a, const DenseVector< Other > &x)
vector space axpy operation ( *this += a x )
Definition: densevector.hh:575
Implements a vector constructed from a given type representing a field and a compile-time given size.
Dune namespace.
Definition: alignedallocator.hh:13
void field_cast(const F1 &f1, F2 &f2)
a helper class to cast from one field to another
Definition: field.hh:159
void assign(T &dst, const T &src, bool mask)
masked Simd assignment (scalar version)
Definition: simd.hh:447