]> https://gitweb.dealii.org/ - dealii.git/commitdiff
fixed point_value_history
authorDenis Davydov <davydden@gmail.com>
Wed, 4 Feb 2015 14:51:07 +0000 (15:51 +0100)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 8 May 2015 16:19:53 +0000 (11:19 -0500)
source/numerics/point_value_history.cc

index 3ed95f67157bf3b28f309b5b9aa6b294c25a9d41..7800721187ab8d2835cf2b72ecb1e0dce51b8595 100644 (file)
@@ -658,9 +658,9 @@ void PointValueHistory<dim>
         {
           // Extract data for the
           // PostProcessor object
-          std::vector< double > uh (n_quadrature_points, 0.0);
-          std::vector< Tensor< 1, dim > > duh (n_quadrature_points, Tensor <1, dim> ());
-          std::vector< Tensor< 2, dim > > dduh (n_quadrature_points, Tensor <2, dim> ());
+          std::vector< typename VECTOR::value_type > uh (n_quadrature_points, 0.0);
+          std::vector< Tensor< 1, dim, typename VECTOR::value_type > > duh (n_quadrature_points, Tensor <1, dim, typename VECTOR::value_type> ());
+          std::vector< Tensor< 2, dim, typename VECTOR::value_type > > dduh (n_quadrature_points, Tensor <2, dim, typename VECTOR::value_type> ());
           std::vector<Point<dim> > dummy_normals (1, Point<dim> ());
           std::vector<Point<dim> > evaluation_points;
           // at each point there is
@@ -691,10 +691,11 @@ void PointValueHistory<dim>
 
           // Call compute_derived_quantities_vector
           // or compute_derived_quantities_scalar
+          // TODO this function should also operate with typename VECTOR::value_type
           data_postprocessor.
           compute_derived_quantities_scalar(std::vector< double > (1, uh[selected_point]),
-                                            std::vector< Tensor< 1, dim > > (1, duh[selected_point]),
-                                            std::vector< Tensor< 2, dim > > (1, dduh[selected_point]),
+                                            std::vector< Tensor< 1, dim > > (1, Tensor< 1, dim >(duh[selected_point]) ),
+                                            std::vector< Tensor< 2, dim > > (1, Tensor< 2, dim >(dduh[selected_point]) ),
                                             dummy_normals,
                                             std::vector<Point<dim> > (1, evaluation_points[selected_point]),
                                             computed_quantities);
@@ -703,9 +704,9 @@ void PointValueHistory<dim>
       else     // The case of a vector FE
         {
           // Extract data for the PostProcessor object
-          std::vector< Vector< double > > uh (n_quadrature_points, Vector <double> (n_components));
-          std::vector< std::vector< Tensor< 1, dim > > > duh (n_quadrature_points, std::vector< Tensor< 1, dim > > (n_components,  Tensor< 1, dim >()));
-          std::vector< std::vector< Tensor< 2, dim > > > dduh (n_quadrature_points, std::vector< Tensor< 2, dim > > (n_components,  Tensor< 2, dim >()));
+          std::vector< Vector< typename VECTOR::value_type > > uh (n_quadrature_points, Vector <typename VECTOR::value_type> (n_components));
+          std::vector< std::vector< Tensor< 1, dim, typename VECTOR::value_type > > > duh (n_quadrature_points, std::vector< Tensor< 1, dim, typename VECTOR::value_type > > (n_components,  Tensor< 1, dim, typename VECTOR::value_type >()));
+          std::vector< std::vector< Tensor< 2, dim, typename VECTOR::value_type > > > dduh (n_quadrature_points, std::vector< Tensor< 2, dim, typename VECTOR::value_type > > (n_components,  Tensor< 2, dim, typename VECTOR::value_type >()));
           std::vector<Point<dim> > dummy_normals  (1, Point<dim> ());
           std::vector<Point<dim> > evaluation_points;
           // at each point there is
@@ -735,12 +736,27 @@ void PointValueHistory<dim>
                 }
             }
 
+          //FIXME
+          const Vector< typename VECTOR::value_type >                        &uh_s   = uh[selected_point];
+          const std::vector< Tensor< 1, dim, typename VECTOR::value_type > > &duh_s  = duh[selected_point];
+          const std::vector< Tensor< 2, dim, typename VECTOR::value_type > > &dduh_s = dduh[selected_point];
+          std::vector< Tensor< 1, dim > > tmp_d (duh_s.size());
+          for (unsigned int i = 0; i < duh_s.size(); i++)
+            tmp_d[i] = duh_s[i];
+
+          std::vector< Tensor< 2, dim > > tmp_dd (dduh_s.size());
+          for (unsigned int i = 0; i < dduh_s.size(); i++)
+            tmp_dd[i] = dduh_s[i];
+
+          Vector< double > tmp(uh_s.size());
+          for (unsigned int i = 0; i < uh_s.size(); i++)
+            tmp[i] = uh_s[i];
           // Call compute_derived_quantities_vector
           // or compute_derived_quantities_scalar
           data_postprocessor.
-          compute_derived_quantities_vector(std::vector< Vector< double > > (1, uh[selected_point]),
-                                            std::vector< std::vector< Tensor< 1, dim > > > (1, duh[selected_point]),
-                                            std::vector< std::vector< Tensor< 2, dim > > > (1, dduh[selected_point]),
+          compute_derived_quantities_vector(std::vector< Vector< double > > (1, tmp),
+                                            std::vector< std::vector< Tensor< 1, dim > > > (1, tmp_d),
+                                            std::vector< std::vector< Tensor< 2, dim > > > (1, tmp_dd),
                                             dummy_normals,
                                             std::vector<Point<dim> > (1, evaluation_points[selected_point]),
                                             computed_quantities);

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.