libMesh/libmesh: coverage diff

Base 03bcc7 Head #4286 66ff4b
Total Total +/- New
Rate 65.03% 65.04% +0.01% 33.33%
Hits 76915 76907 -8 9
Misses 41361 41346 -15 18
Filename Stmts Miss Cover
include/base/libmesh_exceptions.h +2 +2 -1.79%
src/fe/fe_map.C -25 -27 +3.08%
src/geom/cell_inf_prism.C 0 +7 -5.34%
src/mesh/mesh_refinement.C 0 +2 -0.29%
src/mesh/mesh_triangle_holes.C 0 +1 -0.27%
TOTAL -23 -15 +0.01%
code
coverage unchanged
code
coverage increased
code
coverage decreased
+
line added or modified

include/base/libmesh_exceptions.h

77  
78  
79  
80 +
81 +
82  
83  
84  
class DegenerateMapping : public std::runtime_error
{
public:
  DegenerateMapping(std::string msg="") :
    std::runtime_error( "Problem with mapping or its Jacobian.\n" + msg ) {}
};


src/fe/fe_map.C

465  
466  
467  
468 +
469 +
470 +
471  
472  
473  
474  
475  
476 +
477  
478 +
479 +
480 +
481 +
482  
483 +
484  
485  
486  
    libmesh_assert_equal_to(phi_map.size(), elem_nodes.size());

  auto check_for_degenerate_map =
    [this, elem, p]
    (Real det_J) {
    if (det_J <= jacobian_tolerance)
      {
        // Don't call get_info() recursively if we're already
        // failing.  get_info() calls Elem::volume() which may
        // call FE::reinit() and trigger the same failure again.
        static bool failing = false;
        if (!failing)
          {
            failing = true;
            std::string elem_info = elem->get_info();
            failing = false;
            if (calculate_xyz)
              {
                libmesh_degenerate_mapping_msg
                  ("Jacobian " << jac[p] << " under tolerance " <<
                   jacobian_tolerance << " at point " << xyz[p] <<
                   " in element: " << elem_info);
489  
490  
491  
492 +
493  
494  
495  
              {
                // In this case xyz[p] is not defined, so don't
                // try to print it out.
                libmesh_degenerate_mapping_msg
                  ("Jacobian " << jac[p] << " under tolerance " <<
                   jacobian_tolerance << " at point index " << p <<
                   " in element: " << elem_info);
500  
501  
502  
503 +
504  
505  
506 +
507  
508  
509  
            // We were already failing when we called this, so just
            // stop the current computation and return with
            // incomplete results.
            return;
          }
      }
  };

  switch (dim)
    {
580  
581  
582  
583 +
584  
585  
586  
          {
            jac[p] = dxyzdxi_map[p].norm();

            check_for_degenerate_map(jac[p]);

            // The inverse Jacobian entries also come from the
            // generalized inverse of T (see also the 2D element
851  
852  
853  
854 +
855  
856  
857  

            const Real det = (g11*g22 - g12*g21);

            check_for_degenerate_map(det);

            const Real inv_det = 1./det;
            jac[p] = std::sqrt(det);
1047  
1048  
1049  
1050 +
1051  
1052  
1053  
                      dy_dxi*(dz_deta*dx_dzeta - dx_deta*dz_dzeta)  +
                      dz_dxi*(dx_deta*dy_dzeta - dy_deta*dx_dzeta));

            check_for_degenerate_map(jac[p]);

            JxW[p] = jac[p]*qw[p];

1614  
1615  
1616  
1617 +
1618 +
1619  
1620  
1621  
            //  G = [J]^T [J]
            const Real G = dxi*dxi;

            if (secure && G <= 0)
              libmesh_degenerate_mapping_msg
                ("inverse_map found a singular Jacobian " <<
                 " at master point " << p << " in element " <<
                 elem->id());
1670  
1671  
1672  
1673 +
1674 +
1675  
1676  
1677  

            const Real det = (G11*G22 - G12*G21);

            if (secure && det == 0)
              libmesh_degenerate_mapping_msg
                ("inverse_map found a singular Jacobian " <<
                 " at master point " << p << " in element " <<
                 elem->id());
1757  
1758  
1759  
1760 +
1761  
1762  
1763  
                // case we can just return a far away point.
                if (secure)
                  {
                    libmesh_degenerate_mapping_msg(
                      "inverse_map found a singular Jacobian" <<
                      " at master point " << p << " in element " <<
                      elem->id());
1848  
1849  
1850  
1851 +
1852  
1853  
1854  
                  // "Jacobian becomes singular or negative" sense,
                  // it's at least degenerate in the "straightforward
                  // Newton is failing to invert it" sense.
                  libmesh_degenerate_mapping_msg(
                    "inverse_map Newton FAILED to converge in " <<
                    cnt << " iterations in element " << elem->id() <<
                    " for physical point = " << physical_point <<

src/geom/cell_inf_prism.C

303  
304  
305  
306  
307  
308  
309  
310  
311  
312  
313  
314  
315  
316  
317  
318  
319  
320  
321  
322  
  // this captures the case that the point is not (almost) in the direction of the element.:
  // first, project the problem onto the unit sphere:
  Point p_o(p - my_origin);
  pt0_o /= pt0_o.norm();
  pt1_o /= pt1_o.norm();
  pt2_o /= pt2_o.norm();
  p_o /= p_o.norm();

  // now, check if it is in the projected face; by comparing the distance of
  // any point in the element to \p p with the largest distance between this point
  // to any other point in the element.
  if ((p_o - pt0_o).norm_sq() > std::max((pt0_o - pt1_o).norm_sq(), (pt0_o - pt2_o).norm_sq()) ||
      (p_o - pt1_o).norm_sq() > std::max((pt1_o - pt2_o).norm_sq(), (pt1_o - pt0_o).norm_sq()) ||
      (p_o - pt2_o).norm_sq() > std::max((pt2_o - pt0_o).norm_sq(), (pt2_o - pt1_o).norm_sq()) )
    {
      // the physical point is definitely not contained in the element
      return false;
    }


src/mesh/mesh_refinement.C

1272  
1273  
1274  
1275  
1276  
1277  
1278  
1279  
                              if (neighbor->p_level() < my_p_level &&
                                  neighbor->p_refinement_flag() != Elem::REFINE)
                                {
                                  neighbor->set_p_refinement_flag(Elem::REFINE);
                                  level_one_satisfied = false;
                                  compatible_with_coarsening = false;
                                }
                              if (neighbor->p_level() == my_p_level &&

src/mesh/mesh_triangle_holes.C

270  
271  
272  
273  
274  
275  
276  
    {
      ray_target = inside - Point(1);
      intersection_distances =
        this->find_ray_intersections(inside, ray_target);
    }

  // I'd make this an assert, but I'm not 100% confident we can't

src/reduced_basis/rb_eim_construction.C

539  
540  
541  
542 +
543  
544  
545  

          libMesh::out << "Maximum EIM error is " << greedy_error << std::endl << std::endl;
        }
      libmesh_catch (const std::exception & e)
        {
          // If we hit an exception when performing the enrichment for the error indicator, then
          // we just continue and skip the error indicator. Otherwise we rethrow the exception.
950  
951  
952  
953 +
954  
955  
956  

              update_eim_matrices(/*set_error_indicator*/ exit_on_next_iteration);
            }
          libmesh_catch (const std::exception & e)
            {
              // If we hit an exception when performing the enrichment for the error indicator, then
              // we just continue and skip the error indicator. Otherwise we rethrow the exception.
1031  
1032  
1033  
1034 +
1035  
1036  
1037  

              update_eim_matrices(/*set_error_indicator*/ exit_on_next_iteration);
            }
          libmesh_catch (const std::exception & e)
            {
              // If we hit an exception when performing the enrichment for the error indicator, then
              // we just continue and skip the error indicator. Otherwise we rethrow the exception.
1112  
1113  
1114  
1115 +
1116  
1117  
1118  

              update_eim_matrices(/*set_error_indicator*/ exit_on_next_iteration);
            }
          libmesh_catch (const std::exception & e)
            {
              // If we hit an exception when performing the enrichment for the error indicator, then
              // we just continue and skip the error indicator. Otherwise we rethrow the exception.