Date: 2026-08-31 Purpose: Index for BELFEM's optimization wrapper — a thin, NLOPT-backed interface for bound-constrained scalar minimization Module: src/numerics/opt
src/numerics/opt wraps NLOPT behind an interface that keeps NLOPT's headers out of the rest of the tree. A caller derives from Objective, passing the problem dimension to its constructor, hands it to an Optimizer, and reads a Status back — no nlopt.h anywhere above this directory.
It is built by default: src/numerics/CMakeLists.txt:5 adds the subdirectory, and USE_NLOPT defaults ON (CMakeLists.txt:103). The example executable opt is built only under USE_EXAMPLES AND USE_NLOPT.
Nothing in the FEM path calls it today. It is available infrastructure, not part of a solve.
| Class / file | Purpose |
|---|---|
| Optimizer (cl_Optimizer.hpp:38) | Owns bounds, tolerances and the algorithm choice; runs optimize(). Constructed from an Objective& and an Algorithm (:71) |
| Objective (cl_Objective.hpp:31) | Abstract base — construct it with the dimension (:40) and implement compute_objective() (:62). dimension() is a non-virtual accessor, not an override point |
| Algorithm (en_Opt_Algorithm.hpp:27) | Which NLOPT algorithm to use |
| Status (en_Opt_Status.hpp:26) | Why the solver stopped, without exposing NLOPT's own codes |
| opt.cpp | Worked example; built only with USE_EXAMPLES and USE_NLOPT |
Local, derivative-free — compute_objective() may ignore its gradient argument:
| NLOPT | Notes | |
|---|---|---|
| BOBYQA | LN_BOBYQA | quadratic model, bound constrained |
| COBYLA | LN_COBYLA | linear model, supports constraints |
| NELDERMEAD | LN_NELDERMEAD | simplex |
| SBPLX | LN_SBPLX | Rowan's subplex |
| PRAXIS | LN_PRAXIS | principal-axis |
Local, gradient-based — the implementation must fill the gradient:
| NLOPT | Notes | |
|---|---|---|
| MMA | LD_MMA | method of moving asymptotes |
| SLSQP | LD_SLSQP | sequential quadratic programming |
| LBFGS | LD_LBFGS | low-storage BFGS |
See Also: