libMesh/libmesh: coverage diff

Base 034308 Head #4270 874c3a
Total Total +/- New
Rate 64.96% 64.95% -0.01% 100.00%
Hits 76814 76808 -6 9
Misses 41432 41441 +9 0
Filename Stmts Miss Cover
src/mesh/mesh_refinement.C 0 -3 +0.44%
src/mesh/mesh_tools.C +3 +12 -1.01%
TOTAL +3 +9 -0.01%
code
coverage unchanged
code
coverage increased
code
coverage decreased
+
line added or modified

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 &&
1303  
1304  
1305  
1306  
1307  
1308  
1309  
                                        compatible_with_coarsening = false;
                                      }
                                    if (subneighbor.p_level() == my_p_level &&
                                        subneighbor.p_refinement_flag() == Elem::COARSEN)
                                      {
                                        subneighbor.set_p_refinement_flag(Elem::DO_NOTHING);
                                        level_one_satisfied = false;

src/mesh/mesh_tools.C

350  
351  
352  
353 +
354  
355  
356  
                }
            }

          const auto elem_order = Elem::type_to_default_order_map[elem->type()];

          // Index of the current edge
          unsigned current_edge = 0;
376  
377  
378  
379 +
380 +
381 +
382 +
383  
384 +
385  
386  
387 +
388  
389  
390 +
391  
392 +
393  
394  
395  
                  // Find another node in this element on this edge
                  for (unsigned other_node_this_edge = 0; other_node_this_edge != n_nodes; other_node_this_edge++)
                    {
                      const bool both_vertices = elem->is_vertex(local_node_number) &&
                                                 elem->is_vertex(other_node_this_edge);
                      if ( elem->is_node_on_edge(other_node_this_edge, current_edge) && // On the current edge
                           elem->node_id(other_node_this_edge) != global_id          && // But not the original node
                            // vertex nodes on the same edge of higher order elements are not nodal neighbors
                          (elem_order == 1 || !both_vertices))
                        {
                          // We've found a nodal neighbor!  Save a pointer to it..
                          node_to_save = elem->node_ptr(other_node_this_edge);

                          // Make sure we found something
                          libmesh_assert(node_to_save != nullptr);

                          neighbor_set.insert(node_to_save);
                        }
                    }
                }
475  
476  
477  
478  
479  
480  
481  
482  
483  
484  
485  
486  
487  
488  
489  
490  
491  
492  
493  
494  
495  
496  
497  
498  



void build_nodes_to_elem_map (const MeshBase & mesh,
                              std::vector<std::vector<const Elem *>> & nodes_to_elem_map)
{
  // A vector indexed over all nodes is too inefficient to use for a
  // distributed mesh.  Use the unordered_map API instead.
  if (!mesh.is_serial())
    libmesh_deprecated();

  nodes_to_elem_map.resize (mesh.max_node_id());

  for (const auto & elem : mesh.element_ptr_range())
    for (auto & node : elem->node_ref_range())
      {
        libmesh_assert_less (node.id(), nodes_to_elem_map.size());

        nodes_to_elem_map[node.id()].push_back(elem);
      }
}



1040  
1041  
1042  
1043  
1044  
1045  
1046  
1047  
1048  
1049  
1050  
1051  
1052  
1053  



void find_nodal_neighbors(const MeshBase &,
                          const Node & node,
                          const std::vector<std::vector<const Elem *>> & nodes_to_elem_map,
                          std::vector<const Node *> & neighbors)
{
  find_nodal_neighbors_helper(node.id(), nodes_to_elem_map[node.id()],
                              neighbors);
}