15#include <lagrange/partitioning/types.h>
17#include <lagrange/utils/function_ref.h>
18#include <lagrange/utils/safe_cast.h>
19#include <lagrange/utils/span.h>
41Eigen::Matrix<index_t, Eigen::Dynamic, 1> partition_mesh_vertices_raw(
61template <
typename DerivedF>
63 const Eigen::MatrixBase<DerivedF>& facets,
69 auto copy_func = [&](
auto dst) {
70 using value_t =
typename std::decay_t<
decltype(dst)>::value_type;
71 for (Eigen::Index f = 0; f < facets.rows(); ++f) {
72 for (Eigen::Index lv = 0; lv < facets.cols(); ++lv) {
73 dst[f * facets.cols() + lv] =
static_cast<value_t
>(facets(f, lv));
79 return internal::partition_mesh_vertices_raw(
A lightweight non-owning reference to a callable.
Definition function_ref.h:47
::nonstd::span< T, Extent > span
A bounds-safe view for sequences of objects.
Definition span.h:27
constexpr auto safe_cast(SourceType value) -> std::enable_if_t<!std::is_same< SourceType, TargetType >::value, TargetType >
Perform safe cast from SourceType to TargetType, where "safe" means:
Definition safe_cast.h:50
Mesh partitioning using METIS.
Definition partition_mesh_vertices.h:25
Eigen::Matrix< index_t, Eigen::Dynamic, 1 > partition_mesh_vertices(const Eigen::MatrixBase< DerivedF > &facets, index_t num_partitions)
Partition mesh vertices into num_partitions using METIS.
Definition partition_mesh_vertices.h:62
int32_t index_t
Index type used by METIS.
Definition types.h:20
Main namespace for Lagrange.