|
| Lloyd (const MPI_Comm &mpi_communicator) |
| Constructor for the Lloyd class.
|
|
void | run () |
| Runs the Lloyd's algorithm.
|
|
void | run_lloyd (const double absolute_threshold=1e-8, const unsigned int max_iterations=100) |
| Runs the Lloyd's algorithm with the given parameters.
|
|
void | run_sot_iteration (const unsigned int n_iter) |
| Runs a single iteration of the semi-discrete optimal transport solver.
|
|
void | run_centroid_iteration (const unsigned int n_iter) |
| Runs a single iteration of the centroid computation.
|
|
void | compute_step_norm (const std::vector< Point< spacedim > > &barycenters_next, const std::vector< Point< spacedim > > &barycenters_prev, double &l2_norm) |
| Computes the L2 norm of the step.
|
|
| SemiDiscreteOT (const MPI_Comm &mpi_communicator) |
| Constructor for the SemiDiscreteOT class.
|
|
void | run () |
| Runs the solver with the current configuration.
|
|
void | configure (std::function< void(SotParameterManager &)> config_func) |
| Configure the solver parameters programmatically.
|
|
void | setup_source_measure (Triangulation< dim, spacedim > &tria, const DoFHandler< dim, spacedim > &dh, const Vector< double > &density, const std::string &name="source") |
| Setup source measure from standard deal.II objects (simplified API for tutorials)
|
|
void | setup_target_measure (const std::vector< Point< spacedim > > &points, const Vector< double > &weights) |
| Set up the target measure from a discrete set of points and weights.
|
|
void | prepare_multilevel_hierarchies () |
| Pre-computes the multilevel hierarchies for source and/or target. This must be called after setting up the base measures and before calling solve() if multilevel computation is desired.
|
|
void | prepare_source_multilevel () |
| Pre-computes the multilevel hierarchy for the source.
|
|
void | prepare_target_multilevel () |
| Pre-computes the multilevel hierarchy for the target.
|
|
SotSolver< dim, spacedim > * | get_solver () |
| Get a pointer to the solver object.
|
|
const SotParameterManager::SolverParameters & | get_solver_params () const |
| Get a reference to the solver parameters.
|
|
const Vector< double > & | get_coarsest_potential () const |
| Get the coarsest potential from the multilevel solve.
|
|
Vector< double > | solve (const Vector< double > &initial_potential=Vector< double >()) |
| Run the optimal transport computation based on the current configuration. This method handles single-level, multilevel, and epsilon scaling automatically.
|
|
void | save_discrete_measures () |
| Saves the discrete source and target measures to files.
|
|
void | set_distance_function (const std::function< double(const Point< spacedim > &, const Point< spacedim > &)> &dist) |
| Sets the distance function to be used by the solver.
|
|
|
void | save_results (const Vector< double > &potentials, const std::string &filename, bool add_epsilon_prefix=true) |
| Saves the results of the computation.
|
|
void | normalize_density (LinearAlgebra::distributed::Vector< double > &density) |
| Normalizes the density vector.
|
|
MPI_Comm | mpi_communicator |
| The MPI communicator.
|
|
const unsigned int | n_mpi_processes |
| The number of MPI processes.
|
|
const unsigned int | this_mpi_process |
| The rank of the current MPI process.
|
|
std::unique_ptr< SotSolver< dim, spacedim > > | sot_solver |
| The semi-discrete optimal transport solver.
|
|
SotParameterManager | param_manager |
| The parameter manager.
|
|
SotParameterManager::MeshParameters & | source_params |
| A reference to the source mesh parameters.
|
|
SotParameterManager::MeshParameters & | target_params |
| A reference to the target mesh parameters.
|
|
SotParameterManager::SolverParameters & | solver_params |
| A reference to the solver parameters.
|
|
SotParameterManager::MultilevelParameters & | multilevel_params |
| A reference to the multilevel parameters.
|
|
SotParameterManager::PowerDiagramParameters & | power_diagram_params |
| A reference to the power diagram parameters.
|
|
SotParameterManager::TransportMapParameters & | transport_map_params |
| A reference to the transport map parameters.
|
|
std::string & | selected_task |
| A reference to the selected task.
|
|
std::string & | io_coding |
| A reference to the I/O coding.
|
|
std::unique_ptr< DoFHandler< dim, spacedim > > | initial_fine_dof_handler |
| The initial fine DoF handler.
|
|
std::unique_ptr< Vector< double > > | initial_fine_density |
| The initial fine density.
|
|
bool | is_setup_programmatically_ = false |
| A flag to indicate if the setup is done programmatically.
|
|
std::string | source_mesh_name = "source" |
| The name of the source mesh.
|
|
parallel::fullydistributed::Triangulation< dim, spacedim > | source_mesh |
| The source mesh.
|
|
Triangulation< dim, spacedim > | target_mesh |
| The target mesh.
|
|
DoFHandler< dim, spacedim > | dof_handler_source |
| The DoF handler for the source mesh.
|
|
DoFHandler< dim, spacedim > | dof_handler_target |
| The DoF handler for the target mesh.
|
|
std::unique_ptr< VTKHandler< dim, spacedim > > | source_vtk_handler |
| The VTK handler for the source mesh.
|
|
DoFHandler< dim, spacedim > | vtk_dof_handler_source |
| The DoF handler for the source VTK mesh.
|
|
Vector< double > | vtk_field_source |
| The source field from the VTK file.
|
|
Triangulation< dim, spacedim > | vtk_tria_source |
| The triangulation from the source VTK file.
|
|
std::unique_ptr< FiniteElement< dim, spacedim > > | fe_system |
| The finite element system.
|
|
std::unique_ptr< Mapping< dim, spacedim > > | mapping |
| The mapping.
|
|
std::unique_ptr< FiniteElement< dim, spacedim > > | fe_system_target |
| The target finite element system.
|
|
std::unique_ptr< Mapping< dim, spacedim > > | mapping_target |
| The target mapping.
|
|
LinearAlgebra::distributed::Vector< double > | source_density |
| The source density.
|
|
Vector< double > | target_density |
| The target density.
|
|
std::vector< Point< spacedim > > | target_points |
| The target points.
|
|
std::vector< Point< spacedim > > | source_points |
| The source points.
|
|
std::unique_ptr< MeshManager< dim, spacedim > > | mesh_manager |
| The mesh manager.
|
|
std::unique_ptr< EpsilonScalingHandler > | epsilon_scaling_handler |
| The epsilon scaling handler.
|
|
template<int dim, int spacedim = dim>
class Lloyd< dim, spacedim >
A class for performing Lloyd's algorithm for semi-discrete optimal transport.
This class implements Lloyd's algorithm, which is an iterative method for finding the optimal locations of the target points in a semi-discrete optimal transport problem. It alternates between solving the dual problem for the optimal transport potential and moving the target points to the centroids of their power cells.
- Template Parameters
-
dim | The dimension of the source mesh. |
spacedim | The dimension of the space the mesh is embedded in. |
Definition at line 23 of file Lloyd.h.