Go to the documentation of this file.
20 #ifndef LIBMESH_OPTIMIZATION_SYSTEM_H
21 #define LIBMESH_OPTIMIZATION_SYSTEM_H
24 #include "libmesh/implicit_system.h"
33 template<
typename T>
class OptimizationSolver;
52 const std::string &
name,
53 const unsigned int number);
226 virtual void clear ()
override;
237 virtual void reinit ()
override;
242 virtual void solve ()
override;
263 virtual std::string
system_type ()
const override {
return "Optimization"; }
273 std::unique_ptr<NumericVector<Number>>
C_eq;
283 std::unique_ptr<NumericVector<Number>>
C_ineq;
307 #endif // LIBMESH_OPTIMIZATION_SYSTEM_H
This System subclass enables us to assemble an objective function, gradient, Hessian and bounds for o...
OptimizationSystem sys_type
The type of system.
std::unique_ptr< NumericVector< Number > > C_ineq
The vector that stores inequality constraints.
void initialize_inequality_constraints_storage(const std::vector< std::set< numeric_index_type >> &constraint_jac_sparsity)
Initialize storage for the inequality constraints, as per initialize_equality_constraints_storage.
virtual void equality_constraints_jacobian(const NumericVector< Number > &X, SparseMatrix< Number > &C_eq_jac, sys_type &S)=0
This function will be called to evaluate the Jacobian of C_eq(X).
OptimizationSystem(EquationSystems &es, const std::string &name, const unsigned int number)
Constructor.
Manages consistently variables, degrees of freedom, coefficient vectors, and matrices for implicit sy...
virtual void hessian(const NumericVector< Number > &X, SparseMatrix< Number > &H_f, sys_type &S)=0
This function will be called to compute the Hessian of the objective function, and must be implemente...
Abstract base class to be used to calculate the Jacobian of the inequality constraints.
ImplicitSystem Parent
The type of the parent.
virtual void solve() override
Solves the optimization problem.
The libMesh namespace provides an interface to certain functionality in the library.
Abstract base class to be used to calculate the inequality constraints.
virtual ~ComputeObjective()
virtual ~ComputeEqualityConstraintsJacobian()
Abstract base class to be used to calculate the Hessian of an objective function.
unsigned int number() const
virtual void init_data() override
Initializes new data members of the system.
virtual std::string system_type() const override
virtual ~ComputeHessian()
std::unique_ptr< NumericVector< Number > > lambda_ineq
std::unique_ptr< NumericVector< Number > > C_eq
The vector that stores equality constraints.
Abstract base class to be used to calculate the equality constraints.
Abstract base class to be used to calculate the lower and upper bounds for all dofs in the system.
virtual void gradient(const NumericVector< Number > &X, NumericVector< Number > &grad_f, sys_type &S)=0
This function will be called to compute the gradient of the objective function, and must be implement...
std::unique_ptr< SparseMatrix< Number > > C_ineq_jac
The sparse matrix that stores the Jacobian of C_ineq.
Abstract base class to be used to calculate the Jacobian of the equality constraints.
virtual ~ComputeLowerAndUpperBounds()
std::unique_ptr< OptimizationSolver< Number > > optimization_solver
The OptimizationSolver that is used for performing the optimization.
virtual void lower_and_upper_bounds(sys_type &S)=0
This function should update the following two vectors: this->get_vector("lower_bounds"),...
std::vector< std::set< numeric_index_type > > ineq_constraint_jac_sparsity
virtual Number objective(const NumericVector< Number > &X, sys_type &S)=0
This function will be called to compute the objective function to be minimized, and must be implement...
std::unique_ptr< SparseMatrix< Number > > C_eq_jac
The sparse matrix that stores the Jacobian of C_eq.
virtual void reinit() override
Reinitializes the member data fields associated with the system, so that, e.g., assemble() may be use...
Abstract base class to be used to calculate the objective function for optimization.
virtual void inequality_constraints_jacobian(const NumericVector< Number > &X, SparseMatrix< Number > &C_ineq_jac, sys_type &S)=0
This function will be called to evaluate the Jacobian of C_ineq(X).
Abstract base class to be used to calculate the gradient of an objective function.
This is the EquationSystems class.
std::vector< std::set< numeric_index_type > > eq_constraint_jac_sparsity
A copy of the equality and inequality constraint Jacobian sparsity patterns.
void initialize_equality_constraints_storage(const std::vector< std::set< numeric_index_type >> &constraint_jac_sparsity)
Initialize storage for the equality constraints, and the corresponding Jacobian.
Manages consistently variables, degrees of freedom, and coefficient vectors for explicit systems.
virtual void equality_constraints(const NumericVector< Number > &X, NumericVector< Number > &C_eq, sys_type &S)=0
This function will be called to evaluate the equality constraints vector C_eq(X).
std::unique_ptr< NumericVector< Number > > lambda_eq
Vectors to store the dual variables associated with equality and inequality constraints.
const std::string & name() const
virtual ~ComputeGradient()
virtual ~ComputeInequalityConstraints()
virtual ~ComputeInequalityConstraintsJacobian()
virtual void inequality_constraints(const NumericVector< Number > &X, NumericVector< Number > &C_ineq, sys_type &S)=0
This function will be called to evaluate the equality constraints vector C_ineq(X).
virtual ~ComputeEqualityConstraints()
virtual void clear() override
Clear all the data structures associated with the system.
virtual ~OptimizationSystem()
Destructor.