50 std::vector<CacheType*>& cached_elements,
51 std::function<GeometryType(CacheType
const&)> getCachedItem,
54 [[maybe_unused]]
bool const multiple_nodes_allowed)
56 if (
auto const it = find_if(cbegin(cached_elements), cend(cached_elements),
57 [&](
auto const& element)
58 {
return getCachedItem(*element) == item; });
59 it != cend(cached_elements))
61 return (*it)->getBoundaryElements();
64 if constexpr (std::is_convertible<GeometryType, GeoLib::Point>::value)
66 cached_elements.push_back(
new CacheType(mesh, mesh_node_searcher, item,
67 multiple_nodes_allowed));
71 cached_elements.push_back(
72 new CacheType(mesh, mesh_node_searcher, item));
74 return cached_elements.back()->getBoundaryElements();