]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Replace make_2_cells() with TestGrids::hyper_line(). 15037/head
authorMarc Fehling <mafehling.git@gmail.com>
Wed, 5 Apr 2023 22:16:28 +0000 (16:16 -0600)
committerMarc Fehling <mafehling.git@gmail.com>
Wed, 5 Apr 2023 22:16:28 +0000 (16:16 -0600)
tests/feinterface/fe_interface_values_01.cc
tests/feinterface/fe_interface_values_02.cc
tests/feinterface/fe_interface_values_03.cc
tests/feinterface/fe_interface_values_05.cc
tests/feinterface/fe_interface_values_06.cc
tests/feinterface/fe_interface_values_07.cc
tests/feinterface/fe_interface_values_08.cc
tests/feinterface/fe_interface_values_09.cc
tests/feinterface/fe_interface_values_11.cc
tests/feinterface/fe_interface_values_12.cc
tests/feinterface/multigrid_01.cc

index bdf39551260d463cce2d57a6310f6154f63262ca..b47a7afd6b0a0693e78bbc77f315432bd3a01439 100644 (file)
@@ -22,7 +22,6 @@
 #include <deal.II/fe/fe_interface_values.h>
 #include <deal.II/fe/mapping_q.h>
 
-#include <deal.II/grid/grid_generator.h>
 #include <deal.II/grid/grid_refinement.h>
 #include <deal.II/grid/tria.h>
 
@@ -31,6 +30,8 @@
 
 #include "../tests.h"
 
+#include "../test_grids.h"
+
 
 template <int dim>
 void
@@ -67,41 +68,13 @@ inspect_fiv(FEInterfaceValues<dim> &fiv)
 }
 
 
