libMesh/libmesh: coverage diff

Base 3dc116 Head #4639 9b09f6
Total Total +/- New
Rate 66.55% 66.56% +0.01% 100.00%
Hits 80737 80783 +46 42
Misses 40589 40585 -4 0
Filename Stmts Miss Cover
src/ghosting/ghost_point_neighbors.C +1 0 +0.50%
src/mesh/distributed_mesh.C 0 -2 +0.24%
src/mesh/mesh_base.C +15 -1 +0.22%
src/mesh/mesh_triangle_holes.C 0 -1 +0.28%
src/mesh/unstructured_mesh.C +26 0 +0.48%
TOTAL +42 -4 +0.01%
code
coverage unchanged
code
coverage increased
code
coverage decreased
+
line added or modified

src/ghosting/ghost_point_neighbors.C

195  
196  
197  
198 +
199  
200  
201  
              unsigned int neigh_side = invalid_uint;
              const Elem * neigh =
#ifdef LIBMESH_ENABLE_UNIQUE_ID
                  _mesh->has_disjoint_neighbor_node_keys() ? elem->neighbor_ptr(s) :
#endif
                  db->neighbor(id, *point_locator, elem, s, &neigh_side);

src/mesh/distributed_mesh.C

1617  
1618  
1619  
1620  
1621  
1622  
1623  
1624  
1625  
1626  
1627  
1628  
1629  
1630  
                      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/mesh_base.C

802  
803  
804  
805  
806  
807  
808  
    if (entry == name)
      return true;

  return false;
}


2508  
2509  
2510  
2511 +
2512  
2513 +
2514 +
2515 +
2516  
2517 +
2518  
2519 +
2520  
2521  
2522 +
2523  
2524 +
2525  
2526 +
2527  
2528 +
2529 +
2530  
2531 +
2532  
2533  
2534 +
2535  
2536 +
2537  
2538 +
2539  
2540  
2541  
const std::string disjoint_neighbor_node_key_name = "disjoint_neighbor_node_key";
}

void MeshBase::add_disjoint_neighbor_node_keys()
{
  constexpr unique_id_type no_key = DofObject::invalid_unique_id;
  this->add_node_datum<unique_id_type>(disjoint_neighbor_node_key_name, true, &no_key);
}

bool MeshBase::has_disjoint_neighbor_node_keys() const
{
  return this->has_node_integer(disjoint_neighbor_node_key_name);
}

unique_id_type MeshBase::disjoint_neighbor_node_key(const Node & node) const
{
  if (this->has_disjoint_neighbor_node_keys())
    {
      const auto key = node.get_extra_datum<unique_id_type>(
        this->get_node_integer_index(disjoint_neighbor_node_key_name));
      if (key != DofObject::invalid_unique_id)
        return key;
    }
  return node.unique_id();
}

void MeshBase::set_disjoint_neighbor_node_key(Node & node, const unique_id_type key) const
{
  node.set_extra_datum<unique_id_type>(
    this->get_node_integer_index(disjoint_neighbor_node_key_name), key);
}
#endif // LIBMESH_ENABLE_UNIQUE_ID


2669  
2670  
2671  
2672  
2673  
2674  
2675  
        return false;
      if (!other_elem->topologically_equal(*elem))
        return false;
    }
  for (const auto & elem : this->element_ptr_range())
    if (!other_mesh.query_elem_ptr(elem->id()))
      return false;

src/mesh/mesh_triangle_holes.C

276  
277  
278  
279  
280  
281  
282  
    {
      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/mesh/unstructured_mesh.C

1135  
1136  
1137  
1138 +
1139  
1140  
1141  
1142  
1143  
1144 +
1145 +
1146  
1147  
1148  
1149 +
1150 +
1151  
1152 +
1153 +
1154  
1155 +
1156 +
1157  
1158 +
1159 +
1160 +
1161 +
1162 +
1163 +
1164  
1165 +
1166  
1167 +
1168 +
1169  
1170 +
1171 +
1172 +
1173 +
1174  
1175 +
1176 +
1177  
1178  
1179  
1180  
1181 +
1182  
1183  
1184 +
1185  
1186  
1187  
  auto * db = this->get_disjoint_neighbor_boundary_pairs();

#ifdef LIBMESH_ENABLE_UNIQUE_ID
  if (db && this->has_disjoint_neighbor_node_keys())
    {
      // Match sides across disjoint neighbor boundary pairs by their
      // sorted vertex keys. The keys are independent of the node
      // coordinates, so this gives the same neighbors on a deformed mesh.
      typedef std::tuple<Elem *, unsigned int, boundary_id_type> side_type;
      std::map<std::vector<unique_id_type>, std::vector<side_type>> key_to_sides;
      std::vector<boundary_id_type> side_bcids;

      // Key every disjoint side, including sides with a neighbor, so
      // that a side without a neighbor always finds its paired side.
      for (const auto & element : this->element_ptr_range())
        for (auto ms : element->side_index_range())
          {
            this->get_boundary_info().boundary_ids(element, ms, side_bcids);
            for (const auto bcid : side_bcids)
              {
                if (!db->boundary(bcid))
                  continue;

                std::vector<unique_id_type> key;
                for (const auto n : element->nodes_on_side(ms))
                  if (element->is_vertex(n))
                    key.push_back(this->disjoint_neighbor_node_key(element->node_ref(n)));
                std::sort(key.begin(), key.end());
                key_to_sides[std::move(key)].emplace_back(element, ms, bcid);
              }
          }

      for (const auto & [_, sides] : key_to_sides)
        for (const auto & [elem, s, bcid] : sides)
          {
            const boundary_id_type paired_bcid = db->boundary(bcid)->pairedboundary;
            Elem * neigh = nullptr;
            for (const auto & [candidate, cs, candidate_bcid] : sides)
              if (candidate != elem && candidate_bcid == paired_bcid)
                {
                  neigh = candidate;
                  break;
                }

            // A local element must have its disjoint neighbor at least
            // ghosted. A ghost element may have a remote one.
            libmesh_error_msg_if(!neigh && (this->is_serial() ||
                                            elem->processor_id() == this->processor_id()),
                                 "Disjoint neighbor not found");
            elem->set_neighbor(s, neigh ? neigh : const_cast<RemoteElem *>(remote_elem));
          }
    }
  else