Definition at line 45 of file function_evaluation.h.
#include <function_evaluation.h>
Public Member Functions | |
FunctionEvaluation (const libMesh::Parallel::Communicator &comm_in) | |
virtual | ~FunctionEvaluation () |
virtual void | _evaluate_wrapper (const std::vector< Real > &dvars, Real &obj, bool eval_obj_grad, std::vector< Real > &obj_grad, std::vector< Real > &fvals, std::vector< bool > &eval_grads, std::vector< Real > &grads) |
This serves as a wrapper around evaluate() and makes sure that the derived class's implementation is given the same design variable vector and returns the same values for specific parameters on all processors. More... | |
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 provides the same initialization to the design variable vector on all processors. More... | |
virtual void | _output_wrapper (unsigned int iter, const std::vector< Real > &x, Real obj, const std::vector< Real > &fval, bool if_write_to_optim_file) |
This serves as a wrapper around evaluate() and makes sure that the derived class's implementation is given the same design variable vector on all processors. More... | |
void | attach_optimization_interface (MAST::OptimizationInterface &opt) |
virtual void | evaluate (const std::vector< Real > &dvars, Real &obj, bool eval_obj_grad, std::vector< Real > &obj_grad, std::vector< Real > &fvals, std::vector< bool > &eval_grads, std::vector< Real > &grads)=0 |
grads(k) : Derivative of f_i(x) with respect to x_j, where k = (j-1)*M + i. More... | |
virtual void | init_dvar (std::vector< Real > &x, std::vector< Real > &xmin, std::vector< Real > &xmax)=0 |
void | initialize_dv_from_output_file (const std::string &nm, const unsigned int iter, std::vector< Real > &x) |
This reads and initializes the DV vector from a previous optimization history output file. More... | |
unsigned int | max_iters () const |
unsigned int | n_eq () const |
unsigned int | n_ineq () const |
unsigned int | n_iters_relative_change () const |
unsigned int | n_vars () const |
virtual void | output (unsigned int iter, const std::vector< Real > &x, Real obj, const std::vector< Real > &fval, bool if_write_to_optim_file) |
outputs the the current iterate to libMesh::out, and to the output file if it was set for this rank. More... | |
virtual void | parametric_line_study (const std::string &nm, const unsigned int iter1, const unsigned int iter2, unsigned int divs) |
computes a parametric evaluation along a line from iter1 to iter2 in file nm with divs runs between the two. More... | |
void | sanitize_parallel () |
make sure that the analysis is setup consistently across all parallel processes More... | |
void | set_output_file (const std::string &nm) |
sets the output file and the function evaluation will write the optimization iterates to this file. More... | |
Real | tolerance () const |
virtual bool | verify_gradients (const std::vector< Real > &dvars) |
verifies the gradients at the specified design point More... | |
Protected Attributes | |
unsigned int | _iter |
unsigned int | _max_iters |
unsigned int | _n_eq |
unsigned int | _n_ineq |
unsigned int | _n_rel_change_iters |
unsigned int | _n_vars |
MAST::OptimizationInterface * | _optimization_interface |
std::ofstream * | _output |
Real | _tol |
|
inline |
Definition at line 50 of file function_evaluation.h.
|
inlinevirtual |
Definition at line 63 of file function_evaluation.h.
|
virtual |
This serves as a wrapper around evaluate() and makes sure that the derived class's implementation is given the same design variable vector and returns the same values for specific parameters on all processors.
Definition at line 473 of file function_evaluation.cpp.
|
virtual |
This serves as a wrapper around init_dvar() and makes sure that the derived class's implementation provides the same initialization to the design variable vector on all processors.
Definition at line 459 of file function_evaluation.cpp.
|
virtual |
This serves as a wrapper around evaluate() and makes sure that the derived class's implementation is given the same design variable vector on all processors.
Definition at line 505 of file function_evaluation.cpp.
void MAST::FunctionEvaluation::attach_optimization_interface | ( | MAST::OptimizationInterface & | opt | ) |
Definition at line 32 of file function_evaluation.cpp.
|
pure virtual |
grads(k)
: Derivative of f_i(x) with respect to x_j, where k = (j-1)*M + i.
|
pure virtual |
void MAST::FunctionEvaluation::initialize_dv_from_output_file | ( | const std::string & | nm, |
const unsigned int | iter, | ||
std::vector< Real > & | x | ||
) |
This reads and initializes the DV vector from a previous optimization history output file.
This will verify that the optimization setup (number of DVs, constraints, etc.) are the same as the initialized data for this object and then read the dv values from iter
iteration into x
.
Definition at line 166 of file function_evaluation.cpp.
|
inline |
Definition at line 84 of file function_evaluation.h.
|
inline |
Definition at line 74 of file function_evaluation.h.
|
inline |
Definition at line 79 of file function_evaluation.h.
|
inline |
Definition at line 89 of file function_evaluation.h.
|
inline |
Definition at line 69 of file function_evaluation.h.
|
virtual |
outputs the the current iterate to libMesh::out, and to the output file if it was set for this rank.
Definition at line 41 of file function_evaluation.cpp.
|
virtual |
computes a parametric evaluation along a line from iter1
to iter2
in file nm
with divs
runs between the two.
Definition at line 409 of file function_evaluation.cpp.
void MAST::FunctionEvaluation::sanitize_parallel | ( | ) |
make sure that the analysis is setup consistently across all parallel processes
Definition at line 441 of file function_evaluation.cpp.
|
inline |
sets the output file and the function evaluation will write the optimization iterates to this file.
If this is not called no file will be created. The user may choose to set different file names on different ranks on the communicator, or set the output only on one of the ranks. Specifying the same filename on multiple ranks will lead to undefined behavior since all ranks will try to write to the same file.
Definition at line 125 of file function_evaluation.h.
|
inline |
Definition at line 94 of file function_evaluation.h.
|
virtual |
verifies the gradients at the specified design point
Definition at line 243 of file function_evaluation.cpp.
|
protected |
Definition at line 264 of file function_evaluation.h.
|
protected |
Definition at line 272 of file function_evaluation.h.
|
protected |
Definition at line 268 of file function_evaluation.h.
|
protected |
Definition at line 270 of file function_evaluation.h.
|
protected |
Definition at line 274 of file function_evaluation.h.
|
protected |
Definition at line 266 of file function_evaluation.h.
|
protected |
Definition at line 280 of file function_evaluation.h.
|
protected |
Definition at line 278 of file function_evaluation.h.
|
protected |
Definition at line 276 of file function_evaluation.h.