From: Luca Heltai Date: Wed, 24 Jun 2020 12:23:41 +0000 (+0200) Subject: Added test for codim 1 and 2. X-Git-Tag: v9.3.0-rc1~1382^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3dd274d613ebaf3fc09da4ac861becf544c28670;p=dealii.git Added test for codim 1 and 2. --- diff --git a/doc/news/changes/minor/20200624LucaHeltai b/doc/news/changes/minor/20200624LucaHeltai new file mode 100644 index 0000000000..64604c01e8 --- /dev/null +++ b/doc/news/changes/minor/20200624LucaHeltai @@ -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. +
+(Luca Heltai, 2020/06/24) diff --git a/source/dofs/dof_tools_sparsity.inst.in b/source/dofs/dof_tools_sparsity.inst.in index 08475b398c..7b73d8c401 100644 --- a/source/dofs/dof_tools_sparsity.inst.in +++ b/source/dofs/dof_tools_sparsity.inst.in @@ -195,6 +195,19 @@ for (DoFHandler : DOFHANDLER_TEMPLATES; SP : SPARSITY_PATTERNS; #if deal_II_dimension < 3 + template void DoFTools::make_flux_sparsity_pattern< + DoFHandler, + SP>(const DoFHandler &dof, + SP & sparsity); + + template void DoFTools::make_flux_sparsity_pattern< + DoFHandler, + SP>(const DoFHandler &dof, + SP & sparsity, + const Table<2, Coupling> &, + const Table<2, Coupling> &, + const types::subdomain_id); + template void DoFTools::make_sparsity_pattern< DoFHandler, SP>(const DoFHandler &dof_row, @@ -223,6 +236,15 @@ for (DoFHandler : DOFHANDLER_TEMPLATES; SP : SPARSITY_PATTERNS; const std::vector &, SP &); + template void DoFTools::make_flux_sparsity_pattern, SP>( + const DoFHandler<1, 3> &dof, SP &sparsity); + + template void DoFTools::make_flux_sparsity_pattern, SP>( + const DoFHandler<1, 3> &dof, + SP & sparsity, + const Table<2, Coupling> &, + const Table<2, Coupling> &, + const types::subdomain_id); #endif } diff --git a/tests/meshworker/scratch_data_08.cc b/tests/meshworker/scratch_data_08.cc index 31c6df11c9..c78a66a22e 100644 --- a/tests/meshworker/scratch_data_08.cc +++ b/tests/meshworker/scratch_data_08.cc @@ -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>(); } diff --git a/tests/meshworker/scratch_data_08.output b/tests/meshworker/scratch_data_08.output index 200ebcc8cd..5aa9ef9e9d 100644 --- a/tests/meshworker/scratch_data_08.output +++ b/tests/meshworker/scratch_data_08.output @@ -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