From 3ae3427ddcfdd3c51fba0b08576a98c5e5cdb6bb Mon Sep 17 00:00:00 2001 From: Oliver Sander <sander@igpm.rwth-aachen.de> Date: Thu, 14 Oct 2010 13:09:30 +0000 Subject: [PATCH] Add constructor from a scalar [[Imported from SVN: r6425]] --- dune/gfe/tensor3.hh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dune/gfe/tensor3.hh b/dune/gfe/tensor3.hh index 41db5c72..796ef846 100644 --- a/dune/gfe/tensor3.hh +++ b/dune/gfe/tensor3.hh @@ -8,11 +8,23 @@ #include <dune/common/array.hh> #include <dune/common/fmatrix.hh> +/** \brief A third-rank tensor +*/ template <class T, int N1, int N2, int N3> class Tensor3 : public Dune::array<Dune::FieldMatrix<T,N2,N3>,N1> { public: + + /** \brief Default constructor */ + Tensor3() {} + + /** \brief Constructor from a scalar */ + Tensor3(const T& c) + { + for (int i=0; i<N1; i++) + (*this)[i] = c; + } T infinity_norm() const { -- GitLab