libMesh/libmesh: coverage diff

Base 727f46 Head #4229 6a9aeb
Total Total +/- New
Rate 64.55% 64.54% -0.01% 96.30%
Hits 75863 75863 - 26
Misses 41668 41680 +12 1
Filename Stmts Miss Cover
src/geom/cell_inf_prism.C 0 +7 -5.34%
src/mesh/distributed_mesh.C 0 +2 -0.25%
src/mesh/exodusII_io_helper.C +8 0 +0.04%
src/mesh/mesh_base.C +4 0 +0.06%
src/mesh/mesh_refinement.C 0 +2 -0.29%
src/mesh/mesh_triangle_holes.C 0 +1 -0.27%
TOTAL +12 +12 -0.01%
code
coverage unchanged
code
coverage increased
code
coverage decreased
+
line added or modified

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/distributed_mesh.C

1537  
1538  
1539  
1540  
1541  
1542  
1543  
1544  
1545  
1546  
1547  
1548  
1549  
1550  
                      sender_could_become_owner)
                    {
                      if (it != repartitioned_node_pids.end() &&
                          pid < it->second)
                        it->second = pid;
                      else
                        repartitioned_node_pids[n] = pid;
                    }
                  else
                    if (it == repartitioned_node_pids.end())
                      repartitioned_node_pids[n] =
                        DofObject::invalid_processor_id;

                  repartitioned_node_sets_to_push[pid].insert(n);

src/mesh/exodusII_io_helper.C

307  
308  
309  
310 +
311  
312  
313  
  _single_precision(single_precision)
{
  title.resize(MAX_LINE_LENGTH+1);
  elem_type.resize(libmesh_max_str_length);
  init_element_equivalence_map();
  init_conversion_map();
}
702  
703  
704  
705 +
706  
707  
708  
  // It looks like ExodusII can support 80 chars reliably, so unless
  // we have reason to do otherwise we'll just waste 48 bytes here and
  // there by default.
  int max_name_length_to_set = libmesh_max_str_length;

  if (read_only)
  {
711  
712  
713  
714 +
715  
716 +
717  
718  
719  
720  
721  
722  
723 +
724  
725  
726  
727  
728 +
729 +
730  
731  
732  
    // ExodusII reads truncate to 32-char strings by default; we'd
    // like to support whatever's in the file, so as early as possible
    // let's find out what that is.
    int max_name_length = exII::ex_inquire_int(ex_id, exII::EX_INQ_DB_MAX_USED_NAME_LENGTH);

    libmesh_error_msg_if(max_name_length > MAX_LINE_LENGTH,
                         "Unexpected maximum name length of " <<
                         max_name_length << " in file " << filename <<
                         " exceeds expected " << MAX_LINE_LENGTH);

    // I don't think the 32 here should be necessary, but let's make
    // sure we don't accidentally make things *worse* for anyone.
    max_name_length_to_set = std::max(max_name_length, 32);
  }
  else
    opened_for_writing = true;

  ex_err = exII::ex_set_max_name_length(ex_id, max_name_length_to_set);
  EX_CHECK_ERR(ex_err, "Error setting max ExodusII name length.");

  current_filename = std::string(filename);
}
821  
822  
823  
824 +
825  
826  
827  
        {
          qa_storage[i].resize(4);
          for (auto j : make_range(4))
            qa_storage[i][j].resize(libmesh_max_str_length+1);
        }

      // inner_array_t is a fixed-size array of 4 strings
