2 #include <spdlog/spdlog.h>
16 template <
typename Derived>
17 auto filter_to_derived(
const std::vector<std::shared_ptr<const AttributeTransferEdge>>&
edges)
19 return wmtk::utils::filter_pointers_to_derived<const AttributeTransferEdge, const Derived>(
29 void add(
const std::shared_ptr<const AttributeTransferEdge>&);
35 std::vector<std::shared_ptr<const AttributeTransferStrategyBase>>
39 std::vector<std::shared_ptr<const AttributeTransferEdge>>
m_strats;
46 std::vector<std::shared_ptr<const AttributeTransferEdge>>
70 m_impl->add(a.shared_from_this());
75 return m_impl->linearized_strategies();
81 return m_impl->linearized_new_strategies();
86 return m_impl->linearized_transfer_strategies();
94 auto ptr = std::visit(
95 [&](
auto&& val) noexcept -> std::shared_ptr<const AttributeTransferEdge> {
96 using HandleType =
typename std::decay_t<decltype(val)>;
97 if constexpr (attribute::MeshAttributeHandle::template handle_type_is_basic<
99 using T =
typename HandleType::Type;
102 std::shared_ptr<OpType> tmp = std::make_shared<OpType>(attribute);
103 tmp->set_strategy(spine);
104 tmp->set_rib_strategy(rib);
120 auto ptr = std::visit(
121 [&](
auto&& val) noexcept -> std::shared_ptr<const AttributeTransferEdge> {
122 using HandleType =
typename std::decay_t<decltype(val)>;
123 if constexpr (attribute::MeshAttributeHandle::template handle_type_is_basic<
125 using T =
typename HandleType::Type;
128 std::shared_ptr<OpType> tmp = std::make_shared<OpType>(attribute);
129 tmp->set_strategy(strategy);
148 for (
const auto& s : new_strats) {
149 const auto targets = s->targets();
150 assert(targets.size() == 1);
155 const auto targets = s->targets();
156 assert(targets.size() == 1);
176 for (
const auto& s : new_strats) {
177 const auto targets = s->targets();
178 assert(targets.size() == 1);
183 const auto targets = s->targets();
184 assert(targets.size() == 1);
AttributeTransferConfiguration()
std::unique_ptr< internal::AttributeTransferConfigurationPimpl > m_impl
void add_split_new(const attribute::MeshAttributeHandle &attribute, const wmtk::operations::SplitBasicStrategy &spine=wmtk::operations::SplitBasicStrategy::Default, const wmtk::operations::SplitRibBasicStrategy &rib=wmtk::operations::SplitRibBasicStrategy::Default)
std::vector< std::shared_ptr< const AttributeTransferStrategyBase > > linearized_transfer_strategies() const
std::vector< std::shared_ptr< const AttributeTransferEdge > > linearized_strategies() const
~AttributeTransferConfiguration()
void apply(EdgeSplit &split, bool clear=false) const
void add(const AttributeTransferEdge &)
std::vector< std::shared_ptr< const NewAttributeStrategy > > linearized_new_strategies() const
void add_collapse_new(const attribute::MeshAttributeHandle &attribute, const wmtk::operations::CollapseBasicStrategy &strategy=wmtk::operations::CollapseBasicStrategy::Default)
void clear_attribute_new_strategies()
void set_new_attribute_strategy(const attribute::MeshAttributeHandle &attribute, const std::shared_ptr< const operations::BaseCollapseNewAttributeStrategy > &other)
void clear_attribute_new_strategies()
void set_new_attribute_strategy(const attribute::MeshAttributeHandle &attribute, const std::shared_ptr< const operations::BaseSplitNewAttributeStrategy > &other)
void set_transfer_strategy(const attribute::MeshAttributeHandle &attribute, const std::shared_ptr< const operations::AttributeTransferStrategyBase > &other)
void clear_attribute_transfer_strategies()
std::vector< std::shared_ptr< const AttributeTransferStrategyBase > > linearized_transfer_strategies() const
std::vector< std::shared_ptr< const NewAttributeStrategy > > linearized_new_strategies() const
void add(const std::shared_ptr< const AttributeTransferEdge > &)
std::vector< std::shared_ptr< const AttributeTransferEdge > > linearized_strategies() const
std::vector< std::shared_ptr< const AttributeTransferEdge > > m_strats
std::vector< Simplex > make_unique(const Mesh &m, const std::vector< Simplex > &s)
std::vector< Tuple > edges(const Mesh &m, const Simplex &simplex)