]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Also adjust tests.
authorWolfgang Bangerth <bangerth@colostate.edu>
Fri, 23 Apr 2021 20:33:46 +0000 (14:33 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Fri, 23 Apr 2021 22:39:10 +0000 (16:39 -0600)
tests/fe/fe_values_view_get_function_from_local_dof_values_01.cc
tests/fe/fe_values_view_get_function_from_local_dof_values_02.cc
tests/fe/fe_values_views_types.cc

index 150c2d8a5c5258f49106c2443121fbb71def43c5..d678c09855f8052b9cfad2770497fc7a6c4675c7 100644 (file)
@@ -59,7 +59,6 @@ test_view(const Vector<double> &            solution,
   const View &fe_values_view = fe_values[extractor];
 
   // Typedefs
-  using OutputType = typename View::template OutputType<NumberType>;
   using value_type =
     typename ProductType<typename View::value_type, NumberType>::type;
   using gradient_type =
@@ -73,36 +72,41 @@ test_view(const Vector<double> &            solution,
                          NumberType>::type;
 
   // Values
-  std::vector<typename OutputType::value_type> qp_values_local(n_q_points);
-  std::vector<value_type>                      qp_values_global(n_q_points);
+  std::vector<typename View::template solution_value_type<NumberType>>
+                          qp_values_local(n_q_points);
+  std::vector<value_type> qp_values_global(n_q_points);
   fe_values_view.get_function_values_from_local_dof_values(local_dof_values,
                                                            qp_values_local);
   fe_values_view.get_function_values(solution, qp_values_global);
 
   // Gradients
-  std::vector<typename OutputType::gradient_type> qp_grads_local(n_q_points);
-  std::vector<gradient_type>                      qp_grads_global(n_q_points);
+  std::vector<typename View::template solution_gradient_type<NumberType>>
+                             qp_grads_local(n_q_points);
+  std::vector<gradient_type> qp_grads_global(n_q_points);
   fe_values_view.get_function_gradients_from_local_dof_values(local_dof_values,
                                                               qp_grads_local);
   fe_values_view.get_function_gradients(solution, qp_grads_global);
 
   // Hessians
-  std::vector<typename OutputType::hessian_type> qp_hess_local(n_q_points);
-  std::vector<hessian_type>                      qp_hess_global(n_q_points);
+  std::vector<typename View::template solution_hessian_type<NumberType>>
+                            qp_hess_local(n_q_points);
+  std::vector<hessian_type> qp_hess_global(n_q_points);
   fe_values_view.get_function_hessians_from_local_dof_values(local_dof_values,
                                                              qp_hess_local);
   fe_values_view.get_function_hessians(solution, qp_hess_global);
 
   // Laplacians
-  std::vector<typename OutputType::laplacian_type> qp_laplace_local(n_q_points);
+  std::vector<typename View::template solution_laplacian_type<NumberType>>
+                              qp_laplace_local(n_q_points);
   std::vector<laplacian_type> qp_laplace_global(n_q_points);
   fe_values_view.get_function_laplacians_from_local_dof_values(
     local_dof_values, qp_laplace_local);
   fe_values_view.get_function_laplacians(solution, qp_laplace_global);
 
   // Third derivatives
-  std::vector<typename OutputType::third_derivative_type> qp_third_deriv_local(
-    n_q_points);
+  std::vector<
+    typename View::template solution_third_derivative_type<NumberType>>
+                                     qp_third_deriv_local(n_q_points);
   std::vector<third_derivative_type> qp_third_deriv_global(n_q_points);
   fe_values_view.get_function_third_derivatives_from_local_dof_values(
     local_dof_values, qp_third_deriv_local);
@@ -145,7 +149,6 @@ test_view(const Vector<double> &            solution,
   const View &fe_values_view = fe_values[extractor];
 
   // Typedefs
-  using OutputType = typename View::template OutputType<NumberType>;
   using value_type =
     typename ProductType<typename View::value_type, NumberType>::type;
   using gradient_type =
@@ -166,22 +169,25 @@ test_view(const Vector<double> &            solution,
                          NumberType>::type;
 
   // Values
-  std::vector<typename OutputType::value_type> qp_values_local(n_q_points);
-  std::vector<value_type>                      qp_values_global(n_q_points);
+  std::vector<typename View::template solution_value_type<NumberType>>
+                          qp_values_local(n_q_points);
+  std::vector<value_type> qp_values_global(n_q_points);
   fe_values_view.get_function_values_from_local_dof_values(local_dof_values,
                                                            qp_values_local);
   fe_values_view.get_function_values(solution, qp_values_global);
 
   // Gradients
-  std::vector<typename OutputType::gradient_type> qp_grads_local(n_q_points);
-  std::vector<gradient_type>                      qp_grads_global(n_q_points);
+  std::vector<typename View::template solution_gradient_type<NumberType>>
+                             qp_grads_local(n_q_points);
+  std::vector<gradient_type> qp_grads_global(n_q_points);
   fe_values_view.get_function_gradients_from_local_dof_values(local_dof_values,
                                                               qp_grads_local);
   fe_values_view.get_function_gradients(solution, qp_grads_global);
 
   // Symmetric gradients
-  std::vector<typename OutputType::symmetric_gradient_type> qp_symm_grads_local(
-    n_q_points);
+  std::vector<
+    typename View::template solution_symmetric_gradient_type<NumberType>>
+                                       qp_symm_grads_local(n_q_points);
   std::vector<symmetric_gradient_type> qp_symm_grads_global(n_q_points);
   fe_values_view.get_function_symmetric_gradients_from_local_dof_values(
     local_dof_values, qp_symm_grads_local);
@@ -189,36 +195,41 @@ test_view(const Vector<double> &            solution,
                                                   qp_symm_grads_global);
 
   // Divergences
-  std::vector<typename OutputType::divergence_type> qp_divs_local(n_q_points);
-  std::vector<divergence_type>                      qp_divs_global(n_q_points);
+  std::vector<typename View::template solution_divergence_type<NumberType>>
+                               qp_divs_local(n_q_points);
+  std::vector<divergence_type> qp_divs_global(n_q_points);
   fe_values_view.get_function_divergences_from_local_dof_values(
     local_dof_values, qp_divs_local);
   fe_values_view.get_function_divergences(solution, qp_divs_global);
 
   // Curls
-  std::vector<typename OutputType::curl_type> qp_curls_local(n_q_points);
-  std::vector<curl_type>                      qp_curls_global(n_q_points);
+  std::vector<typename View::template solution_curl_type<NumberType>>
+                         qp_curls_local(n_q_points);
+  std::vector<curl_type> qp_curls_global(n_q_points);
   fe_values_view.get_function_curls_from_local_dof_values(local_dof_values,
                                                           qp_curls_local);
   fe_values_view.get_function_curls(solution, qp_curls_global);
 
   // Hessians
-  std::vector<typename OutputType::hessian_type> qp_hess_local(n_q_points);
-  std::vector<hessian_type>                      qp_hess_global(n_q_points);
+  std::vector<typename View::template solution_hessian_type<NumberType>>
+                            qp_hess_local(n_q_points);
+  std::vector<hessian_type> qp_hess_global(n_q_points);
   fe_values_view.get_function_hessians_from_local_dof_values(local_dof_values,
                                                              qp_hess_local);
   fe_values_view.get_function_hessians(solution, qp_hess_global);
 
   // Laplacians
-  std::vector<typename OutputType::laplacian_type> qp_laplace_local(n_q_points);
+  std::vector<typename View::template solution_laplacian_type<NumberType>>
+                              qp_laplace_local(n_q_points);
   std::vector<laplacian_type> qp_laplace_global(n_q_points);
   fe_values_view.get_function_laplacians_from_local_dof_values(
     local_dof_values, qp_laplace_local);
   fe_values_view.get_function_laplacians(solution, qp_laplace_global);
 
   // Third derivatives
-  std::vector<typename OutputType::third_derivative_type> qp_third_deriv_local(
-    n_q_points);
+  std::vector<
+    typename View::template solution_third_derivative_type<NumberType>>
+                                     qp_third_deriv_local(n_q_points);
   std::vector<third_derivative_type> qp_third_deriv_global(n_q_points);
   fe_values_view.get_function_third_derivatives_from_local_dof_values(
     local_dof_values, qp_third_deriv_local);
@@ -275,22 +286,23 @@ test_view(const Vector<double> &                        solution,
   const View &fe_values_view = fe_values[extractor];
 
   // Typedefs
-  using OutputType = typename View::template OutputType<NumberType>;
   using value_type =
     typename ProductType<typename View::value_type, NumberType>::type;
   using divergence_type =
     typename ProductType<typename View::divergence_type, NumberType>::type;
 
   // Values
-  std::vector<typename OutputType::value_type> qp_values_local(n_q_points);
-  std::vector<value_type>                      qp_values_global(n_q_points);
+  std::vector<typename View::template solution_value_type<NumberType>>
+                          qp_values_local(n_q_points);
+  std::vector<value_type> qp_values_global(n_q_points);
   fe_values_view.get_function_values_from_local_dof_values(local_dof_values,
                                                            qp_values_local);
   fe_values_view.get_function_values(solution, qp_values_global);
 
   // Divergences
-  std::vector<typename OutputType::divergence_type> qp_divs_local(n_q_points);
-  std::vector<divergence_type>                      qp_divs_global(n_q_points);
+  std::vector<typename View::template solution_divergence_type<NumberType>>
+                               qp_divs_local(n_q_points);
+  std::vector<divergence_type> qp_divs_global(n_q_points);
   fe_values_view.get_function_divergences_from_local_dof_values(
     local_dof_values, qp_divs_local);
   fe_values_view.get_function_divergences(solution, qp_divs_global);
@@ -321,7 +333,6 @@ test_view(const Vector<double> &               solution,
   const View &fe_values_view = fe_values[extractor];
 
   // Typedefs
-  using OutputType = typename View::template OutputType<NumberType>;
   using value_type =
     typename ProductType<typename View::value_type, NumberType>::type;
   using gradient_type =
@@ -330,22 +341,25 @@ test_view(const Vector<double> &               solution,
     typename ProductType<typename View::divergence_type, NumberType>::type;
 
   // Values
-  std::vector<typename OutputType::value_type> qp_values_local(n_q_points);
-  std::vector<value_type>                      qp_values_global(n_q_points);
+  std::vector<typename View::template solution_value_type<NumberType>>
+                          qp_values_local(n_q_points);
+  std::vector<value_type> qp_values_global(n_q_points);
   fe_values_view.get_function_values_from_local_dof_values(local_dof_values,
                                                            qp_values_local);
   fe_values_view.get_function_values(solution, qp_values_global);
 
   // Divergences
-  std::vector<typename OutputType::divergence_type> qp_divs_local(n_q_points);
-  std::vector<divergence_type>                      qp_divs_global(n_q_points);
+  std::vector<typename View::template solution_divergence_type<NumberType>>
+                               qp_divs_local(n_q_points);
+  std::vector<divergence_type> qp_divs_global(n_q_points);
   fe_values_view.get_function_divergences_from_local_dof_values(
     local_dof_values, qp_divs_local);
   fe_values_view.get_function_divergences(solution, qp_divs_global);
 
   // Gradients
-  std::vector<typename OutputType::gradient_type> qp_grads_local(n_q_points);
-  std::vector<gradient_type>                      qp_grads_global(n_q_points);
+  std::vector<typename View::template solution_gradient_type<NumberType>>
+                             qp_grads_local(n_q_points);
+  std::vector<gradient_type> qp_grads_global(n_q_points);
   fe_values_view.get_function_gradients_from_local_dof_values(local_dof_values,
                                                               qp_grads_local);
   fe_values_view.get_function_gradients(solution, qp_grads_global);
index 5045af2f7986af5fa36f9c64cf5cbd691b8c4b96..c4364d36cbc0e14496de712988ac83abc2f7b6a4 100644 (file)
@@ -65,31 +65,34 @@ test_view(const Vector<double> &            solution,
   const View &fe_values_view = fe_values[extractor];
 
   // Typedefs
-  using OutputType = typename View::template OutputType<NumberType>;
-
   // Values
-  std::vector<typename OutputType::value_type> qp_values_local(n_q_points);
+  std::vector<typename View::template solution_value_type<NumberType>>
+    qp_values_local(n_q_points);
   fe_values_view.get_function_values_from_local_dof_values(local_dof_values,
                                                            qp_values_local);
 
   // Gradients
-  std::vector<typename OutputType::gradient_type> qp_grads_local(n_q_points);
+  std::vector<typename View::template solution_gradient_type<NumberType>>
+    qp_grads_local(n_q_points);
   fe_values_view.get_function_gradients_from_local_dof_values(local_dof_values,
                                                               qp_grads_local);
 
   // Hessians
-  std::vector<typename OutputType::hessian_type> qp_hess_local(n_q_points);
+  std::vector<typename View::template solution_hessian_type<NumberType>>
+    qp_hess_local(n_q_points);
   fe_values_view.get_function_hessians_from_local_dof_values(local_dof_values,
                                                              qp_hess_local);
 
   // Laplacians
-  std::vector<typename OutputType::laplacian_type> qp_laplace_local(n_q_points);
+  std::vector<typename View::template solution_laplacian_type<NumberType>>
+    qp_laplace_local(n_q_points);
   fe_values_view.get_function_laplacians_from_local_dof_values(
     local_dof_values, qp_laplace_local);
 
   // Third derivatives
-  std::vector<typename OutputType::third_derivative_type> qp_third_deriv_local(
-    n_q_points);
+  std::vector<
+    typename View::template solution_third_derivative_type<NumberType>>
+    qp_third_deriv_local(n_q_points);
   fe_values_view.get_function_third_derivatives_from_local_dof_values(
     local_dof_values, qp_third_deriv_local);
 }
@@ -108,47 +111,53 @@ test_view(const Vector<double> &            solution,
   const View &fe_values_view = fe_values[extractor];
 
   // Typedefs
-  using OutputType = typename View::template OutputType<NumberType>;
-
   // Values
-  std::vector<typename OutputType::value_type> qp_values_local(n_q_points);
+  std::vector<typename View::template solution_value_type<NumberType>>
+    qp_values_local(n_q_points);
   fe_values_view.get_function_values_from_local_dof_values(local_dof_values,
                                                            qp_values_local);
 
   // Gradients
-  std::vector<typename OutputType::gradient_type> qp_grads_local(n_q_points);
+  std::vector<typename View::template solution_gradient_type<NumberType>>
+    qp_grads_local(n_q_points);
   fe_values_view.get_function_gradients_from_local_dof_values(local_dof_values,
                                                               qp_grads_local);
 
   // Symmetric gradients
-  std::vector<typename OutputType::symmetric_gradient_type> qp_symm_grads_local(
-    n_q_points);
+  std::vector<
+    typename View::template solution_symmetric_gradient_type<NumberType>>
+    qp_symm_grads_local(n_q_points);
   fe_values_view.get_function_symmetric_gradients_from_local_dof_values(
     local_dof_values, qp_symm_grads_local);
 
   // Divergences
-  std::vector<typename OutputType::divergence_type> qp_divs_local(n_q_points);
+  std::vector<typename View::template solution_divergence_type<NumberType>>
+    qp_divs_local(n_q_points);
   fe_values_view.get_function_divergences_from_local_dof_values(
     local_dof_values, qp_divs_local);
 
   // Curls
-  std::vector<typename OutputType::curl_type> qp_curls_local(n_q_points);
+  std::vector<typename View::template solution_curl_type<NumberType>>
+    qp_curls_local(n_q_points);
   fe_values_view.get_function_curls_from_local_dof_values(local_dof_values,
                                                           qp_curls_local);
 
   // Hessians
-  std::vector<typename OutputType::hessian_type> qp_hess_local(n_q_points);
+  std::vector<typename View::template solution_hessian_type<NumberType>>
+    qp_hess_local(n_q_points);
   fe_values_view.get_function_hessians_from_local_dof_values(local_dof_values,
                                                              qp_hess_local);
 
   // Laplacians
-  std::vector<typename OutputType::laplacian_type> qp_laplace_local(n_q_points);
+  std::vector<typename View::template solution_laplacian_type<NumberType>>
+    qp_laplace_local(n_q_points);
   fe_values_view.get_function_laplacians_from_local_dof_values(
     local_dof_values, qp_laplace_local);
 
   // Third derivatives
-  std::vector<typename OutputType::third_derivative_type> qp_third_deriv_local(
-    n_q_points);
+  std::vector<
+    typename View::template solution_third_derivative_type<NumberType>>
+    qp_third_deriv_local(n_q_points);
   fe_values_view.get_function_third_derivatives_from_local_dof_values(
     local_dof_values, qp_third_deriv_local);
 }
@@ -167,19 +176,20 @@ test_view(const Vector<double> &                        solution,
   const View &fe_values_view = fe_values[extractor];
 
   // Typedefs
-  using OutputType = typename View::template OutputType<NumberType>;
   using value_type =
     typename ProductType<typename View::value_type, NumberType>::type;
   using divergence_type =
     typename ProductType<typename View::divergence_type, NumberType>::type;
 
   // Values
-  std::vector<typename OutputType::value_type> qp_values_local(n_q_points);
+  std::vector<typename View::template solution_value_type<NumberType>>
+    qp_values_local(n_q_points);
   fe_values_view.get_function_values_from_local_dof_values(local_dof_values,
                                                            qp_values_local);
 
   // Divergences
-  std::vector<typename OutputType::divergence_type> qp_divs_local(n_q_points);
+  std::vector<typename View::template solution_divergence_type<NumberType>>
+    qp_divs_local(n_q_points);
   fe_values_view.get_function_divergences_from_local_dof_values(
     local_dof_values, qp_divs_local);
 }
@@ -198,7 +208,6 @@ test_view(const Vector<double> &               solution,
   const View &fe_values_view = fe_values[extractor];
 
   // Typedefs
-  using OutputType = typename View::template OutputType<NumberType>;
   using value_type =
     typename ProductType<typename View::value_type, NumberType>::type;
   using gradient_type =
@@ -207,17 +216,20 @@ test_view(const Vector<double> &               solution,
     typename ProductType<typename View::divergence_type, NumberType>::type;
 
   // Values
-  std::vector<typename OutputType::value_type> qp_values_local(n_q_points);
+  std::vector<typename View::template solution_value_type<NumberType>>
+    qp_values_local(n_q_points);
   fe_values_view.get_function_values_from_local_dof_values(local_dof_values,
                                                            qp_values_local);
 
   // Divergences
-  std::vector<typename OutputType::divergence_type> qp_divs_local(n_q_points);
+  std::vector<typename View::template solution_divergence_type<NumberType>>
+    qp_divs_local(n_q_points);
   fe_values_view.get_function_divergences_from_local_dof_values(
     local_dof_values, qp_divs_local);
 
   // Gradients
-  std::vector<typename OutputType::gradient_type> qp_grads_local(n_q_points);
+  std::vector<typename View::template solution_gradient_type<NumberType>>
+    qp_grads_local(n_q_points);
   fe_values_view.get_function_gradients_from_local_dof_values(local_dof_values,
                                                               qp_grads_local);
 }
index e6f573900a24f98c3b42098a1bfce358dbe341bf..b63d71d1e523a6860232f4f6328febc5949aa66e 100644 (file)
@@ -25,11 +25,13 @@ template <int dim, int spacedim, typename Extractor>
 void
 test(const Extractor &)
 {
-  typename FEValuesViews::View<dim, spacedim, Extractor>::template OutputType<
-    double>::value_type t1;
+  typename FEValuesViews::View<dim, spacedim, Extractor>::
+    template solution_value_type<double>
+      t1;
 
-  typename FEValuesViews::View<dim, spacedim, Extractor>::template OutputType<
-    double>::gradient_type t2;
+  typename FEValuesViews::View<dim, spacedim, Extractor>::
+    template solution_gradient_type<double>
+      t2;
 
   deallog << "Test<" << Utilities::dim_string(dim, spacedim) << ">" << std::endl
           << Utilities::type_to_string(t1) << std::endl

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.