#pragma once #include #include #include enum class axis : uint8_t { u, v }; enum class integrator_type : uint8_t { gauss_legendre, tanh_sinh }; // TODO: move this outwards, make a general sign definition to use everywhere enum class sign_t : uint8_t { negative, zero, positive }; static constexpr auto strict_epsilon = 10 * std::numeric_limits::epsilon(); struct double_error_hasher { size_t operator()(double x) const { return std::hash{}(x / strict_epsilon); } }; struct chain_end_hasher { size_t operator()(const Eigen::Vector2d& p) const { return hash_funcs(p, strict_epsilon); } }; static constexpr auto sorted_double_equal = [](double lhs, double rhs) { return rhs - lhs <= strict_epsilon; }; static constexpr auto double_less = [](double lhs, double rhs) { return rhs - lhs > strict_epsilon; }; static constexpr auto gl_integrator = GLIntegrator{}; static constexpr auto ts_integrator = TSIntegrator{}; // intersections stl_vector_mp u_line_subface_intersection(const pcurve_relation_graph_t& pcurve_relation_graph, uint32_t subface_index, double x, double y_start, double y_end, bool with_start, bool with_end); stl_vector_mp v_line_subface_intersection(const pcurve_relation_graph_t& pcurve_relation_graph, uint32_t subface_index, double x, double y_start, double y_end, bool with_start, bool with_end); // integrator helpers void expand_integral_on_u(uint8_t q, const pcurve_relation_graph_t& pcurve_relation_graph, uint32_t subface_index, double v, double u_start, double u_end, bool with_start, bool with_end, double w_u, std::function&& integrator_x, std::function&& integrator_w, stl_vector_mp& integral_points); void expand_integral_on_v(uint8_t q, const pcurve_relation_graph_t& pcurve_relation_graph, uint32_t subface_index, double u, double v_start, double v_end, bool with_start, bool with_end, double w_v, std::function&& integrator_x, std::function&& integrator_w, stl_vector_mp& integral_points); stl_vector_mp calculate_tensor_product_points(uint8_t q); void calculate_integral(uint8_t q, const baked_blobtree_t& tree, const pcurve_relation_graph_t& pcurve_relation_graph, stl_vector_mp>& integral_points, stl_vector_mp>& surface_integral_weights, stl_vector_mp>& volume_integral_weights);