5 : ParameterAcceptor(
"SotParameterManager")
6 , source_params(source_params_storage)
7 , target_params(target_params_storage)
8 , solver_params(solver_params_storage)
9 , multilevel_params(multilevel_params_storage)
10 , power_diagram_params(power_diagram_params_storage)
11 , transport_map_params(transport_map_params_storage)
12 , conditional_density_params(conditional_density_params_storage)
13 , selected_task(selected_task_storage)
14 , io_coding(io_coding_storage)
15 , mpi_communicator(comm)
16 , n_mpi_processes(Utilities::MPI::n_mpi_processes(comm))
17 , this_mpi_process(Utilities::MPI::this_mpi_process(comm))
18 , pcout(std::cout, Utilities::MPI::this_mpi_process(comm) == 0)
22 "File format for I/O operations (txt/bin)");
24 enter_subsection(
"mesh_generation");
26 enter_subsection(
"source");
32 "Whether to convert the mesh to tetrahedral cells (only for 3D)");
34 "Whether to use custom density from file");
36 "Path to the density file");
38 "Format of the density file (vtk/h5)");
40 "Name of the field in the VTK file");
44 enter_subsection(
"target");
50 "Whether to convert the mesh to tetrahedral cells (only for 3D)");
52 "Whether to use custom density from file");
54 "Path to the density file");
56 "Format of the density file (vtk/h5)");
58 "Name of the field in the VTK file");
64 enter_subsection(
"rsot_solver");
67 "Maximum number of iterations for the optimization solver");
69 "Convergence tolerance for the optimization solver");
71 "Type of solver control to use (l1norm/componentwise)");
73 "Entropy regularization parameter (lambda)");
75 "Truncation error tolerance for integral radius bound");
77 "Type of distance threshold bound (pointwise/integral/geometric)");
79 "Enable detailed solver output");
81 "Type of optimization solver (BFGS)");
83 "Order of quadrature formula for numerical integration");
85 "Number of threads to use for parallel SOT");
87 "Enable epsilon scaling strategy");
89 "Factor by which to reduce epsilon in each scaling step");
91 "Number of epsilon scaling steps");
93 "Enable log-sum-exp trick for numerical stability with small entropy");
97 enter_subsection(
"multilevel_parameters");
101 "Whether to use source multilevel approach");
103 "Minimum number of vertices for the coarsest source level");
105 "Maximum number of vertices for finest source level");
107 "Directory to store the source mesh hierarchy");
111 "Whether to use target multilevel approach");
113 "Minimum number of points for the coarsest target level");
115 "Maximum number of points for the finest target level");
117 "Directory to store target point cloud hierarchy");
119 "Whether to use softmax-based potential transfer between target levels");
123 "Whether to use Python scripts for clustering");
125 "Name of the Python script to use for clustering");
129 "Directory prefix for multilevel SOT results");
134 enter_subsection(
"power_diagram_parameters");
137 "Implementation to use for power diagram computation (dealii/geogram)");
141 enter_subsection(
"transport_map_parameters");
144 "Truncation radius for map approximation (-1 = disabled)");
148 enter_subsection(
"conditional_density_parameters");
151 "Indices for conditional density computation");
153 "Folder to load potential from (empty = default)");
155 "Truncation radius for conditional density computation (-1 = disabled)");
163 std::string logo = R
"(
164 ▗▄▄▖▗▄▄▄▖▗▖ ▗▖▗▄▄▄▖▗▄▄▄ ▗▄▄▄▖ ▗▄▄▖ ▗▄▄▖▗▄▄▖ ▗▄▄▄▖▗▄▄▄▖▗▄▄▄▖ ▗▄▖▗▄▄▄▖
165▐▌ ▐▌ ▐▛▚▞▜▌ █ ▐▌ █ █ ▐▌ ▐▌ ▐▌ ▐▌▐▌ █ ▐▌ ▐▌ ▐▌ █
166 ▝▀▚▖▐▛▀▀▘▐▌ ▐▌ █ ▐▌ █ █ ▝▀▚▖▐▌ ▐▛▀▚▖▐▛▀▀▘ █ ▐▛▀▀▘▐▌ ▐▌ █
167▗▄▄▞▘▐▙▄▄▖▐▌ ▐▌▗▄█▄▖▐▙▄▄▀▗▄█▄▖▗▄▄▞▘▝▚▄▄▖▐▌ ▐▌▐▙▄▄▖ █ ▐▙▄▄▖▝▚▄▞▘ █
198 pcout << std::string(80,
'-') << std::endl;
249 pcout << std::string(section_name.length(),
'-') << std::endl;
255 pcout << std::string(80,
'-') << std::endl;
260 std::string description;
263 std::vector<TaskInfo> tasks = {
264 {
"generate_mesh",
"Generate source and target meshes based on specified parameters"},
265 {
"load_meshes",
"Load pre-existing source and target meshes"},
266 {
"sot",
"Run standard semidiscrete optimal transport"},
267 {
"exact_sot",
"Run exact semidiscrete optimal transport (no regularization)"},
268 {
"power_diagram",
"Compute power diagram for given potentials"},
269 {
"map",
"Compute transport map between source and target"},
270 {
"prepare_source_multilevel",
"Prepare source mesh hierarchy for multilevel approach"},
271 {
"prepare_target_multilevel",
"Prepare target point cloud hierarchy for multilevel approach"},
272 {
"multilevel_sot",
"Run multilevel semidiscrete optimal transport"},
273 {
"conditional_density",
"Compute conditional densities for specified indices"}
277 for (
const auto& task : tasks) {
284 pcout << std::setw(30) << std::left << task.name
285 << task.description <<
RESET << std::endl;
288 pcout << std::string(80,
'-') << std::endl;
319 pcout <<
CYAN <<
" Regularization Settings:" <<
RESET << std::endl;
326 pcout <<
" Epsilon Scaling: " <<
BOLD <<
"enabled" <<
RESET << std::endl;
330 pcout <<
" Epsilon Scaling: " <<
BOLD <<
"disabled" <<
RESET << std::endl;
379 pcout <<
CYAN <<
" Power Diagram Computation:" <<
RESET << std::endl;
386 pcout <<
CYAN <<
" Transport Map Settings:" <<
RESET << std::endl;
394 pcout <<
CYAN <<
" Conditional Density Settings:" <<
RESET << std::endl;
397 pcout <<
"none specified";
400 if (i > 0)
pcout <<
", ";
414 , lloyd_params(lloyd_params_storage)
416 enter_subsection(
"lloyd parameters");
427 pcout << std::string(80,
'-') << std::endl;
432 std::string description;
435 std::vector<TaskInfo> tasks = {
436 {
"lloyd",
"Run Lloyd algorithm with regularized SOT"},
440 for (
const auto& task : tasks) {
447 pcout << std::setw(30) << std::left << task.name
448 << task.description <<
RESET << std::endl;
451 pcout << std::string(80,
'-') << std::endl;
471 pcout << std::string(80,
'-') << std::endl;
502 pcout << std::string(80,
'-') << std::endl;
void print_lloyd_parameters() const
virtual void print_parameters() const override
LloydParameterManager(const MPI_Comm &comm)
void print_task_information() const
LloydParameters & lloyd_params
ConditionalDensityParameters & conditional_density_params
MeshParameters & source_params
void print_section_header(const std::string §ion_name) const
SolverParameters & solver_params
MultilevelParameters & multilevel_params
void print_power_diagram_parameters() const
void print_conditional_density_parameters() const
void print_mesh_parameters() const
MeshParameters & target_params
virtual void print_parameters() const
void print_transport_map_parameters() const
std::string & selected_task
SotParameterManager(const MPI_Comm &comm)
PowerDiagramParameters & power_diagram_params
void print_solver_parameters() const
void print_multilevel_parameters() const
void print_task_information() const
TransportMapParameters & transport_map_params
unsigned int max_iterations
Number of max iterations.
double relative_tolerance
Convergence tolerance.
std::vector< unsigned int > indices
Indices for conditional density computation.
double truncation_radius
Truncation radius for conditional density computation (-1 = disabled)
std::string potential_folder
Folder to load potential from (empty = default)
bool use_custom_density
Whether to use custom density.
unsigned int n_refinements
Number of global refinement steps.
std::string density_field_name
Name of the field in the VTK file.
bool use_tetrahedral_mesh
Whether to use tetrahedral elements (3D only)
std::string grid_generator_arguments
Arguments for the grid generator.
std::string density_file_path
Path to the density file.
std::string grid_generator_function
Name of the grid generator function.
std::string density_file_format
Format of the density file (vtk/h5)
std::string source_hierarchy_dir
Source hierarchy directory.
bool target_enabled
Whether to use target multilevel approach.
bool source_enabled
Whether to use source multilevel approach.
bool use_softmax_potential_transfer
Use softmax for potential transfer between target levels.
int source_max_vertices
Maximum vertices for finest source level.
int target_min_points
Minimum points for coarsest target level.
std::string target_hierarchy_dir
Target hierarchy directory.
int target_max_points
Maximum points for finest target level.
bool use_python_clustering
Whether to use Python scripts for clustering.
std::string python_script_name
Name of the Python script to use.
int source_min_vertices
Minimum vertices for coarsest source level.
std::string output_prefix
Output directory prefix.
std::string implementation
Implementation choice (dealii/geogram)
unsigned int nb_points
Number of points for discretization.
std::string distance_threshold_type
Type of distance threshold bound (pointwise|integral|geometric)
double tolerance
Convergence tolerance.
unsigned int epsilon_scaling_steps
Number of scaling steps.
std::string solver_type
Type of optimization solver.
bool use_log_sum_exp_trick
Enable log-sum-exp trick for numerical stability with small entropy.
unsigned int quadrature_order
Order of quadrature formula.
unsigned int n_threads
Number of threads (0 = auto)
std::string solver_control_type
Type of solver control to use (l1norm/componentwise)
bool verbose_output
Enable detailed solver output.
unsigned int max_iterations
Maximum number of solver iterations.
bool use_epsilon_scaling
Enable epsilon scaling strategy.
double epsilon_scaling_factor
Factor for epsilon reduction.
double tau
Integral radius bound tolerance.
double epsilon
Entropy regularization parameter.
double truncation_radius
Truncation radius for map approximation (-1 = disabled)