]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid taking reference of non-existant static constexpr variables. 5383/head
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Fri, 3 Nov 2017 15:34:16 +0000 (16:34 +0100)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Fri, 3 Nov 2017 15:34:16 +0000 (16:34 +0100)
tests/matrix_free/fe_evaluation_dofs_per_cell.cc

index 274ca992c2ea314b7856e23d2563c0237e246c68..4e14ff7baf851780603c053396814baa1156672e 100644 (file)
 template <typename FEEval>
 void print_info(const FEEval &eval)
 {
-  deallog << "FEEvaluation::dimension: " << FEEval::dimension << std::endl;
-  deallog << "FEEvaluation::n_components: " << FEEval::n_components << std::endl;
-  deallog << "FEEvaluation::static_n_q_points: " << FEEval::static_n_q_points << std::endl;
-  deallog << "FEEvaluation::static_dofs_per_component: " << FEEval::static_dofs_per_component << std::endl;
-  deallog << "FEEvaluation::tensor_dofs_per_cell: " << FEEval::tensor_dofs_per_cell << std::endl;
-  deallog << "FEEvaluation::static_dofs_per_cell: " << FEEval::static_dofs_per_cell << std::endl;
+  // copy static variables to int to avoid taking references (with possibly
+  // undefined references) when inside deallog::operator<<
+  unsigned int v = FEEval::dimension;
+  deallog << "FEEvaluation::dimension: " << v << std::endl;
+  v = FEEval::n_components;
+  deallog << "FEEvaluation::n_components: " << v << std::endl;
+  v = FEEval::static_n_q_points;
+  deallog << "FEEvaluation::static_n_q_points: " << v << std::endl;
+  v = FEEval::static_dofs_per_component;
+  deallog << "FEEvaluation::static_dofs_per_component: " << v << std::endl;
+  v = FEEval::tensor_dofs_per_cell;
+  deallog << "FEEvaluation::tensor_dofs_per_cell: " << v << std::endl;
+  v = FEEval::static_dofs_per_cell;
+  deallog << "FEEvaluation::static_dofs_per_cell: " << v << std::endl;
   deallog << "FEEvaluation::dofs_per_component: " << eval.dofs_per_component << std::endl;
   deallog << "FEEvaluation::dofs_per_cell: " << eval.dofs_per_cell << std::endl;
   deallog << "FEEvaluation::n_q_points: " << eval.n_q_points << 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.