From: Markus Buerg Date: Thu, 5 Sep 2013 21:26:45 +0000 (+0000) Subject: Improve conditioning of project_bv_curl_conforming. X-Git-Tag: v8.1.0~877 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=03ddccae6b79091fee848326f9c1af85d920beef;p=dealii.git Improve conditioning of project_bv_curl_conforming. git-svn-id: https://svn.dealii.org/trunk@30613 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/numerics/vector_tools.templates.h b/deal.II/include/deal.II/numerics/vector_tools.templates.h index 6044c92994..8acb1e4eac 100644 --- a/deal.II/include/deal.II/numerics/vector_tools.templates.h +++ b/deal.II/include/deal.II/numerics/vector_tools.templates.h @@ -2787,7 +2787,7 @@ namespace VectorTools std::vector &dof_values, std::vector &dofs_processed) { - const double tol = 0.5 * cell->get_fe ().degree * 1e-13 / cell->face (face)->line (line)->diameter (); + const double tol = 0.5 * cell->face (face)->line (line)->diameter () / cell->get_fe ().degree; const unsigned int dim = 3; const unsigned int spacedim = 3; @@ -2991,6 +2991,7 @@ namespace VectorTools { case 2: { + const double tol = 0.5 * cell->face (face)->diameter () / cell->get_fe ().degree; std::vector > tangentials (fe_values.n_quadrature_points); @@ -3024,18 +3025,18 @@ namespace VectorTools = reference_quadrature_points[q_point]; shifted_reference_point_1 (face_coordinate_direction[face]) - += 1e-13; + += tol; shifted_reference_point_2 (face_coordinate_direction[face]) - -= 1e-13; + -= tol; tangentials[q_point] - = 2e13 - * (fe_values.get_mapping () + = (fe_values.get_mapping () .transform_unit_to_real_cell (cell, shifted_reference_point_1) - fe_values.get_mapping () .transform_unit_to_real_cell (cell, - shifted_reference_point_2)); + shifted_reference_point_2)) + / tol; tangentials[q_point] /= std::sqrt (tangentials[q_point].square ()); // Compute the degrees @@ -3412,15 +3413,13 @@ namespace VectorTools // if the degree of // freedom is not // already constrained. - const double tol = 0.5 * cell->get_fe ().degree * 1e-13 / cell->face (face)->diameter (); - for (unsigned int dof = 0; dof < dofs_per_face; ++dof) if (dofs_processed[dof] && constraints.can_store_line (face_dof_indices[dof]) && !(constraints.is_constrained (face_dof_indices[dof]))) { constraints.add_line (face_dof_indices[dof]); - if (std::abs (dof_values[dof]) > tol) + if (std::abs (dof_values[dof]) > 1e-13) constraints.set_inhomogeneity (face_dof_indices[dof], dof_values[dof]); } } @@ -3507,19 +3506,16 @@ namespace VectorTools // Store the computed // values in the global // vector. - cell->face (face)->get_dof_indices (face_dof_indices, cell->active_fe_index ()); - const double tol = 0.5 * superdegree * 1e-13 / cell->face (face)->diameter (); - for (unsigned int dof = 0; dof < dofs_per_face; ++dof) if (dofs_processed[dof] && constraints.can_store_line (face_dof_indices[dof]) && !(constraints.is_constrained (face_dof_indices[dof]))) { constraints.add_line (face_dof_indices[dof]); - if (std::abs (dof_values[dof]) > tol) + if (std::abs (dof_values[dof]) > 1e-13) constraints.set_inhomogeneity (face_dof_indices[dof], dof_values[dof]); } } @@ -3611,15 +3607,13 @@ namespace VectorTools cell->face (face)->get_dof_indices (face_dof_indices, cell->active_fe_index ()); - const double tol = 0.5 * cell->get_fe ().degree * 1e-13 / cell->face (face)->diameter (); - for (unsigned int dof = 0; dof < dofs_per_face; ++dof) if (dofs_processed[dof] && constraints.can_store_line (face_dof_indices[dof]) && !(constraints.is_constrained (face_dof_indices[dof]))) { constraints.add_line (face_dof_indices[dof]); - if (std::abs (dof_values[dof]) > tol) + if (std::abs (dof_values[dof]) > 1e-13) constraints.set_inhomogeneity (face_dof_indices[dof], dof_values[dof]); } } @@ -3705,15 +3699,13 @@ namespace VectorTools cell->face (face)->get_dof_indices (face_dof_indices, cell->active_fe_index ()); - const double tol = 0.5 * superdegree * 1e-13 / cell->face (face)->diameter (); - for (unsigned int dof = 0; dof < dofs_per_face; ++dof) if (dofs_processed[dof] && constraints.can_store_line (face_dof_indices[dof]) && !(constraints.is_constrained (face_dof_indices[dof]))) { constraints.add_line (face_dof_indices[dof]); - if (std::abs (dof_values[dof]) > tol) + if (std::abs (dof_values[dof]) > 1e-13) constraints.set_inhomogeneity (face_dof_indices[dof], dof_values[dof]); } }