15#include <polysolve/nonlinear/Criteria.hpp>
25 class AdjointNLProblem;
43 void init(
const json &
args,
const bool strict_validation);
59 const std::string &log_file,
60 const spdlog::level::level_enum log_level,
61 const spdlog::level::level_enum file_log_level,
67 void init_logger(std::ostream &os,
const spdlog::level::level_enum log_level);
71 void set_log_level(
const spdlog::level::level_enum log_level);
83 double eval(Eigen::VectorXd &
x)
const;
85 polysolve::nonlinear::Status
solve(Eigen::VectorXd &
x);
92 std::vector<std::shared_ptr<varform::DifferentiableVarForm>>
varforms;
110 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_
void check_unsupported() const
Check and throw if any forward simulation varform::DifferentiableVarForm is not supported.
double eval(Eigen::VectorXd &x) const
std::vector< std::unique_ptr< const io::ResourceIO > > state_resources
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
std::unique_ptr< const io::ResourceIO > resources_
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_
Read-only interface to a hierarchical collection of simulation resources.