]> https://gitweb.dealii.org/ - dealii.git/commitdiff
fixing derivative approximation
authorDenis Davydov <davydden@gmail.com>
Tue, 3 Feb 2015 10:44:49 +0000 (11:44 +0100)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 8 May 2015 16:19:52 +0000 (11:19 -0500)
source/numerics/derivative_approximation.cc

index 231f5d0ab60d3f2f37d3670da470cb920dda1590..05c97a418a5623002deb1350dbed3bbad522cfc2 100644 (file)
@@ -133,14 +133,14 @@ namespace DerivativeApproximation
     {
       if (fe_values.get_fe().n_components() == 1)
         {
-          std::vector<ProjectedDerivative> values (1);
+          std::vector<typename InputVector::value_type> values (1);
           fe_values.get_function_values (solution, values);
           return values[0];
         }
       else
         {
-          std::vector<Vector<double> > values
-          (1, Vector<double>(fe_values.get_fe().n_components()));
+          std::vector<Vector<typename InputVector::value_type> > values
+          (1, Vector<typename InputVector::value_type>(fe_values.get_fe().n_components()));
           fe_values.get_function_values (solution, values);
           return values[0](component);
         }
@@ -249,16 +249,16 @@ namespace DerivativeApproximation
     {
       if (fe_values.get_fe().n_components() == 1)
         {
-          std::vector<ProjectedDerivative> values (1);
+          std::vector<Tensor<1,dim,typename InputVector::value_type>> values (1);
           fe_values.get_function_gradients (solution, values);
-          return values[0];
+          return ProjectedDerivative(values[0]);
         }
       else
         {
-          std::vector<std::vector<ProjectedDerivative> > values
-          (1, std::vector<ProjectedDerivative>(fe_values.get_fe().n_components()));
+          std::vector<std::vector<Tensor<1,dim,typename InputVector::value_type>> > values
+          (1, std::vector<Tensor<1,dim,typename InputVector::value_type>>(fe_values.get_fe().n_components()));
           fe_values.get_function_gradients (solution, values);
-          return values[0][component];
+          return ProjectedDerivative(values[0][component]);
         };
     }
 
@@ -592,16 +592,16 @@ namespace DerivativeApproximation
     {
       if (fe_values.get_fe().n_components() == 1)
         {
-          std::vector<ProjectedDerivative> values (1);
+          std::vector<Tensor<2,dim,typename InputVector::value_type>> values (1);
           fe_values.get_function_hessians (solution, values);
-          return values[0];
+          return ProjectedDerivative(values[0]);
         }
       else
         {
-          std::vector<std::vector<ProjectedDerivative> > values
-          (1, std::vector<ProjectedDerivative>(fe_values.get_fe().n_components()));
+          std::vector<std::vector<Tensor<2,dim,typename InputVector::value_type>> > values
+          (1, std::vector<Tensor<2,dim,typename InputVector::value_type>>(fe_values.get_fe().n_components()));
           fe_values.get_function_hessians (solution, values);
-          return values[0][component];
+          return ProjectedDerivative(values[0][component]);
         };
     }
 

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.