6 template <
int64_t cell_dimension,
typename Functor>
20 template <
typename NodeFunctor>
22 template <
typename EdgeFunctor>
25 template <
typename MeshType,
typename... OtherArgumentTypes>
28 return m_visitor.
cache().get(m, std::forward<OtherArgumentTypes>(args)...);
34 template <
int64_t cell_dimension,
typename Functor>
38 template <
int64_t cell_dimension,
typename Functor>
39 template <
typename EdgeFunctor>
43 for (
const auto& pr : edge_events()) {
45 const auto& keyA = std::get<0>(pr);
46 const auto& keyB = std::get<1>(pr);
53 [&](
auto parent_mesh_,
auto child_mesh_) noexcept {
54 auto& parent_mesh = parent_mesh_.get();
55 auto& child_mesh = child_mesh_.get();
56 using ChildType = std::decay_t<decltype(child_mesh)>;
57 using ParentType = std::decay_t<decltype(parent_mesh)>;
64 constexpr
static int64_t ParentDim =
65 wmtk::utils::metaprogramming::cell_dimension_v<ParentType>;
66 constexpr
static int64_t ChildDim =
67 wmtk::utils::metaprogramming::cell_dimension_v<ChildType>;
72 constexpr
static bool ChildHasReturn = !std::is_void_v<ChildReturnType>;
73 constexpr
static bool ParentHasReturn = !std::is_void_v<ParentReturnType>;
75 if constexpr (ParentDim >= ChildDim && ChildHasReturn && ParentHasReturn) {
76 const ParentReturnType& parent_return =
77 get_cached_return(parent_mesh, std::get<1>(keyA));
78 const ChildReturnType& child_return =
79 get_cached_return(child_mesh, std::get<1>(keyB));
96 template <
int64_t cell_dimension,
typename Functor>
97 template <
typename NodeFunctor>
101 for (
const auto& event : node_events()) {
104 [&](
auto parent_mesh_) noexcept {
105 auto& parent_mesh = parent_mesh_.get();
106 using ParentType = std::decay_t<decltype(parent_mesh)>;
109 constexpr
static int64_t ParentDim =
110 wmtk::utils::metaprogramming::cell_dimension_v<ParentType>;
114 constexpr
static bool ParentHasReturn = !std::is_void_v<ParentReturnType>;
116 if constexpr (ParentHasReturn) {
117 const ParentReturnType& parent_return =
118 get_cached_return(parent_mesh, std::get<1>(event));
119 node_functor(parent_mesh, std::get<1>(event), parent_return);
MultiMeshSimplexEventVisitor(const MultiMeshSimplexVisitor< cell_dimension, Functor > &visitor)
void run_on_nodes(NodeFunctor &&node_functor)
const auto & edge_events() const
const VisitorType & m_visitor
typename VisitorType::template GetReturnType_t< T > GetReturnType_t
void run_on_edges(EdgeFunctor &&edge_functor)
const auto & get_cached_return(const MeshType &m, OtherArgumentTypes &&... args) const
const auto & edge_events() const
const CacheType & cache() const
MultiMeshSimplexEventVisitor(const MultiMeshSimplexVisitor< cell_dimension, Functor > &visitor) -> MultiMeshSimplexEventVisitor< cell_dimension, Functor >