]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Simplify tests.
authorWolfgang Bangerth <bangerth@colostate.edu>
Fri, 6 May 2022 16:27:09 +0000 (10:27 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Fri, 6 May 2022 16:27:09 +0000 (10:27 -0600)
tests/grid/reference_cell_type_02.cc
tests/grid/reference_cell_type_03.cc

index ebfd0e8bae3477c7487d69310f28278d206ea83c..867912feda6055c93ad81fda77decfd023b204b4 100644 (file)
 
 #include <deal.II/base/quadrature_lib.h>
 
-#include <deal.II/fe/fe_pyramid_p.h>
-#include <deal.II/fe/fe_q.h>
-#include <deal.II/fe/fe_simplex_p.h>
-#include <deal.II/fe/fe_simplex_p_bubbles.h>
-#include <deal.II/fe/fe_system.h>
+#include <deal.II/fe/fe_nothing.h>
 #include <deal.II/fe/fe_values.h>
-#include <deal.II/fe/fe_wedge_p.h>
 
 #include <deal.II/grid/grid_generator.h>
 #include <deal.II/grid/tria.h>
@@ -56,24 +51,10 @@ test(const ReferenceCell &reference_cell)
   else if (reference_cell == ReferenceCells::Hexahedron)
     q = std::make_unique<QGauss<dim>>(2);
 
-  std::unique_ptr<FiniteElement<dim>> fe;
-  if (reference_cell == ReferenceCells::Line)
-    fe = std::make_unique<FE_Q<dim>>(1);
-  else if (reference_cell == ReferenceCells::Triangle)
-    fe = std::make_unique<FE_SimplexP<dim>>(1);
-  else if (reference_cell == ReferenceCells::Quadrilateral)
-    fe = std::make_unique<FE_Q<dim>>(1);
-  else if (reference_cell == ReferenceCells::Tetrahedron)
-    fe = std::make_unique<FE_SimplexP<dim>>(1);
-  else if (reference_cell == ReferenceCells::Wedge)
-    fe = std::make_unique<FE_WedgeP<dim>>(1);
-  else if (reference_cell == ReferenceCells::Pyramid)
-    fe = std::make_unique<FE_PyramidP<dim>>(1);
-  else if (reference_cell == ReferenceCells::Hexahedron)
-    fe = std::make_unique<FE_Q<dim>>(1);
+  FE_Nothing<dim> fe(reference_cell);
 
   // Set up the objects to compute an integral on the reference cell
-  FEValues<dim> fe_values(*fe, *q, update_JxW_values);
+  FEValues<dim> fe_values(fe, *q, update_JxW_values);
   fe_values.reinit(triangulation.begin_active());
 
   double volume = 0;
index aa821e058717a3fa7392307271e04c773f554406..1b4f3a7f5fbabc52afeb5771ffb5825f40d5980b 100644 (file)
 
 #include <deal.II/base/quadrature_lib.h>
 
-#include <deal.II/fe/fe_pyramid_p.h>
-#include <deal.II/fe/fe_q.h>
-#include <deal.II/fe/fe_simplex_p.h>
-#include <deal.II/fe/fe_simplex_p_bubbles.h>
-#include <deal.II/fe/fe_system.h>
+#include <deal.II/fe/fe_nothing.h>
 #include <deal.II/fe/fe_values.h>
-#include <deal.II/fe/fe_wedge_p.h>
 
 #include <deal.II/grid/grid_generator.h>
 #include <deal.II/grid/tria.h>
@@ -56,26 +51,10 @@ test(const ReferenceCell &reference_cell)
   else if (reference_cell == ReferenceCells::Hexahedron)
     q = std::make_unique<QGauss<dim>>(2);
 
-  std::unique_ptr<FiniteElement<dim>> fe;
-  if (reference_cell == ReferenceCells::Line)
-    fe = std::make_unique<FE_Q<dim>>(1);
-  else if (reference_cell == ReferenceCells::Triangle)
-    fe = std::make_unique<FE_SimplexP<dim>>(1);
-  else if (reference_cell == ReferenceCells::Quadrilateral)
-    fe = std::make_unique<FE_Q<dim>>(1);
-  else if (reference_cell == ReferenceCells::Tetrahedron)
-    fe = std::make_unique<FE_SimplexP<dim>>(1);
-  else if (reference_cell == ReferenceCells::Wedge)
-    fe = std::make_unique<FE_WedgeP<dim>>(1);
-  else if (reference_cell == ReferenceCells::Pyramid)
-    fe = std::make_unique<FE_PyramidP<dim>>(1);
-  else if (reference_cell == ReferenceCells::Hexahedron)
-    fe = std::make_unique<FE_Q<dim>>(1);
+  FE_Nothing<dim> fe(reference_cell);
 
   // Set up the objects to compute an integral on the reference cell
-  FEValues<dim> fe_values(*fe,
-                          *q,
-                          update_JxW_values | update_quadrature_points);
+  FEValues<dim> fe_values(fe, *q, update_JxW_values | update_quadrature_points);
   fe_values.reinit(triangulation.begin_active());
 
   double     volume = 0;

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.