]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
changes for Sun forte
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 18 Mar 2002 13:09:58 +0000 (13:09 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 18 Mar 2002 13:09:58 +0000 (13:09 +0000)
git-svn-id: https://svn.dealii.org/trunk@5572 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/tensor.h
deal.II/base/include/base/tensor_base.h

index 54bc15843ed2fb1b06f0f9d845be1057e82a6768..3c7436de2bd4fda857203671925d49aa495e37da 100644 (file)
@@ -62,9 +62,16 @@ class Tensor
     static const unsigned int rank      = rank_;
     
                                     /**
-                                     * Declare an array type which can
-                                     * be used to initialize statically
-                                     * an object of this type.
+                                     * Type of stored objects. This
+                                     * is a tensor of lower rank.
+                                     */
+    typedef typename Tensor<rank_-1,dim> value_type;
+
+                                    /**
+                                     * Declare an array type which
+                                     * can be used to initialize an
+                                     * object of this type
+                                     * statically.
                                      */
     typedef typename Tensor<rank_-1,dim>::array_type array_type[dim];
 
@@ -229,7 +236,7 @@ Tensor<rank_,dim>::Tensor (const array_type &initializer)
 
 template <int rank_, int dim>
 inline
-Tensor<rank_-1,dim> &
+typename Tensor<rank_,dim>::value_type&
 Tensor<rank_,dim>::operator[] (const unsigned int i)
 {
   Assert (i<dim, ExcIndexRange(i, 0, dim));
@@ -240,7 +247,7 @@ Tensor<rank_,dim>::operator[] (const unsigned int i)
 
 template <int rank_, int dim>
 inline
-const Tensor<rank_-1,dim> &
+const typename Tensor<rank_,dim>::value_type&
 Tensor<rank_,dim>::operator[] (const unsigned int i) const
 {
   Assert (i<dim, ExcIndexRange(i, 0, dim));
index b991d2787caa4fac54ad3a5a4537f44edf0cb41f..07fd1ae0b21bbd7b556647965058b38b932178fe 100644 (file)
@@ -77,6 +77,14 @@ class Tensor<1,dim>
                                      */
     static const unsigned int rank      = 1;
 
+                                    /**
+                                     * Type of stored objects. This
+                                     * is a double for a rank 1 tensor.
+                                     */
+
+    typedef double value_type;
+    
+//TODO:[WB] Do we need this overflow? Maybe there is use for a zero-size Tensor?    
                                     /**
                                      * Declare an array type which can
                                      * be used to initialize statically
@@ -95,7 +103,10 @@ class Tensor<1,dim>
                                      * to zero if @p{initialize==true}; this
                                      * is the default behaviour.
                                      */
-    explicit Tensor (const bool initialize = true);
+#ifndef SUNFORTE    
+    explicit
+#endif    
+    Tensor (const bool initialize = true);
 
                                     /**
                                      * Copy constructor, where the data is

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.