]> https://gitweb.dealii.org/ - dealii.git/commitdiff
next try to remove compilation warning in tensor_base.h
authorTimo Heister <timo.heister@gmail.com>
Tue, 26 Nov 2013 16:43:06 +0000 (16:43 +0000)
committerTimo Heister <timo.heister@gmail.com>
Tue, 26 Nov 2013 16:43:06 +0000 (16:43 +0000)
git-svn-id: https://svn.dealii.org/trunk@31808 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/base/derivative_form.h

index 1a1f6780b6dabb229ca24a393b0205db3d5e1011..793bdd3ba36b036cca7f20fda915316d9f31db1d 100644 (file)
@@ -206,8 +206,9 @@ operator = (const Tensor<2,dim> &ta)
   Assert( (dim == spacedim) && (order==1),
           ExcMessage("Only allowed for square tensors."));
 
-  for (unsigned int j=0; j<dim; ++j)
-    (*this)[j] = ta[j];
+  if ((dim == spacedim) && (order==1))
+    for (unsigned int j=0; j<dim; ++j)
+      (*this)[j] = ta[j];
   return *this;
 
 }
@@ -274,10 +275,13 @@ DerivativeForm<order, dim, spacedim>::operator Tensor<2,dim>() const
   Assert( (dim == spacedim) && (order==1),
           ExcMessage("Only allowed for square tensors."));
 
+
+
   Tensor<2,dim> t;
 
-  for (unsigned int j=0; j<dim; ++j)
-    t[j] = (*this)[j];
+  if ((dim == spacedim) && (order==1))
+    for (unsigned int j=0; j<dim; ++j)
+      t[j] = (*this)[j];
 
   return t;
 

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.