12#include <dune/localfunctions/utility/field.hh>
29 template <
class F,
int dimD,
unsigned int deriv>
32 typedef LFETensor<F,dimD,deriv> This;
33 typedef LFETensor<F,dimD-1,deriv> BaseDim;
34 typedef LFETensor<F,dimD,deriv-1> BaseDeriv;
38 static const unsigned int size = BaseDim::size+BaseDeriv::size;
42 This &operator= (
const FF &f )
44 block() = field_cast< F >( f );
48 This &operator= (
const Block &b )
54 This &operator*= (
const field_type &f )
60 const field_type &operator[] (
const unsigned int i )
const
65 field_type &operator[] (
const unsigned int i )
74 const Block &block()
const
78 void axpy(
const F& a,
const This &y)
80 block().axpy(a,y.block());
83 void assign(
const LFETensor<Fy,dimD,deriv> &y)
91 template <
class F,
unsigned int deriv>
92 struct LFETensor<F,0,deriv>
94 static const int size = 0;
98 struct LFETensor<F,0,0>
100 static const int size = 1;
103 template <
class F,
int dimD>
104 class LFETensor<F,dimD,0>
106 typedef LFETensor<F,dimD,0> This;
109 typedef F field_type;
110 static const int size = 1;
114 This &operator= (
const FF &f )
116 block() = field_cast< F >( f );
120 This &operator= (
const Block &b )
126 This &operator*= (
const field_type &f )
132 const F &operator[] (
const unsigned int i )
const
137 F &operator[] (
const unsigned int i )
142 void axpy(
const F& a,
const This &y)
144 block().axpy(a,y.block());
147 void assign(
const LFETensor<Fy,dimD,0> &y)
156 const Block &block()
const
165 namespace DerivativeLayoutNS {
168 template <
class F,
int dimD,
int dimR,
unsigned int deriv,
169 DerivativeLayoutNS::DerivativeLayout layout>
173 template <
class F,
int dimD,
int dimR,
unsigned int deriv>
174 struct Derivatives<F,dimD,dimR,deriv,DerivativeLayoutNS::value>
175 :
public Derivatives<F,dimD,dimR,deriv-1,DerivativeLayoutNS::value>
177 typedef Derivatives<F,dimD,dimR,deriv,DerivativeLayoutNS::value> This;
178 typedef Derivatives<F,dimD,dimR,deriv-1,DerivativeLayoutNS::value> Base;
179 typedef LFETensor<F,dimD,deriv> ThisLFETensor;
182 typedef F field_type;
184 static const DerivativeLayoutNS::DerivativeLayout layout = DerivativeLayoutNS::value;
185 static const unsigned int dimDomain = dimD;
186 static const unsigned int dimRange = dimR;
188 enum { size = Base::size+ThisLFETensor::size*dimR };
191 This &operator=(
const F& f)
201 template <
unsigned int dorder>
204 tensor<dorder>() = t;
207 This &operator=(
const Block &t)
213 This &operator*= (
const field_type &f )
219 void axpy(
const F &a,
const This &y)
221 block().
axpy(a,y.block());
226 void assign(
const Derivatives<Fy,dimD,dimR,deriv,DerivativeLayoutNS::value> &y)
232 void assign(
const Derivatives<Fy,dimD,dimR,deriv,DerivativeLayoutNS::derivative> &y)
235 for (
int rr=0; rr<dimR; ++rr)
236 tensor_[rr] = y[rr].
template tensor<deriv>()[0];
239 template <
class Fy,
int dimRy>
240 void assign(
const Derivatives<Fy,dimD,dimRy,deriv,DerivativeLayoutNS::value> &y,
unsigned int r)
242 assign<Fy,dimRy>(y.block(),r);
246 void assign(
unsigned int r,
const Derivatives<Fy,dimD,1,deriv,DerivativeLayoutNS::value> &y)
251 void assign(
unsigned int r,
const Derivatives<Fy,dimD,1,deriv,DerivativeLayoutNS::derivative> &y)
258 return reinterpret_cast<Block&
>(*this);
260 const Block &block()
const
262 return reinterpret_cast<const Block&
>(*this);
265 template <
unsigned int dorder>
269 const std::integral_constant<int,dorder> a = {};
272 template <
unsigned int dorder>
276 return tensor(std::integral_constant<int,dorder>());
278 template <
unsigned int dorder>
282 const std::integral_constant<int,dorder> a = {};
285 template <
unsigned int dorder>
289 const std::integral_constant<int,dorder> a = {};
292 ThisLFETensor &operator[](
int r) {
295 const ThisLFETensor &operator[](
int r)
const {
299 template <
class Fy,
int dimRy>
300 void assign(
const FieldVector<Fy,size*dimRy> &y,
unsigned int r)
302 Base::template assign<Fy,dimRy>(
reinterpret_cast<const FieldVector<Fy,Base::size*dimRy>&
>(y),r);
303 tensor_[0] =
reinterpret_cast<const FieldVector<Fy,ThisLFETensor::size>&
>(y[Base::size*dimRy+r*ThisLFETensor::size]);
306 void assign(
unsigned int r,
const FieldVector<Fy,size/dimR> &y)
308 Base::assign(r,
reinterpret_cast<const FieldVector<Fy,Base::size/dimR
>&>(y));
309 tensor_[r] =
reinterpret_cast<const FieldVector<Fy,ThisLFETensor::size>&
>(y[Base::size/dimR]);
312 template <
class Fy,
unsigned int dy>
313 void assign(
const Derivatives<Fy,dimD,dimR,dy,DerivativeLayoutNS::derivative> &y)
316 for (
int rr=0; rr<dimR; ++rr)
317 tensor_[rr] = y[rr].
template tensor<deriv>()[0];
320 template <
int dorder>
322 tensor(
const std::integral_constant<int,dorder> &dorderVar)
const
324 return Base::tensor(dorderVar);
327 tensor(
const std::integral_constant<int,deriv> &dorderVar)
const
331 template <
int dorder>
333 tensor(
const std::integral_constant<int,dorder> &dorderVar)
335 return Base::tensor(dorderVar);
338 tensor(
const std::integral_constant<int,deriv> &dorderVar)
345 template <
class F,
int dimD,
int dimR>
346 struct Derivatives<F,dimD,dimR,0,DerivativeLayoutNS::value>
348 typedef Derivatives<F,dimD,dimR,0,DerivativeLayoutNS::value> This;
349 typedef LFETensor<F,dimD,0> ThisLFETensor;
352 typedef F field_type;
354 static const DerivativeLayoutNS::DerivativeLayout layout = DerivativeLayoutNS::value;
355 static const unsigned int dimDomain = dimD;
356 static const unsigned int dimRange = dimR;
358 enum { 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;
500 enum { size = ScalarDeriv::size*dimR };
504 This &operator=(
const FF& f)
506 block() = field_cast<F>(f);
509 This &operator=(
const Block &t)
515 This &operator*= (
const field_type &f )
522 void axpy(
const FF &a,
const This &y)
524 block().axpy(field_cast<F>(a),y.block());
528 void assign(
const Derivatives<Fy,dimD,dimR,deriv,DerivativeLayoutNS::derivative> &y)
534 void assign(
const Derivatives<Fy,dimD,dimR,deriv,DerivativeLayoutNS::value> &y)
536 for (
unsigned int rr=0; rr<dimR; ++rr)
540 template <
class Fy,DerivativeLayoutNS::DerivativeLayout layouty>
541 void assign(
unsigned int r,
const Derivatives<Fy,dimD,1,deriv,layouty> &y)
543 deriv_[r].assign(r,y);
548 return reinterpret_cast<Block&
>(*this);
550 const Block &block()
const
552 return reinterpret_cast<const Block&
>(*this);
555 ScalarDeriv &operator[](
int r) {
558 const ScalarDeriv &operator[](
int r)
const {
568 template <
class Vec1,
class Vec2,
unsigned int deriv>
571 template <
class Field>
572 static void apply(
unsigned int r,
const Field &a,
573 const Vec1 &x, Vec2 &y)
578 template <
class F1,
int dimD,
int dimR,
582 struct LFETensorAxpy<Derivatives<F1,dimD,dimR,d,DerivativeLayoutNS::value>,Vec2,deriv>
584 typedef Derivatives<F1,dimD,dimR,d,DerivativeLayoutNS::value> Vec1;
585 template <
class Field>
586 static void apply(
unsigned int r,
const Field &a,
587 const Vec1 &x, Vec2 &y)
589 const FieldVector<F1,Vec2::size> &xx = x.template block<deriv>();
590 for (
int i=0; i<y.size; ++i)
594 template <
class F1,
int dimD,
int dimR,
598 struct LFETensorAxpy<Derivatives<F1,dimD,dimR,d,DerivativeLayoutNS::
derivative>,Vec2,deriv>
600 typedef Derivatives<F1,dimD,dimR,d,DerivativeLayoutNS::derivative> Vec1;
601 template <
class Field>
602 static void apply(
unsigned int r,
const Field &a,
603 const Vec1 &x, Vec2 &y)
605 for (
int rr=0; rr<dimR; ++rr)
606 LFETensorAxpy<Derivatives<F1,dimD,1,d,DerivativeLayoutNS::value>,
607 Vec2,deriv>::apply(rr,a,x[rr],y);
610 template <
class F1,
int dimD,
614 struct LFETensorAxpy<Derivatives<F1,dimD,1,d,DerivativeLayoutNS::
derivative>,Vec2,deriv>
616 typedef Derivatives<F1,dimD,1,d,DerivativeLayoutNS::derivative> Vec1;
617 template <
class Field>
618 static void apply(
unsigned int r,
const Field &a,
619 const Vec1 &x, Vec2 &y)
621 LFETensorAxpy<Derivatives<F1,dimD,1,d,DerivativeLayoutNS::value>,
622 Vec2,deriv>::apply(r,a,x[0],y);
625 template <
class F1,
int dimD,
629 struct LFETensorAxpy<Derivatives<F1,dimD,1,d,DerivativeLayoutNS::value>,Vec2,deriv>
631 typedef Derivatives<F1,dimD,1,d,DerivativeLayoutNS::value> Vec1;
632 template <
class Field>
633 static void apply(
unsigned int r,
const Field &a,
634 const Vec1 &x, Vec2 &y)
636 typedef LFETensor<F1,dimD,deriv> LFETensorType;
637 const unsigned int rr = r*LFETensorType::size;
638 const FieldVector<F1,LFETensorType::size> &xx = x.template block<deriv>();
639 for (
int i=0; i<FieldVector<F1,LFETensorType::size>::dimension; ++i)
647 template <
class Vec1,
class Vec2>
648 struct DerivativeAssign
650 static void apply(
unsigned int r,
const Vec1 &vec1,Vec2 &vec2)
655 template <
int dimD,
int dimR,
unsigned int deriv, DerivativeLayoutNS::DerivativeLayout layout,
657 struct DerivativeAssign<Derivatives<F1,dimD,dimR,deriv,layout>,
658 Derivatives<F2,dimD,dimR,deriv,layout> >
660 typedef Derivatives<F1,dimD,dimR,deriv,layout> Vec1;
661 typedef Derivatives<F2,dimD,dimR,deriv,layout> Vec2;
662 static void apply(
unsigned int r,
const Vec1 &vec1,Vec2 &vec2)
667 template <
int dimD,
int dimR,
unsigned int deriv,
669 struct DerivativeAssign<Derivatives<F1,dimD,dimR,deriv,DerivativeLayoutNS::value>,
670 Derivatives<F2,dimD,dimR,deriv,DerivativeLayoutNS::derivative> >
672 typedef Derivatives<F1,dimD,dimR,deriv,DerivativeLayoutNS::value> Vec1;
673 typedef Derivatives<F2,dimD,dimR,deriv,DerivativeLayoutNS::derivative> Vec2;
674 static void apply(
unsigned int r,
const Vec1 &vec1,Vec2 &vec2)
679 template <
int dimD,
int dimR,
unsigned int deriv,
681 struct DerivativeAssign<Derivatives<F1,dimD,dimR,deriv,DerivativeLayoutNS::
derivative>,
682 Derivatives<F2,dimD,dimR,deriv,DerivativeLayoutNS::value> >
684 typedef Derivatives<F1,dimD,dimR,deriv,DerivativeLayoutNS::derivative> Vec1;
685 typedef Derivatives<F2,dimD,dimR,deriv,DerivativeLayoutNS::value> Vec2;
686 static void apply(
unsigned int r,
const Vec1 &vec1,Vec2 &vec2)
691 template <
int dimD,
int dimR,
unsigned int deriv,DerivativeLayoutNS::DerivativeLayout layout,
693 struct DerivativeAssign<Derivatives<F1,dimD,1,deriv,layout>,
694 Derivatives<F2,dimD,dimR,deriv,DerivativeLayoutNS::value> >
696 typedef Derivatives<F1,dimD,1,deriv,layout> Vec1;
697 typedef Derivatives<F2,dimD,dimR,deriv,DerivativeLayoutNS::value> Vec2;
698 static void apply(
unsigned int r,
const Vec1 &vec1,Vec2 &vec2)
703 template <
int dimD,
int dimR,
unsigned int deriv,DerivativeLayoutNS::DerivativeLayout layout,
705 struct DerivativeAssign<Derivatives<F1,dimD,1,deriv,layout>,
706 Derivatives<F2,dimD,dimR,deriv,DerivativeLayoutNS::
derivative> >
708 typedef Derivatives<F1,dimD,1,deriv,layout> Vec1;
709 typedef Derivatives<F2,dimD,dimR,deriv,DerivativeLayoutNS::derivative> Vec2;
710 static void apply(
unsigned int r,
const Vec1 &vec1,Vec2 &vec2)
715 template <
int dimD,
unsigned int deriv,
717 struct DerivativeAssign<Derivatives<F1,dimD,1,deriv,DerivativeLayoutNS::value>,
718 Derivatives<F2,dimD,1,deriv,DerivativeLayoutNS::value> >
720 typedef Derivatives<F1,dimD,1,deriv,DerivativeLayoutNS::value> Vec1;
721 typedef Derivatives<F2,dimD,1,deriv,DerivativeLayoutNS::value> Vec2;
722 static void apply(
unsigned int r,
const Vec1 &vec1,Vec2 &vec2)
727 template <
int dimD,
unsigned int deriv,
729 struct DerivativeAssign<Derivatives<F1,dimD,1,deriv,DerivativeLayoutNS::
derivative>,
730 Derivatives<F2,dimD,1,deriv,DerivativeLayoutNS::derivative> >
732 typedef Derivatives<F1,dimD,1,deriv,DerivativeLayoutNS::derivative> Vec1;
733 typedef Derivatives<F2,dimD,1,deriv,DerivativeLayoutNS::derivative> Vec2;
734 static void apply(
unsigned int r,
const Vec1 &vec1,Vec2 &vec2)
739 template <
int dimD,
unsigned int deriv,
741 struct DerivativeAssign<Derivatives<F1,dimD,1,deriv,DerivativeLayoutNS::
derivative>,
742 Derivatives<F2,dimD,1,deriv,DerivativeLayoutNS::value> >
744 typedef Derivatives<F1,dimD,1,deriv,DerivativeLayoutNS::derivative> Vec1;
745 typedef Derivatives<F2,dimD,1,deriv,DerivativeLayoutNS::value> Vec2;
746 static void apply(
unsigned int r,
const Vec1 &vec1,Vec2 &vec2)
751 template <
int dimD,
unsigned int deriv,
753 struct DerivativeAssign<Derivatives<F1,dimD,1,deriv,DerivativeLayoutNS::value>,
754 Derivatives<F2,dimD,1,deriv,DerivativeLayoutNS::derivative> >
756 typedef Derivatives<F1,dimD,1,deriv,DerivativeLayoutNS::value> Vec1;
757 typedef Derivatives<F2,dimD,1,deriv,DerivativeLayoutNS::derivative> Vec2;
758 static void apply(
unsigned int r,
const Vec1 &vec1,Vec2 &vec2)
763 template <
int dimD,
unsigned int deriv,DerivativeLayoutNS::DerivativeLayout layout,
765 struct DerivativeAssign<Derivatives<F1,dimD,1,deriv,layout>,
768 typedef Derivatives<F1,dimD,1,deriv,layout> Vec1;
770 static void apply(
unsigned int r,
const Vec1 &vec1,Vec2 &vec2)
775 template <
int dimD,
int dimR,
776 class F1,
unsigned int deriv,
778 struct DerivativeAssign<Derivatives<F1,dimD,dimR,deriv,DerivativeLayoutNS::value>,FieldVector<F2,dimR> >
780 typedef Derivatives<F1,dimD,dimR,deriv,DerivativeLayoutNS::value> Vec1;
781 typedef FieldVector<F2,dimR> Vec2;
782 static void apply(
unsigned int r,
const Vec1 &vec1,Vec2 &vec2)
787 template <
int dimD,
int dimR,
788 class F1,
unsigned int deriv,
790 struct DerivativeAssign<Derivatives<F1,dimD,dimR,deriv,DerivativeLayoutNS::
derivative>,FieldVector<F2,dimR> >
792 typedef Derivatives<F1,dimD,dimR,deriv,DerivativeLayoutNS::derivative> Vec1;
793 typedef FieldVector<F2,dimR> Vec2;
794 static void apply(
unsigned int r,
const Vec1 &vec1,Vec2 &vec2)
796 for (
int rr=0; rr<dimR; ++rr)
797 field_cast(vec1[rr].
template tensor<0>()[0].block(),vec2[rr]);
801 class F1,
unsigned int deriv,
803 struct DerivativeAssign<Derivatives<F1,dimD,1,deriv,DerivativeLayoutNS::value>,FieldVector<F2,dimR> >
805 typedef Derivatives<F1,dimD,1,deriv,DerivativeLayoutNS::value> Vec1;
806 typedef FieldVector<F2,dimR> Vec2;
807 static void apply(
unsigned int r,
const Vec1 &vec1,Vec2 &vec2)
809 field_cast(vec1.template tensor<0>()[0].block(),vec2[r]);
813 class F1,
unsigned int deriv,
815 struct DerivativeAssign<Derivatives<F1,dimD,1,deriv,DerivativeLayoutNS::
derivative>,FieldVector<F2,dimR> >
817 typedef Derivatives<F1,dimD,1,deriv,DerivativeLayoutNS::derivative> Vec1;
818 typedef FieldVector<F2,dimR> Vec2;
819 static void apply(
unsigned int r,
const Vec1 &vec1,Vec2 &vec2)
821 field_cast(vec1[0].
template tensor<0>()[0].block(),vec2[r]);
825 class F1,
unsigned int deriv,
827 struct DerivativeAssign<Derivatives<F1,dimD,1,deriv,DerivativeLayoutNS::value>,FieldVector<F2,1> >
829 typedef Derivatives<F1,dimD,1,deriv,DerivativeLayoutNS::value> Vec1;
830 typedef FieldVector<F2,1> Vec2;
831 static void apply(
unsigned int r,
const Vec1 &vec1,Vec2 &vec2)
833 field_cast(vec1.template tensor<0>()[0].block(),vec2);
837 class F1,
unsigned int deriv,
839 struct DerivativeAssign<Derivatives<F1,dimD,1,deriv,DerivativeLayoutNS::
derivative>,FieldVector<F2,1> >
841 typedef Derivatives<F1,dimD,1,deriv,DerivativeLayoutNS::derivative> Vec1;
842 typedef FieldVector<F2,1> Vec2;
843 static void apply(
unsigned int r,
const Vec1 &vec1,Vec2 &vec2)
845 field_cast(vec1[0].
template tensor<0>()[0].block(),vec2);
852 template <
class F,
int dimD,
unsigned int deriv>
853 std::ostream &operator<< ( std::ostream &out,
const LFETensor< F,dimD,deriv > &tensor )
855 return out << tensor.block();
858 template <
class F,
int dimD,
unsigned int deriv>
859 std::ostream &operator<< ( std::ostream &out,
const ScalarDerivatives< F,dimD,deriv > &d )
861 out <<
static_cast<const ScalarDerivatives< F,dimD,deriv-1
> &>(d);
862 out <<
" , " << d.tensor() << std::endl;
865 template <
class F,
int dimD>
866 std::ostream &operator<< ( std::ostream &out,
const ScalarDerivatives< F,dimD,0 > &d )
868 out << d.tensor() << std::endl;
872 template <
class F,
int dimD,
int dimR,
unsigned int deriv>
873 std::ostream &operator<< ( std::ostream &out,
const Derivatives< F,dimD,dimR,deriv,DerivativeLayoutNS::derivative > &d )
877 for (
int r=1; r<dimR; ++r)
879 out <<
" , " << d[r];
881 out <<
" ) " << std::endl;
884 template <
class F,
int dimD,
int dimR,
unsigned int deriv>
885 std::ostream &operator<< ( std::ostream &out,
const Derivatives< F,dimD,dimR,deriv,DerivativeLayoutNS::value > &d )
887 out <<
static_cast<const Derivatives< F,dimD,dimR,deriv-1,DerivativeLayoutNS::value
> &>(d);
890 for (
int r=1; r<dimR; ++r)
892 out <<
" , " << d[r];
894 out <<
" ) " << std::endl;
897 template <
class F,
int dimD,
int dimR>
898 std::ostream &operator<< ( std::ostream &out,
const Derivatives< F,dimD,dimR,0,DerivativeLayoutNS::derivative > &d )
902 for (
int r=1; r<dimR; ++r)
904 out <<
" , " << d[r];
906 out <<
" ) " << std::endl;
909 template <
class F,
int dimD,
int dimR>
910 std::ostream &operator<< ( std::ostream &out,
const Derivatives< F,dimD,dimR,0,DerivativeLayoutNS::value > &d )
914 for (
int r=1; r<dimR; ++r)
916 out <<
" , " << d[r];
918 out <<
" ) " << std::endl;
921 template <
class F,
int dimD,
int dimR,
unsigned int deriv,DerivativeLayoutNS::DerivativeLayout layout>
922 std::ostream &operator<< ( std::ostream &out,
const std::vector<Derivatives< F,dimD,dimR,deriv,layout > > &y )
924 out <<
"Number of basis functions: " << y.size() << std::endl;
925 for (
unsigned int i=0; i<y.size(); ++i)
927 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:576
Implements a vector constructed from a given type representing a field and a compile-time given size.
TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const TrigonometricFunction< K, sinFactor, cosFactor > &f)
Obtain derivative of TrigonometricFunction function.
Definition: trigonometricfunction.hh:39
Dune namespace.
Definition: alignedallocator.hh:11
void field_cast(const F1 &f1, F2 &f2)
a helper class to cast from one field to another
Definition: field.hh:157
void assign(T &dst, const T &src, bool mask)
masked Simd assignment (scalar version)
Definition: simd.hh:445