]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix SymmetricTensor::operator[].
authorDavid Wells <wellsd2@rpi.edu>
Sun, 29 May 2016 21:26:36 +0000 (17:26 -0400)
committerDavid Wells <wellsd2@rpi.edu>
Sun, 29 May 2016 21:31:25 +0000 (17:31 -0400)
Like elsewhere this can be defined in terms of operator().

include/deal.II/base/symmetric_tensor.h

index 671a1c330144e836f87cf67e4ad05a00fc3d6c8c..81ce02ab2ed67a7e417f479bf01f81745aa174ff 100644 (file)
@@ -690,13 +690,17 @@ public:
   operator [] (const unsigned int row);
 
   /**
-   * Access to an element where you specify the entire set of indices.
+   * Return an element by value.
+   *
+   * Exactly the same as operator().
    */
   Number
   operator [] (const TableIndices<rank> &indices) const;
 
   /**
-   * Access to an element where you specify the entire set of indices.
+   * Return a read-write reference to the indicated element.
+   *
+   * Exactly the same as operator().
    */
   Number &
   operator [] (const TableIndices<rank> &indices);
@@ -1651,7 +1655,7 @@ inline
 Number
 SymmetricTensor<rank,dim,Number>::operator [] (const TableIndices<rank> &indices) const
 {
-  return data[component_to_unrolled_index(indices)];
+  return operator()(indices);
 }
 
 
@@ -1661,7 +1665,7 @@ inline
 Number &
 SymmetricTensor<rank,dim,Number>::operator [] (const TableIndices<rank> &indices)
 {
-  return data[component_to_unrolled_index(indices)];
+  return operator()(indices);
 }
 
 

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.