From 0c5923aa3dbdbd4bdb22cdce43b35307ed1359cc Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Wed, 4 Feb 2015 15:51:07 +0100 Subject: [PATCH] fixed point_value_history --- source/numerics/point_value_history.cc | 38 ++++++++++++++++++-------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/source/numerics/point_value_history.cc b/source/numerics/point_value_history.cc index 3ed95f6715..7800721187 100644 --- a/source/numerics/point_value_history.cc +++ b/source/numerics/point_value_history.cc @@ -658,9 +658,9 @@ void PointValueHistory { // 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 > dummy_normals (1, Point ()); std::vector > evaluation_points; // at each point there is @@ -691,10 +691,11 @@ void PointValueHistory // 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 > (1, evaluation_points[selected_point]), computed_quantities); @@ -703,9 +704,9 @@ void PointValueHistory else // The case of a vector FE { // Extract data for the PostProcessor object - std::vector< Vector< double > > uh (n_quadrature_points, Vector (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 (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 > dummy_normals (1, Point ()); std::vector > evaluation_points; // at each point there is @@ -735,12 +736,27 @@ void PointValueHistory } } + //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 > (1, evaluation_points[selected_point]), computed_quantities); -- 2.39.5