14#include <polysolve/nonlinear/Criteria.hpp>
24 class AdjointNLProblem;
42 void init(
const json &
args,
const bool strict_validation);
56 const std::string &log_file,
57 const spdlog::level::level_enum log_level,
58 const spdlog::level::level_enum file_log_level,
64 void init_logger(std::ostream &os,
const spdlog::level::level_enum log_level);
68 void set_log_level(
const spdlog::level::level_enum log_level);
80 double eval(Eigen::VectorXd &
x)
const;
82 polysolve::nonlinear::Status
solve(Eigen::VectorXd &
x);
89 std::vector<std::shared_ptr<varform::DifferentiableVarForm>>
varforms;
105 return args[
"root_path"].get<std::string>();
113 void init_logger(
const std::vector<spdlog::sink_ptr> &sinks,
const spdlog::level::level_enum log_level);
Main class containing the PolyFEM adjoint solver and its optimization data.
void initial_guess(Eigen::VectorXd &x)
void set_log_level(const spdlog::level::level_enum log_level)
change log level
json args
main input arguments containing all defaults
std::vector< std::shared_ptr< varform::DifferentiableVarForm > > varforms
Variational formulations used by the optimization.
void init(const json &args, const bool strict_validation)
initialize the polyfem solver with a json settings
int run(json args, const bool strict_validation)
Run optimization, including remeshing restarts when the selected trigger requests them.
std::vector< std::shared_ptr< DiffCache > > diff_caches
spdlog::sink_ptr file_sink_
std::string root_path() const
void check_unsupported() const
Check and throw if any forward simulation varform::DifferentiableVarForm is not supported.
double eval(Eigen::VectorXd &x) const
std::vector< int > variable_sizes
variables
std::unique_ptr< solver::AdjointNLProblem > nl_problem
std::string output_dir
Directory for output files.
std::vector< json > state_args
spdlog::sink_ptr console_sink_
logger sink to stdout
void init_logger(const std::string &log_file, const spdlog::level::level_enum log_level, const spdlog::level::level_enum file_log_level, const bool is_quiet)
initializing the logger
solver::VariableToSimulationGroup variable_to_simulations
void create_varforms(const int max_threads=-1)
Create the optimization variational formulations.
polysolve::nonlinear::Status solve(Eigen::VectorXd &x)
void init_variables()
init variables
bool remeshing_requested_
bool is_param_valid(const json ¶ms, const std::string &key)
Determine if a key exists and is non-null in a json object.