-template <int dim>
-void
-make_2_cells(Triangulation<dim> &tria);
-
-template <>
-void
-make_2_cells<2>(Triangulation<2> &tria)
-{
-  const unsigned int        dim         = 2;
-  std::vector<unsigned int> repetitions = {2, 1};
-  Point<dim>                p1;
-  Point<dim>                p2(2.0, 1.0);
-
-  GridGenerator::subdivided_hyper_rectangle(tria, repetitions, p1, p2);
-}
-
-template <>
-void
-make_2_cells<3>(Triangulation<3> &tria)
-{
-  const unsigned int        dim         = 3;
-  std::vector<unsigned int> repetitions = {2, 1, 1};
-  Point<dim>                p1;
-  Point<dim>                p2(2.0, 1.0, 1.0);
-
-  GridGenerator::subdivided_hyper_rectangle(tria, repetitions, p1, p2);
-}
-
 
 template <int dim>
 void
 test()
 {
   Triangulation<dim> tria;
-  make_2_cells(tria);
+  TestGrids::hyper_line(tria, 2);
 
   DoFHandler<dim> dofh(tria);
   FE_DGQ<dim>     fe(1);
index 1b692eaad9e429aabbcd880944f334c64f8666b2..4053459863bf57cb800764bd74d3dfb4e9372185 100644 (file)
@@ -23,7 +23,6 @@
 #include <deal.II/fe/fe_interface_values.h>
 #include <deal.II/fe/mapping_q.h>
 
-#include <deal.II/grid/grid_generator.h>
 #include <deal.II/grid/grid_refinement.h>
 #include <deal.II/grid/tria.h>
 
 
 #include "../tests.h"
 
-template <int dim>
-void
-make_2_cells(Triangulation<dim> &tria);
-
-template <>
-void
-make_2_cells<2>(Triangulation<2> &tria)
-{
-  const unsigned int        dim         = 2;
-  std::vector<unsigned int> repetitions = {2, 1};
-  Point<dim>                p1;
-  Point<dim>                p2(2.0, 1.0);
-
-  GridGenerator::subdivided_hyper_rectangle(tria, repetitions, p1, p2);
-}
-
-template <>
-void
-make_2_cells<3>(Triangulation<3> &tria)
-{
-  const unsigned int        dim         = 3;
-  std::vector<unsigned int> repetitions = {2, 1, 1};
-  Point<dim>                p1;
-  Point<dim>                p2(2.0, 1.0, 1.0);
-
-  GridGenerator::subdivided_hyper_rectangle(tria, repetitions, p1, p2);
-}
+#include "../test_grids.h"
 
 
 template <int dim>
@@ -66,7 +39,7 @@ void
 test(unsigned int fe_degree)
 {
   Triangulation<dim> tria;
-  make_2_cells(tria);
+  TestGrids::hyper_line(tria, 2);
 
   DoFHandler<dim> dofh(tria);
   FE_DGQ<dim>     fe(fe_degree);
index 72c082cd4e419e57590144c5179fb89324a659e4..512ad391dfd6ee4d9f8d1d8dad6f571faf2bfc22 100644 (file)
@@ -23,7 +23,6 @@
 #include <deal.II/fe/fe_interface_values.h>
 #include <deal.II/fe/mapping_q.h>
 
-#include <deal.II/grid/grid_generator.h>
 #include <deal.II/grid/grid_refinement.h>
 #include <deal.II/grid/tria.h>
 
 
 #include "../tests.h"
 
-template <int dim>
-void
-make_2_cells(Triangulation<dim> &tria);
-
-template <>
-void
-make_2_cells<2>(Triangulation<2> &tria)
-{
-  const unsigned int        dim         = 2;
-  std::vector<unsigned int> repetitions = {2, 1};
-  Point<dim>                p1;
-  Point<dim>                p2(2.0, 1.0);
-
-  GridGenerator::subdivided_hyper_rectangle(tria, repetitions, p1, p2);
-}
-
-template <>
-void
-make_2_cells<3>(Triangulation<3> &tria)
-{
-  const unsigned int        dim         = 3;
-  std::vector<unsigned int> repetitions = {2, 1, 1};
-  Point<dim>                p1;
-  Point<dim>                p2(2.0, 1.0, 1.0);
-
-  GridGenerator::subdivided_hyper_rectangle(tria, repetitions, p1, p2);
-}
+#include "../test_grids.h"
 
 
 template <int dim>
@@ -66,7 +39,8 @@ void
 test(unsigned int fe_degree)
 {
   Triangulation<dim> tria;
-  make_2_cells(tria);
+  TestGrids::hyper_line(tria, 2);
+
   tria.begin()->set_refine_flag();
   tria.execute_coarsening_and_refinement();
 
index 251cb86316a0e764a64aafcc1a484f07aa55abea..48c1727c8ccb0223930062c725fed32fb76591d3 100644 (file)
@@ -22,7 +22,6 @@
 #include <deal.II/fe/fe_q.h>
 #include <deal.II/fe/mapping_q.h>
 
-#include <deal.II/grid/grid_generator.h>
 #include <deal.II/grid/grid_refinement.h>
 #include <deal.II/grid/tria.h>
 
@@ -31,6 +30,8 @@
 
 #include "../tests.h"
 
+#include "../test_grids.h"
+
 
 template <int dim>
 void
@@ -67,41 +68,13 @@ inspect_fiv(FEInterfaceValues<dim> &fiv)
 }
 
 
-template <int dim>
-void
-make_2_cells(Triangulation<dim> &tria);
-
-template <>
-void
-make_2_cells<2>(Triangulation<2> &tria)
-{
-  const unsigned int        dim         = 2;
-  std::vector<unsigned int> repetitions = {2, 1};
-  Point<dim>                p1;
-  Point<dim>                p2(2.0, 1.0);
-
-  GridGenerator::subdivided_hyper_rectangle(tria, repetitions, p1, p2);
-}
-
-template <>
-void
-make_2_cells<3>(Triangulation<3> &tria)
-{
-  const unsigned int        dim         = 3;
-  std::vector<unsigned int> repetitions = {2, 1, 1};
-  Point<dim>                p1;
-  Point<dim>                p2(2.0, 1.0, 1.0);
-
-  GridGenerator::subdivided_hyper_rectangle(tria, repetitions, p1, p2);
-}
-
 
 template <int dim>
 void
 test()
 {
   Triangulation<dim> tria;
-  make_2_cells(tria);
+  TestGrids::hyper_line(tria, 2);
 
   DoFHandler<dim> dofh(tria);
   FE_Q<dim>       fe(1);
index fe47f3552ed6868db7f53279287e80564bc9145a..2bd3a9966e8496c905b872b892831f8eb1cdb4ec 100644 (file)
@@ -24,7 +24,6 @@
 #include <deal.II/fe/fe_q.h>
 #include <deal.II/fe/mapping_q.h>
 
-#include <deal.II/grid/grid_generator.h>
 #include <deal.II/grid/grid_refinement.h>
 #include <deal.II/grid/tria.h>
 
 
 #include "../tests.h"
 
-template <int dim>
-void
-make_2_cells(Triangulation<dim> &tria);
-
-template <>
-void
-make_2_cells<2>(Triangulation<2> &tria)
-{
-  const unsigned int        dim         = 2;
-  std::vector<unsigned int> repetitions = {2, 1};
-  Point<dim>                p1;
-  Point<dim>                p2(2.0, 1.0);
-
-  GridGenerator::subdivided_hyper_rectangle(tria, repetitions, p1, p2);
-}
-
-template <>
-void
-make_2_cells<3>(Triangulation<3> &tria)
-{
-  const unsigned int        dim         = 3;
-  std::vector<unsigned int> repetitions = {2, 1, 1};
-  Point<dim>                p1;
-  Point<dim>                p2(2.0, 1.0, 1.0);
-
-  GridGenerator::subdivided_hyper_rectangle(tria, repetitions, p1, p2);
-}
+#include "../test_grids.h"
 
 
 template <int dim>
@@ -67,7 +40,8 @@ void
 test(unsigned int fe_degree)
 {
   Triangulation<dim> tria;
-  make_2_cells(tria);
+  TestGrids::hyper_line(tria, 2);
+
   tria.begin()->set_refine_flag();
   tria.execute_coarsening_and_refinement();
 
index e58d2edbabe4e1cb0208c0059d6c68f21768c3ea..5be13683d9032710166f55c17ecf0efcfa536561 100644 (file)
@@ -24,7 +24,6 @@
 #include <deal.II/fe/fe_q.h>
 #include <deal.II/fe/mapping_q.h>
 
-#include <deal.II/grid/grid_generator.h>
 #include <deal.II/grid/grid_refinement.h>
 #include <deal.II/grid/tria.h>
 
 
 #include "../tests.h"
 
-template <int dim>
-void
-make_2_cells(Triangulation<dim> &tria);
-
-template <>
-void
-make_2_cells<2>(Triangulation<2> &tria)
-{
-  const unsigned int        dim         = 2;
-  std::vector<unsigned int> repetitions = {2, 1};
-  Point<dim>                p1;
-  Point<dim>                p2(2.0, 1.0);
-
-  GridGenerator::subdivided_hyper_rectangle(tria, repetitions, p1, p2);
-}
-
-template <>
-void
-make_2_cells<3>(Triangulation<3> &tria)
-{
-  const unsigned int        dim         = 3;
-  std::vector<unsigned int> repetitions = {2, 1, 1};
-  Point<dim>                p1;
-  Point<dim>                p2(2.0, 1.0, 1.0);
-
-  GridGenerator::subdivided_hyper_rectangle(tria, repetitions, p1, p2);
-}
+#include "../test_grids.h"
 
 
 template <int dim>
@@ -67,7 +40,7 @@ void
 test(unsigned int fe_degree)
 {
   Triangulation<dim> tria;
-  make_2_cells(tria);
+  TestGrids::hyper_line(tria, 2);
 
   DoFHandler<dim> dofh(tria);
   FE_Q<dim>       fe(fe_degree);
index 987f1ad5e0777a9225a052796708289af33fe459..c082dafbd51409f56ef24947cf1e102bddd3d0a6 100644 (file)
@@ -24,7 +24,6 @@
 #include <deal.II/fe/fe_q.h>
 #include <deal.II/fe/mapping_q.h>
 
-#include <deal.II/grid/grid_generator.h>
 #include <deal.II/grid/grid_refinement.h>
 #include <deal.II/grid/tria.h>
 
 
 #include "../tests.h"
 
-template <int dim>
-void
-make_2_cells(Triangulation<dim> &tria);
-
-template <>
-void
-make_2_cells<2>(Triangulation<2> &tria)
-{
-  const unsigned int        dim         = 2;
-  std::vector<unsigned int> repetitions = {2, 1};
-  Point<dim>                p1;
-  Point<dim>                p2(2.0, 1.0);
-
-  GridGenerator::subdivided_hyper_rectangle(tria, repetitions, p1, p2);
-}
-
-template <>
-void
-make_2_cells<3>(Triangulation<3> &tria)
-{
-  const unsigned int        dim         = 3;
-  std::vector<unsigned int> repetitions = {2, 1, 1};
-  Point<dim>                p1;
-  Point<dim>                p2(2.0, 1.0, 1.0);
-
-  GridGenerator::subdivided_hyper_rectangle(tria, repetitions, p1, p2);
-}
+#include "../test_grids.h"
 
 
 template <int dim>
@@ -67,7 +40,7 @@ void
 test(const FiniteElement<dim> &fe)
 {
   Triangulation<dim> tria;
-  make_2_cells(tria);
+  TestGrids::hyper_line(tria, 2);
 
   DoFHandler<dim> dofh(tria);
   deallog << fe.get_name() << std::endl;
index 528c42e0552def5c6385f0b462b3c39462ab1d41..89062b2e78fa13e3ff294fa4ba1963ce7035fd46 100644 (file)
@@ -23,7 +23,6 @@
 #include <deal.II/fe/fe_q.h>
 #include <deal.II/fe/mapping_q.h>
 
-#include <deal.II/grid/grid_generator.h>
 #include <deal.II/grid/grid_refinement.h>
 #include <deal.II/grid/tria.h>
 
 
 #include "../tests.h"
 
-template <int dim>
-void
-make_2_cells(Triangulation<dim> &tria);
-
-
-
-template <>
-void
-make_2_cells<2>(Triangulation<2> &tria)
-{
-  const unsigned int        dim         = 2;
-  std::vector<unsigned int> repetitions = {2, 1};
-  Point<dim>                p1;
-  Point<dim>                p2(2.0, 1.0);
-
-  GridGenerator::subdivided_hyper_rectangle(tria, repetitions, p1, p2);
-}
-
-
-
-template <>
-void
-make_2_cells<3>(Triangulation<3> &tria)
-{
-  const unsigned int        dim         = 3;
-  std::vector<unsigned int> repetitions = {2, 1, 1};
-  Point<dim>                p1;
-  Point<dim>                p2(2.0, 1.0, 1.0);
-
-  GridGenerator::subdivided_hyper_rectangle(tria, repetitions, p1, p2);
-}
+#include "../test_grids.h"
 
 
 
@@ -96,7 +65,7 @@ void
 test(const FiniteElement<dim> &fe)
 {
   Triangulation<dim> tria;
-  make_2_cells(tria);
+  TestGrids::hyper_line(tria, 2);
 
   DoFHandler<dim> dofh(tria);
   deallog << fe.get_name() << std::endl;
index 52b09de88c28a1c9b785972dd079cd051b65e9b6..fb6c170963d649f2d5fdfa6ac93a92d171380480 100644 (file)
@@ -22,7 +22,6 @@
 #include <deal.II/fe/fe_interface_values.h>
 #include <deal.II/fe/mapping_q.h>
 
-#include <deal.II/grid/grid_generator.h>
 #include <deal.II/grid/grid_refinement.h>
 #include <deal.II/grid/tria.h>
 
@@ -34,6 +33,8 @@
 
 #include "../tests.h"
 
+#include "../test_grids.h"
+
 
 template <int dim>
 void
@@ -69,41 +70,13 @@ inspect_fiv(FEInterfaceValues<dim> &fiv)
 }
 
 
-template <int dim>
-void
-make_2_cells(Triangulation<dim> &tria);
-
-template <>
-void
-make_2_cells<2>(Triangulation<2> &tria)
-{
-  const unsigned int        dim         = 2;
-  std::vector<unsigned int> repetitions = {2, 1};
-  Point<dim>                p1;
-  Point<dim>                p2(2.0, 1.0);
-
-  GridGenerator::subdivided_hyper_rectangle(tria, repetitions, p1, p2);
-}
-
-template <>
-void
-make_2_cells<3>(Triangulation<3> &tria)
-{
-  const unsigned int        dim         = 3;
-  std::vector<unsigned int> repetitions = {2, 1, 1};
-  Point<dim>                p1;
-  Point<dim>                p2(2.0, 1.0, 1.0);
-
-  GridGenerator::subdivided_hyper_rectangle(tria, repetitions, p1, p2);
-}
-
 
 template <int dim>
 void
 test(const unsigned int p)
 {
   Triangulation<dim> tria;
-  make_2_cells(tria);
+  TestGrids::hyper_line(tria, 2);
 
   DoFHandler<dim>          dofh(tria);
   hp::FECollection<dim>    fe_collection;
index e32d1f0a22072a4ee918d9dff52f9eb0e5fbb667..0b38aef4504093c42d6921f14d85b735bf475894 100644 (file)
@@ -23,7 +23,6 @@
 #include <deal.II/fe/fe_interface_values.h>
 #include <deal.II/fe/mapping_q.h>
 
-#include <deal.II/grid/grid_generator.h>
 #include <deal.II/grid/grid_refinement.h>
 #include <deal.II/grid/tria.h>
 
 
 #include "../tests.h"
 
-template <int dim>
-void
-make_2_cells(Triangulation<dim> &tria);
-
-template <>
-void
-make_2_cells<2>(Triangulation<2> &tria)
-{
-  const unsigned int        dim         = 2;
-  std::vector<unsigned int> repetitions = {2, 1};
-  Point<dim>                p1;
-  Point<dim>                p2(2.0, 1.0);
-
-  GridGenerator::subdivided_hyper_rectangle(tria, repetitions, p1, p2);
-}
-
-template <>
-void
-make_2_cells<3>(Triangulation<3> &tria)
-{
-  const unsigned int        dim         = 3;
-  std::vector<unsigned int> repetitions = {2, 1, 1};
-  Point<dim>                p1;
-  Point<dim>                p2(2.0, 1.0, 1.0);
-
-  GridGenerator::subdivided_hyper_rectangle(tria, repetitions, p1, p2);
-}
+#include "../test_grids.h"
 
 
 template <int dim>
@@ -66,7 +39,7 @@ void
 test(const unsigned int fe_degree0, const unsigned int fe_degree1 = 0)
 {
   Triangulation<dim> tria;
-  make_2_cells(tria);
+  TestGrids::hyper_line(tria, 2);
 
   tria.begin()->set_refine_flag();
   tria.execute_coarsening_and_refinement();
index 00b1fbf8b0e16a678fe17250f6c8ef5128307992..57edc09ec0a6e3031d4432b85c5ec409fcd78dc8 100644 (file)
@@ -22,7 +22,6 @@
 #include <deal.II/fe/fe_interface_values.h>
 #include <deal.II/fe/mapping_q.h>
 
-#include <deal.II/grid/grid_generator.h>
 #include <deal.II/grid/grid_refinement.h>
 #include <deal.II/grid/tria.h>
 
@@ -31,6 +30,8 @@
 
 #include "../tests.h"
 
+#include "../test_grids.h"
+
 
 template <int dim>
 void
@@ -66,27 +67,6 @@ inspect_fiv(FEInterfaceValues<dim> &fiv)
   deallog << std::endl;
 }
 
-void
-make_2_cells(Triangulation<2> &tria)
-{
-  const unsigned int        dim         = 2;
-  std::vector<unsigned int> repetitions = {2, 1};
-  Point<dim>                p1;
-  Point<dim>                p2(2.0, 1.0);
-
-  GridGenerator::subdivided_hyper_rectangle(tria, repetitions, p1, p2);
-}
-
-void
-make_2_cells(Triangulation<3> &tria)
-{
-  const unsigned int        dim         = 3;
-  std::vector<unsigned int> repetitions = {2, 1, 1};
-  Point<dim>                p1;
-  Point<dim>                p2(2.0, 1.0, 1.0);
-
-  GridGenerator::subdivided_hyper_rectangle(tria, repetitions, p1, p2);
-}
 
 
 template <int dim>
@@ -95,7 +75,7 @@ test()
 {
   Triangulation<dim> tria(
     Triangulation<dim>::limit_level_difference_at_vertices);
-  make_2_cells(tria);
+  TestGrids::hyper_line(tria, 2);
   tria.refine_global();
 
 

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.