Wildmeshing Toolkit
OptimizationSmoothing.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <polysolve/Types.hpp>
5 #include "AttributesUpdate.hpp"
6 
7 
8 namespace polysolve::nonlinear {
9 class Solver;
10 }
11 
12 namespace wmtk::function {
13 class Function;
14 }
15 
16 namespace wmtk::operations {
17 
19 {
20 private:
21  template <typename T>
22  class WMTKProblem;
23 
24 public:
25  OptimizationSmoothing(std::shared_ptr<wmtk::function::Function> energy);
26 
27  std::vector<simplex::Simplex> execute(const simplex::Simplex& simplex) override;
28 
31 
32 
34  {
35  m_linear_solver_params = params;
36  create_solver();
37  }
38 
40  {
42  create_solver();
43  }
44 
45 private:
46  std::shared_ptr<wmtk::function::Function> m_energy;
47  std::shared_ptr<polysolve::nonlinear::Solver> m_solver;
48 
49 
52 
53  void create_solver();
54 };
55 
56 } // namespace wmtk::operations
void set_linear_solver_params(const polysolve::json &params)
std::shared_ptr< wmtk::function::Function > m_energy
void set_nonlinear_solver_params(const polysolve::json &params)
std::shared_ptr< polysolve::nonlinear::Solver > m_solver
std::vector< simplex::Simplex > execute(const simplex::Simplex &simplex) override
returns an empty vector in case of failure
const polysolve::json & nonlinear_solver_params() const
const polysolve::json & linear_solver_params() const
OptimizationSmoothing(std::shared_ptr< wmtk::function::Function > energy)
nlohmann::json json
Definition: input.cpp:9