27 extern void sninit_(
int* iPrint,
36 extern void sninitf_(
const char* printfile,
37 const char* summary_file,
47 extern void snspec_(
int* iSpecs,
56 extern void snspecf_(
const char* specsfile,
104 extern void npoptn_(
const char*,
int );
115 #if MAST_ENABLE_SNOPT == 0 116 libmesh_error_msg(
"MAST configured without SNOPT support.");
120 _exit_message[10] =
" The problem appears to be infeasible 20 The problem appears to be unbounded 30 Resource limit error";
121 _exit_message[40] =
" Terminated after numerical difficulties 50 Error in the user-supplied functions";
126 _exit_message[100] =
" Finished successfully (associated with SNOPT auxiliary routines) 110 Errors while processing MPS data";
127 _exit_message[120] =
" Errors while estimating Jacobian structure";
133 _info_message[3] =
"requested accuracy could not be achieved";
135 _info_message[12] =
"infeasible linear equality constraints";
138 _info_message[15] =
"infeasible linear constraints in QP subproblem";
147 _info_message[43] =
"cannot satisfy the general constraints";
151 _info_message[56] =
"irregular or badly scaled problem functions";
152 _info_message[61] =
"undefined function at the first feasible point";
153 _info_message[62] =
"undefined function at the initial point";
154 _info_message[63] =
"unable to proceed into undefined region";
156 _info_message[72] =
"terminated during constraint evaluation";
157 _info_message[73] =
"terminated during objective evaluation";
159 _info_message[81] =
"work arrays must have at least 500 elements";
164 _info_message[92] =
"basis file dimensions do not match this problem";
175 #if MAST_ENABLE_SNOPT == 1 179 libmesh_assert(
_funobj ==
nullptr);
180 libmesh_assert(
_funcon ==
nullptr);
182 _funobj = feval.get_objective_evaluation_function();
183 _funcon = feval.get_constraint_evaluation_function();
192 #if MAST_ENABLE_SNOPT == 1 207 NCTOTL = N+NCLIN+NCNLN,
208 LDA = std::max(NCLIN, 1),
209 LDJ = std::max(NCNLN, 1),
222 LENIW = std::max(1200*(NCTOTL+N) ,1000),
223 LENW = std::max(2400*(NCTOTL+N), 1000);
245 CLAMBDA (NCTOTL, 0.),
259 for (
unsigned int i=0; i<N; i++) {
266 for (
unsigned int i=0; i<NCNLN; i++) {
271 std::string cw(lencw*8,
' ');
286 snspec_(&iSpec, &INFORM, cw.c_str(), &lencw, &IW[0], &LENIW, &W[0], &LENW);
288 if (INFORM != 101) libmesh_error();
318 #endif // MAST_ENABLE_SNOPT 1 326 exit = (INFORM%10)*10;
332 <<
"SNOPT EXIT :" << exit << std::endl
334 <<
" INFO :" << INFORM << std::endl
void npopt_(int *n, int *nclin, int *ncnln, int *ldA, int *ldgg, int *ldH, double *A, double *bl, double *bu, void(*)(int *mode, int *ncnln, int *n, int *ldJ, int *needc, double *x, double *c, double *cJac, int *nstate), void(*)(int *mode, int *n, double *x, double *f, double *g, int *nstate), int *INFO, int *majIts, int *iState, double *fCon, double *gCon, double *cMul, double *fObj, double *gObj, double *Hess, double *x, int *iw, int *leniw, double *re, int *lenrw)
void sanitize_parallel()
make sure that the analysis is setup consistently across all parallel processes
void snspec_(int *iSpecs, int *INFO, const char *cw, int *lencw, int *iw, int *leniw, double *rw, int *lenrw)
void sninitf_(const char *printfile, const char *summary_file, int *iPrint, int *iSumm, const char *cw, int *lencw, int *iw, int *leniw, double *rw, int *lenrw)
std::map< int, std::string > _exit_message
void sninit_(int *iPrint, int *iSumm, const char *cw, int *lencw, int *iw, int *leniw, double *rw, int *lenrw)
void snspecf_(const char *specsfile, int *INFO, const char *cw, int *lencw, int *iw, int *leniw, double *rw, int *lenrw)
std::map< int, std::string > _info_message
unsigned int n_ineq() const
NPSOLOptimizationInterface()
virtual void attach_function_evaluation_object(MAST::FunctionEvaluation &feval)
Provides the basic interface API for classes the provide implement optimization problems.
virtual void attach_function_evaluation_object(MAST::FunctionEvaluation &feval)
void _print_termination_message(const int INFORM)
unsigned int n_vars() const
void(* _funobj)(int *mode, int *n, double *x, double *f, double *g, int *nstate)
void(* _funcon)(int *mode, int *ncnln, int *n, int *ldJ, int *needc, double *x, double *c, double *cJac, int *nstate)
MAST::FunctionEvaluation * _feval
virtual void _init_dvar_wrapper(std::vector< Real > &x, std::vector< Real > &xmin, std::vector< Real > &xmax)
This serves as a wrapper around init_dvar() and makes sure that the derived class's implementation pr...
unsigned int n_eq() const
void npoptn_(const char *, int)