9 template <
typename MyType>
28 template <
typename MyType,
typename ParentType>
72 std::vector<wmtk::attribute::MeshAttributeHandle>
sources() const final
override
101 template <
typename MyType,
typename ParentType>
108 , m_parent_handle(parent)
110 assert(me.template holds<MyType>());
111 assert(parent.template holds<ParentType>());
113 template <
typename MyType,
typename ParentType>
121 template <
typename MyType,
typename ParentType>
123 const simplex::Simplex& my_simplex)
const -> std::pair<ParentMatType, std::vector<Tuple>>
126 m_parent_handle.mesh().create_const_accessor(m_parent_handle.template as<ParentType>());
131 m_parent_handle.mesh().get_attribute_dimension(m_parent_handle.template as<ParentType>()),
134 using Index = Eigen::Index;
135 for (Index j = 0; j < Index(simps.size()); ++j) {
136 A.col(j) = acc.const_vector_attribute(simps[j]);
138 return std::make_pair(std::move(A), std::move(simps));
140 template <
typename MyType,
typename ParentType>
143 assert(mesh().is_valid(s.
tuple()));
150 auto [parent_data, simps] = read_parent_values(s);
151 if (simps.empty())
return;
152 auto acc =
const_cast<Mesh&
>(mesh()).create_accessor(handle().template as<MyType>());
154 acc.vector_attribute(s.
tuple()) = m_functor(parent_data, simps);
157 template <
typename MyType,
typename ParentType>
160 return m_parent_handle.primitive_type();
static std::vector< Tuple > get_parent_simplices(const Mesh &m, const Mesh &parent, const simplex::Simplex &s, PrimitiveType parent_primitive_type)
PrimitiveType primitive_type() const override
AttributeTransferStrategy(const attribute::MeshAttributeHandle &my_handle)
static FunctorType make_nosimplices_func(FunctorWithoutSimplicesType &&fp)
PrimitiveType parent_primitive_type() const
std::function< MyVecType(const ParentMatType &, const std::vector< Tuple > &)> FunctorType
void run(const simplex::Simplex &s) const final override
std::vector< wmtk::attribute::MeshAttributeHandle > sources() const final override
SingleAttributeTransferStrategy(const attribute::MeshAttributeHandle &my_handle, const attribute::MeshAttributeHandle &parent_handle, FunctorType &&=nullptr)
MatType< ParentType > ParentMatType
std::pair< ParentMatType, std::vector< Tuple > > read_parent_values(const simplex::Simplex &my_simplex) const
attribute::MeshAttributeHandle m_parent_handle
std::function< MyVecType(const ParentMatType &)> FunctorWithoutSimplicesType
VecType< MyType > MyVecType
const Tuple & tuple() const
PrimitiveType primitive_type() const
Vector< T, Eigen::Dynamic > VectorX
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > MatrixX