3#include <wmtk/OptimizerParameters.h>
5#include <nlohmann/json.hpp>
7namespace wmtk::components::triwild {
11 Vector2d box_min = Vector2d::Zero();
12 Vector2d box_max = Vector2d::Ones();
82 epsr = json_params[
"eps_rel"];
83 lr = json_params[
"length_rel"];
84 stop_energy = json_params[
"stop_energy"];
85 preserve_topology = json_params[
"preserve_topology"];
90 debug_output = json_params[
"DEBUG_output"];
91 perform_sanity_checks = json_params[
"DEBUG_sanity_checks"];
96 w_amips = json_params[
"w_amips"];
101 interleaved_smoothing = json_params[
"interleaved_smoothing"];
102 interleaved_smoothing_passes = json_params[
"interleaved_smoothing_passes"];
114 stuck_refine_stall_eps = json_params[
"stuck_refine_stall_eps"];
115 stuck_refine_cooldown = json_params[
"stuck_refine_cooldown"];
116 stuck_refine_num_worst = json_params[
"stuck_refine_num_worst"];
117 stuck_refine_rings = json_params[
"stuck_refine_rings"];
118 stuck_refine_factor = json_params[
"stuck_refine_factor"];
119 stuck_refine_min_scalar = json_params[
"stuck_refine_min_scalar"];
120 stuck_refine_gradation = json_params[
"stuck_refine_gradation"];
121 stuck_refine_force_split = json_params[
"stuck_refine_force_split"];
124 skip_good_regions = json_params[
"skip_good_regions"];
125 skip_good_regions_margin = json_params[
"skip_good_regions_margin"];
128 void init(
const Vector2d& min_,
const Vector2d& max_)
136 const std::vector<Vector2d>& vertices,
137 const std::vector<std::array<size_t, 3>>& faces)
140 for (
size_t i = 0; i < vertices.size(); i++) {
146 for (
int j = 0; j < 2; j++) {
147 if (vertices[i][j] < min_[j]) {
148 min_[j] = vertices[i][j];
150 if (vertices[i][j] > max_[j]) {
151 max_[j] = vertices[i][j];
The parameters tetwild, triwild and simwild all share.
Definition OptimizerParameters.h:28
int project_line_search_nested_steps
Partial-projection bisections tried after it gives up; 0 disables that pass.
Definition OptimizerParameters.h:160
double w_amips
Definition OptimizerParameters.h:154
int coarsen_max_inner_passes
Definition OptimizerParameters.h:297
std::string smoothing_mode
"projected" or "exact"; see SmoothVertexOptions::SmoothingMode.
Definition OptimizerParameters.h:156
bool coarsen_pass
Definition OptimizerParameters.h:190
bool optimize_envelope_around_simplified
Definition OptimizerParameters.h:63
int coarsen_global_smoothing_passes
Definition OptimizerParameters.h:255
int coarsen_max_rounds
Definition OptimizerParameters.h:279
void init_lengths_from_diagonal(const double diag)
Derive the edge-length and envelope quantities from the bounding-box diagonal.
Definition OptimizerParameters.h:309
bool coarsen_unbounded
Definition OptimizerParameters.h:214
int split_high_valence_threshold
Definition OptimizerParameters.h:70
int coarsen_local_smoothing_passes
Definition OptimizerParameters.h:232
int project_line_search_steps
Bisections tried before the projected search gives up. See SmoothVertexOptions.
Definition OptimizerParameters.h:158
int coarsen_smooth_ring
Definition OptimizerParameters.h:248
int num_smoothing_passes
Number and placement of smoothing passes in the shared Wild optimization driver.
Definition OptimizerParameters.h:164
The fields shared with tetwild and simwild live in wmtk::OptimizerParameters.
Definition Parameters.h:10
Parameters(const nlohmann::json &json_params)
Read every optimizer knob out of the (defaults-injected) JSON.
Definition Parameters.h:80
bool allow_junction_cleanup
Definition Parameters.h:43
bool use_sample_envelope
Definition Parameters.h:71
bool preserve_feature_points
Definition Parameters.h:22
bool check_envelope_at_init
Definition Parameters.h:55