| Base 862243 | Head #4484 f791cd | ||||
|---|---|---|---|---|---|
| Total | Total | +/- | New | ||
| Rate | 65.60% | 65.61% | +0.01% | 100.00% | |
| Hits | 78626 | 78651 | +25 | 20 | |
| Misses | 41235 | 41234 | -1 | 0 | |
| Filename | Stmts | Miss | Cover |
|---|---|---|---|
| include/mesh/mesh_base.h | +6 | -2 | +1.71% |
| src/mesh/boundary_info.C | +18 | 0 | +0.26% |
| src/mesh/mesh_triangle_holes.C | 0 | +1 | -0.27% |
| TOTAL | +24 | -1 | +0.01% |
codecodecode+
267 268 269 270 271 272 273 274 |
* function or manually set neighbor pointer from and to those * elements. */ void unset_has_neighbor_ptrs() { _preparation.has_neighbor_ptrs = false; } /** * Tells this we have done some operation (e.g. adding elements with |
278 279 280 281 282 283 284 285 |
* User code which adds new elements to this mesh must call this * function. */ void unset_has_cached_elem_data() { _preparation.has_cached_elem_data = false; } /** * Tells this we have done some operation (e.g. refining elements |
327 328 329 330 331 332 333 334 |
* User code which moves nodes ... should probably call this method, * in case ghosting functors depending on position exist? */ void unset_has_reinit_ghosting_functors() { _preparation.has_reinit_ghosting_functors = false; } /** * Tells this we have done some operation which may have invalidated |
337 338 339 340 341 342 343 344 |
* User code which removes elements, or which adds or removes * boundary entries, should call this method. */ void unset_has_boundary_id_sets() { _preparation.has_boundary_id_sets = false; } /** * \returns \p true if all elements and nodes of the mesh |
677 678 679 680 + 681 682 683 |
bool store_parent_side_ids, const std::vector<subdomain_id_type> & new_subdomain_ids) { libmesh_assert(new_subdomain_ids.empty() || new_subdomain_ids.size() == 1 || new_subdomain_ids.size() == requested_boundary_ids.size()); LOG_SCOPE("add_elements()", "BoundaryInfo"); |
730 731 732 733 + 734 735 736 |
for (auto s : elem->side_index_range()) { bool add_this_side = false; boundary_id_type triggering_bcid = invalid_id; // Find all the boundary side ids for this Elem side. std::vector<boundary_id_type> bcids; |
742 743 744 745 + 746 747 748 |
if (requested_boundary_ids.count(bcid)) { add_this_side = true; triggering_bcid = bcid; break; } } |
758 759 760 761 + 762 763 764 |
add_this_side = true; if (add_this_side) sides_to_add.emplace_back(elem->id(), s, triggering_bcid); } } |
778 779 780 781 + 782 + 783 + 784 785 786 + 787 788 789 |
// contiguous vector lets us do that index lookup in O(1) (after an // O(log N) Utility::binary_find()) rather than the O(N) std::distance() // between std::set iterators. std::vector<boundary_id_type> requested_boundary_ids_vec; if (new_subdomain_ids.size() > 1) requested_boundary_ids_vec.assign(requested_boundary_ids.begin(), requested_boundary_ids.end()); for (const auto & [elem_id, s, triggering_bcid] : sides_to_add) { Elem * elem = _mesh->elem_ptr(elem_id); |
812 813 814 815 + 816 + 817 + 818 819 + 820 821 + 822 + 823 + 824 + 825 826 827 |
new_elem->set_extra_integer(parent_side_index_tag, s); // Assign subdomain id if requested. if (new_subdomain_ids.size() == 1) new_elem->subdomain_id() = new_subdomain_ids[0]; else if (new_subdomain_ids.size() > 1) { auto it = Utility::binary_find(requested_boundary_ids_vec.begin(), requested_boundary_ids_vec.end(), triggering_bcid); libmesh_assert(it != requested_boundary_ids_vec.end()); new_elem->subdomain_id() = new_subdomain_ids[std::distance(requested_boundary_ids_vec.begin(), it)]; } #ifdef LIBMESH_ENABLE_AMR |
965 966 967 968 + 969 970 971 + 972 + 973 + 974 975 976 |
#endif // global containers are not synced boundary_mesh.unset_has_boundary_id_sets(); // New elements were added; mark the affected preparation flags invalid. boundary_mesh.unset_has_neighbor_ptrs(); boundary_mesh.unset_has_cached_elem_data(); boundary_mesh.unset_has_reinit_ghosting_functors(); } |
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 |