]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Added test for codim 1 and 2. 10588/head
authorLuca Heltai <luca.heltai@sissa.it>
Wed, 24 Jun 2020 12:23:41 +0000 (14:23 +0200)
committerLuca Heltai <luca.heltai@sissa.it>
Wed, 24 Jun 2020 12:23:41 +0000 (14:23 +0200)
doc/news/changes/minor/20200624LucaHeltai [new file with mode: 0644]
source/dofs/dof_tools_sparsity.inst.in
tests/meshworker/scratch_data_08.cc
tests/meshworker/scratch_data_08.output

diff --git a/doc/news/changes/minor/20200624LucaHeltai b/doc/news/changes/minor/20200624LucaHeltai
new file mode 100644 (file)
index 0000000..64604c0
--- /dev/null
@@ -0,0 +1,4 @@
+Fixed: FEInterfaceValues now works also for codim one and two. Instantiated
+also DoFTools::make_flux_sparsity_pattern() for codim one and two.
+<br>
+(Luca Heltai, 2020/06/24)
index 08475b398c025aeecb2c3199c16bf4bda0a7c290..7b73d8c401b13a50f8387782b6521fdde163d458 100644 (file)
@@ -195,6 +195,19 @@ for (DoFHandler : DOFHANDLER_TEMPLATES; SP : SPARSITY_PATTERNS;
 
 #if deal_II_dimension < 3
 
+    template void DoFTools::make_flux_sparsity_pattern<
+      DoFHandler<deal_II_dimension, deal_II_dimension + 1>,
+      SP>(const DoFHandler<deal_II_dimension, deal_II_dimension + 1> &dof,
+          SP &                                                        sparsity);
+
+    template void DoFTools::make_flux_sparsity_pattern<
+      DoFHandler<deal_II_dimension, deal_II_dimension + 1>,
+      SP>(const DoFHandler<deal_II_dimension, deal_II_dimension + 1> &dof,
+          SP &                                                        sparsity,
+          const Table<2, Coupling> &,
+          const Table<2, Coupling> &,
+          const types::subdomain_id);
+
     template void DoFTools::make_sparsity_pattern<
       DoFHandler<deal_II_dimension, deal_II_dimension + 1>,
       SP>(const DoFHandler<deal_II_dimension, deal_II_dimension + 1> &dof_row,
@@ -223,6 +236,15 @@ for (DoFHandler : DOFHANDLER_TEMPLATES; SP : SPARSITY_PATTERNS;
       const std::vector<types::global_dof_index> &,
       SP &);
 
+    template void DoFTools::make_flux_sparsity_pattern<DoFHandler<1, 3>, SP>(
+      const DoFHandler<1, 3> &dof, SP &sparsity);
+
+    template void DoFTools::make_flux_sparsity_pattern<DoFHandler<1, 3>, SP>(
+      const DoFHandler<1, 3> &dof,
+      SP &                    sparsity,
+      const Table<2, Coupling> &,
+      const Table<2, Coupling> &,
+      const types::subdomain_id);
 #endif
   }
 
index 31c6df11c92b5ec4377053f7bef106ff15884813..c78a66a22ef8d13a8abab260d3e4e698e056f7b5 100644 (file)
@@ -66,7 +66,7 @@ test()
   constraints.close();
 
   GridGenerator::hyper_cube(tria);
-  tria.refine_global(5);
+  tria.refine_global(3);
   tria.execute_coarsening_and_refinement();
   dh.distribute_dofs(fe);
 
@@ -161,6 +161,8 @@ test()
     const auto &p   = s.get_quadrature_points();
     const auto &n   = s.get_normal_vectors();
 
+    const double gh = gamma / cell->diameter();
+
     for (unsigned int q = 0; q < p.size(); ++q)
       for (unsigned int i = 0; i < fev.dofs_per_cell; ++i)
         {
@@ -169,13 +171,11 @@ test()
               c.cell_matrix(i, j) +=
                 (-fev.shape_grad(i, q) * n[q] * fev.shape_value(j, q) +
                  -fev.shape_grad(j, q) * n[q] * fev.shape_value(i, q) +
-                 gamma / cell->face(f)->diameter() * fev.shape_value(i, q) *
-                   fev.shape_value(j, q)) *
+                 gh * fev.shape_value(i, q) * fev.shape_value(j, q)) *
                 JxW[q];
             }
           c.cell_rhs(i) +=
-            ((gamma / cell->face(f)->diameter() * fev.shape_value(i, q) -
-              fev.shape_grad(i, q) * n[q]) *
+            ((gh * fev.shape_value(i, q) - fev.shape_grad(i, q) * n[q]) *
              boundary_function.value(p[q])) *
             JxW[q];
         }
@@ -203,7 +203,7 @@ test()
     const auto n_dofs                = fev.n_current_interface_dofs();
     face_matrix.reinit(n_dofs, n_dofs);
 
-    const double gh = gamma / cell->face(f)->diameter();
+    const double gh = gamma / cell->diameter();
 
     for (unsigned int q = 0; q < p.size(); ++q)
       for (unsigned int i = 0; i < n_dofs; ++i)
@@ -253,5 +253,10 @@ int
 main()
 {
   initlog();
+  test<1, 1>();
+  test<1, 2>();
+  test<1, 3>();
   test<2, 2>();
+  test<2, 3>();
+  test<3, 3>();
 }
index 200ebcc8cd84702958880ce8c4899b65853e3c9b..5aa9ef9e9d6c223b49cd9c6ecd3aa711e5d47992 100644 (file)
@@ -1,2 +1,7 @@
 
-DEAL::Linfty norm of solution 0.0736360
+DEAL::Linfty norm of solution 0.124375
+DEAL::Linfty norm of solution 0.124375
+DEAL::Linfty norm of solution 0.124375
+DEAL::Linfty norm of solution 0.0740767
+DEAL::Linfty norm of solution 0.0740767
+DEAL::Linfty norm of solution 0.0571119

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.