20 std::vector<std::array<bool, 4>>& local_f_on_input,
24 auto [vdat, fdat] =
get_vf(m);
25 std::vector<double> V_tmp;
27 std::tie(V_tmp, npts) = vdat;
28 std::vector<uint32_t> F;
30 std::tie(F, ntri) = fdat;
32 std::vector<std::array<int64_t, 4>> T_final;
33 std::vector<std::array<std::string, 3>> V_final_str;
48 T.resize(T_final.size(), 4);
50 for (int64_t i = 0; i < T_final.size(); ++i) {
51 T(i, 0) = T_final[i][0];
52 T(i, 1) = T_final[i][1];
53 T(i, 2) = T_final[i][2];
54 T(i, 3) = T_final[i][3];
57 std::shared_ptr<wmtk::TetMesh> tm = std::make_shared<wmtk::TetMesh>();
62 V.resize(V_final_str.size(), 3);
64 for (int64_t i = 0; i < V_final_str.size(); ++i) {
65 V(i, 0).init_from_binary(V_final_str[i][0]);
66 V(i, 1).init_from_binary(V_final_str[i][1]);
67 V(i, 2).init_from_binary(V_final_str[i][2]);
70 if (rational_output) {
72 for (int64_t i = 0; i < T_final.size(); ++i) {
77 V.row(T(i, 3))) < 0) {
88 auto rounding_pt_attribute =
92 auto rounding = std::make_shared<wmtk::operations::Rounding>(*tm, rounding_pt_attribute);
93 rounding->add_invariant(
100 "Executed rounding, {} ops (S/F) {}/{}. Time: collecting: {}, sorting: {}, "
102 stats.number_of_performed_operations(),
103 stats.number_of_successful_operations(),
104 stats.number_of_failed_operations(),
105 stats.collecting_time,
107 stats.executing_time);
110 V_double.resize(V_final_str.size(), 3);
112 V_double = V.cast<
double>();
115 for (int64_t i = 0; i < T_final.size(); ++i) {
117 V_double.row(T(i, 0)),
118 V_double.row(T(i, 1)),
119 V_double.row(T(i, 2)),
120 V_double.row(T(i, 3))) < 0) {
SchedulerStats run_operation_on_all(operations::Operation &op)
void cdt_to_string(const std::vector< double > &V, const uint32_t npts, const std::vector< uint32_t > &F, const uint32_t ntri, std::vector< std::array< bool, 4 >> &local_f_on_input, std::vector< std::array< int64_t, 4 >> &T_final, std::vector< std::array< std::string, 3 >> &V_final, bool inner_only)
std::shared_ptr< wmtk::TetMesh > CDT_internal(const wmtk::TriMesh &m, std::vector< std::array< bool, 4 >> &local_f_on_input, bool inner_only, bool rational_output)
std::tuple< std::pair< std::vector< double >, uint32_t >, std::pair< std::vector< uint32_t >, uint32_t > > get_vf(const TriMesh &trimesh)
attribute::MeshAttributeHandle set_matrix_attribute(const Mat &data, const std::string &name, const PrimitiveType &type, Mesh &mesh)
int wmtk_orient3d(const Eigen::Ref< const Eigen::Vector3< Rational >> &p0, const Eigen::Ref< const Eigen::Vector3< Rational >> &p1, const Eigen::Ref< const Eigen::Vector3< Rational >> &p2, const Eigen::Ref< const Eigen::Vector3< Rational >> &p3)
spdlog::logger & logger()
Retrieves the current logger.
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > MatrixX