From: Rene Gassmoeller Date: Tue, 24 Oct 2017 15:40:05 +0000 (-0600) Subject: Fix mapping cartesian X-Git-Tag: v9.0.0-rc1~890^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b8c25d95b2232c0c82b7e8b503e1f6176b625779;p=dealii.git Fix mapping cartesian --- diff --git a/doc/news/changes/minor/20171024ReneGassmoeller b/doc/news/changes/minor/20171024ReneGassmoeller new file mode 100644 index 0000000000..18bb2c1a14 --- /dev/null +++ b/doc/news/changes/minor/20171024ReneGassmoeller @@ -0,0 +1,6 @@ +Fixed: The computation of the inverse jacobians in the +MappingCartesian class was broken. It would trigger an +assertion at runtime complaining that only an assignment +with zero is allowed. This is fixed now. +
+(Rene Gassmoeller, 2017/10/24) diff --git a/source/fe/mapping_cartesian.cc b/source/fe/mapping_cartesian.cc index 9b42228ad2..b6e9ef78d8 100644 --- a/source/fe/mapping_cartesian.cc +++ b/source/fe/mapping_cartesian.cc @@ -420,7 +420,7 @@ fill_fe_values (const typename Triangulation::cell_iterator &cell, { output_data.inverse_jacobians[i] = Tensor<2,dim>(); for (unsigned int j=0; j +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + + +template +void check (const Triangulation &tria) +{ + MappingCartesian mapping; + FE_Q fe(1); + DoFHandler dof_handler (tria); + dof_handler.distribute_dofs (fe); + + QGauss quadrature(1); + + UpdateFlags update_flags = update_quadrature_points | + update_JxW_values | + update_jacobians | + update_jacobian_grads | + update_jacobian_pushed_forward_grads | + update_jacobian_2nd_derivatives | + update_jacobian_pushed_forward_2nd_derivatives | + update_jacobian_3rd_derivatives | + update_jacobian_pushed_forward_3rd_derivatives | + update_inverse_jacobians | + // Transformation dependence + update_covariant_transformation | + update_contravariant_transformation | + update_transformation_values | + update_transformation_gradients | + // Volume data + update_volume_elements; + + FEValues fe_values (mapping, fe, quadrature, + update_flags); + + fe_values.reinit (dof_handler.begin_active()); + + for (unsigned int i=0; i coarse_grid; + GridGenerator::hyper_cube (coarse_grid); + check (coarse_grid); + } + + { + Triangulation<3> coarse_grid; + GridGenerator::hyper_cube (coarse_grid); + check (coarse_grid); + } +} + + + diff --git a/tests/mappings/mapping_cartesian_02.output b/tests/mappings/mapping_cartesian_02.output new file mode 100644 index 0000000000..68b79847e2 --- /dev/null +++ b/tests/mappings/mapping_cartesian_02.output @@ -0,0 +1,10 @@ + +DEAL::1.00000 0.00000 +DEAL::0.00000 1.00000 +DEAL:: +DEAL::OK +DEAL::1.00000 0.00000 0.00000 +DEAL::0.00000 1.00000 0.00000 +DEAL::0.00000 0.00000 1.00000 +DEAL:: +DEAL::OK