903  
904  
905  
906 +
907  
908  
909  
  if (n_nodal_attr > 0)
    {
      std::vector<std::vector<char>> attr_name_data
        (n_nodal_attr, std::vector<char>(libmesh_max_str_length + 1));
      std::vector<char *> attr_names(n_nodal_attr);
      for (auto i : index_range(attr_names))
        attr_names[i] = attr_name_data[i].data();
964  
965  
966  
967 +
968  
969  
970  
      std::vector<std::vector<char>> blob_names(n_blobs);
      for (auto i : make_range(n_blobs))
        {
          blob_names[i].resize(libmesh_max_str_length+1);
          blobs[i].name = blob_names[i].data();
        }

1021  
1022  
1023  
1024 +
1025  
1026  
1027  

      int n_blob_vars;
      exII::ex_get_variable_param(ex_id, exII::EX_BLOB, &n_blob_vars);
      std::vector<char> var_name (libmesh_max_str_length + 1);
      for (auto v_id : make_range(1,n_blob_vars+1))
        {
          ex_err = exII::ex_get_variable_name(ex_id, exII::EX_BLOB, v_id, var_name.data());
1968  
1969  
1970  
1971 +
1972  
1973  
1974  
    return;

  // Second read the actual names and convert them into a format we can use
  NamesData names_table(count, libmesh_max_str_length);

  ex_err = exII::ex_get_var_names(ex_id,
                                  var_type,
2054  
2055  
2056  
2057 +
2058  
2059  
2060  
2061  
2062 +
2063  
2064  
2065  

  if (count > 0)
    {
      NamesData names_table(count, libmesh_max_str_length);

      // Store the input names in the format required by Exodus.
      for (int i=0; i != count; ++i)
        {
          if(names[i].length() > libmesh_max_str_length)
            libmesh_warning(
              "*** Warning, Exodus variable name \""
              << names[i] << "\" too long (max " << libmesh_max_str_length
2227  
2228  
2229  
2230 +
2231 +
2232  
2233  
2234  
      // write them, so we can't set a guaranteed max name length here.
      // But it looks like the most ExodusII can support is 80, so we'll
      // just waste 48 bytes here and there.
      ex_err = exII::ex_set_max_name_length(ex_id, libmesh_max_str_length);
      EX_CHECK_ERR(ex_err, "Error setting max ExodusII name length.");

      if (verbose)
        libMesh::out << "File created successfully." << std::endl;
2597  
2598  
2599  
2600 +
2601  
2602  
2603  
2604  
2605  
2606 +
2607  
2608  
2609  
  std::vector<int> num_edges_per_elem_vec;
  std::vector<int> num_faces_per_elem_vec;
  std::vector<int> num_attr_vec;
  NamesData elem_type_table(num_elem_blk, libmesh_max_str_length);

  // Note: It appears that there is a bug in exodusII::ex_put_name where
  // the index returned from the ex_id_lkup is erroneously used.  For now
  // the work around is to use the alternative function ex_put_names, but
  // this function requires a char ** data structure.
  NamesData names_table(num_elem_blk, libmesh_max_str_length);

  num_elem = 0;

2783  
2784  
2785  
2786 +
2787  
2788  
2789  
2790  
2791  
2792  
2793 +
2794  
2795  
2796  
  // be passed to exII::ex_put_concat_all_blocks() at the same time as the
  // information about elem blocks.
  std::vector<int> edge_blk_id;
  NamesData edge_type_table(num_edge_blk, libmesh_max_str_length);
  std::vector<int> num_edge_this_blk_vec;
  std::vector<int> num_nodes_per_edge_vec;
  std::vector<int> num_attr_edge_vec;

  // We also build a data structure of edge block names which can
  // later be passed to exII::ex_put_names().
  NamesData edge_block_names_table(num_edge_blk, libmesh_max_str_length);

  // Note: We are going to use the edge **boundary** ids as **block** ids.
  for (const auto & pr : edge_id_to_conn)
3124  
3125  
3126  
3127 +
3128  
3129  
3130  
  // Write out the sideset names, but only if there is something to write
  if (side_boundary_ids.size() > 0)
    {
      NamesData names_table(side_boundary_ids.size(), libmesh_max_str_length);

      std::vector<exII::ex_set> sets(side_boundary_ids.size());

3205  
3206  
3207  
3208 +
3209  
3210  
3211  
  // Write out the nodeset names, but only if there is something to write
  if (node_boundary_ids.size() > 0)
    {
      NamesData names_table(node_boundary_ids.size(), libmesh_max_str_length);

      // Vectors to be filled and passed to exII::ex_put_concat_sets()
      // Use existing class members and avoid variable shadowing.
3410  
3411  
3412  
3413 +
3414  
3415  
3416  
               [](const std::string & a,
                  const std::string & b) -> bool
               {
                 return a.compare(/*pos=*/0, /*len=*/libmesh_max_str_length, b) == 0;
               });

  if (!match)

src/mesh/mesh_base.C

1846  
1847  
1848  
1849 +
1850  
1851  
1852 +
1853  
1854 +
1855 +
1856  
1857  
1858  
}


void MeshBase::sync_subdomain_name_map()
{
  // This requires every processor
  parallel_object_only();

  this->comm().set_union(_block_id_to_name);
}


void MeshBase::detect_interior_parents()

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