23#ifndef VULPES_GEOMETRY_AGGLOMERATION_ABS_AGG_MODEL_HPP_
24#define VULPES_GEOMETRY_AGGLOMERATION_ABS_AGG_MODEL_HPP_
70template <
typename MeshType>
118 const MeshType& mesh,
121 bool return_hierarchy =
true,
122 const std::string& segregated_tag =
"",
123 const IndVec& subset = {}) = 0;
140 const MeshType& mesh,
141 std::size_t n_groups,
167 const MeshType& mesh,
193 const MeshType& mesh,
217 const MeshType& mesh,
220 const std::string& segregation_tag,
235 const MeshType& mesh,
const IndVec& subgraph) = 0;
Definition crs_map.hpp:72
Defines an abstract interface for mesh agglomeration strategies.
Definition abs_agg_model.hpp:71
virtual IndVec bisectSubGraph(const MeshType &mesh, const IndVec &subgraph)=0
Backend implementation of a single bisection operation.
virtual std::vector< MeshType > agglomerate(const MeshType &mesh, MethodType method_type, ParamType params, bool return_hierarchy=true, const std::string &segregated_tag="", const IndVec &subset={})=0
Agglomerates a mesh according to a selected strategy.
std::vector< IndVec > invokeMethod(const MeshType &mesh, MethodType method_type, ParamType params, const std::string &segregation_tag, const IndVec &subset)
Dispatches to the correct agglomeration method to compute cell labels.
Definition abs_agg_model.cpp:75
double float_t
Definition abs_agg_model.hpp:73
datastructure::IndexTracker< index_t > IndexTrackerType
Definition abs_agg_model.hpp:78
datastructure::CrsMap< index_t, index_t > MapType
Definition abs_agg_model.hpp:76
std::vector< IndVec > multFactor(const MeshType &mesh, const float_t target_h, IndexTrackerType &indicator, const std::vector< bool > &agglomerate)
Partitions the mesh based on a multiplicative factor strategy.
Definition abs_agg_model.cpp:262
static constexpr index_t dim
Definition abs_agg_model.hpp:79
std::vector< IndVec > bisectNRef(const MeshType &mesh, const index_t n_refs, IndexTrackerType &indicator, const std::vector< bool > &agglomerate)
Applies recursive bisection n_refs times.
Definition abs_agg_model.cpp:162
void connectedComponents(const IndVec &subset, IndexTrackerType &indicator, index_t &max_id)
Splits a set of cells into its connected components.
Definition abs_agg_model.cpp:216
std::variant< index_t, float_t > ParamType
Definition abs_agg_model.hpp:77
std::vector< index_t > IndVec
Definition abs_agg_model.hpp:75
MapType m_dual_map
The dual graph of the mesh, cached for performance.
Definition abs_agg_model.hpp:277
int64_t index_t
Definition abs_agg_model.hpp:74
virtual void directKWay(const MeshType &mesh, std::size_t n_groups, IndexTrackerType &indicator, const std::vector< bool > &agglomerate)=0
Performs a direct k-way partition on the (sub)mesh.
void groupToBisection(const IndVec &subset, const IndVec &classes, IndexTrackerType &indicator, index_t new_id)
Post-processes a binary labeling to ensure two connected partitions.
Definition abs_agg_model.cpp:328
Definition abs_agg_model.cpp:40
MethodType
Definition abs_agg_model.hpp:41
@ MultFactor
Definition abs_agg_model.hpp:41
@ SegregateBisection
Definition abs_agg_model.hpp:41
@ DirectKWay
Definition abs_agg_model.hpp:41
@ BisectNRef
Definition abs_agg_model.hpp:41
Definition cell_manager.hpp:38