25 boost::function<
MoFEMErrorCode(Tao tao, Vec x, PetscReal *objective)>;
29 Tao tao, Vec x, PetscReal *objective, Vec
gradient)>;
99 PetscLogEventRegister(
"LoopTAOEqualityConstraint", 0,
101 PetscLogEventRegister(
"LoopTAOInequalityConstraint", 0,
103 PetscLogEventRegister(
"LoopTAOEqualityJacobian", 0,
105 PetscLogEventRegister(
"LoopTAOInequalityJacobian", 0,
108 auto core_log = logging::core::get();
227 friend PetscErrorCode
TaoSetGradient(Tao tao, Vec x, Vec
g,
void *ctx);
230 friend PetscErrorCode
TaoSetHessian(Tao tao, Vec x, Mat
H, Mat Hpre,
239 Mat Jpre,
void *ctx);
247 PetscLogEvent log_event);
277PetscErrorCode
TaoSetObjective(Tao tao, Vec x, PetscReal *f,
void *ctx);
324PetscErrorCode
TaoSetHessian(Tao tao, Vec x, Mat
H, Mat Hpre,
void *ctx);
SmartPetscObj< Vec > gradient
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
const double c
speed of light (cm/ns)
FTensor::Index< 'J', DIM1 > J
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
implementation of Data Operators for Forces and Sources
PetscErrorCode TaoSetObjective(Tao tao, Vec x, PetscReal *f, void *ctx)
Sets the objective function value for a TAO optimization context.
PetscErrorCode TaoSetJacobianInequality(Tao tao, Vec x, Mat J, Mat Jpre, void *ctx)
Assemble the inequality constraint Jacobian.
PetscErrorCode TaoSetEqualityConstraints(Tao tao, Vec x, Vec c, void *ctx)
Evaluate equality constraints for a TAO optimization context.
PetscErrorCode TaoSetInequalityConstraints(Tao tao, Vec x, Vec c, void *ctx)
Evaluate inequality constraints for a TAO optimization context.
std::deque< BasicMethodPtr > BasicMethodsSequence
PetscErrorCode TaoSetJacobianEquality(Tao tao, Vec x, Mat J, Mat Jpre, void *ctx)
Assemble the equality constraint Jacobian.
std::deque< PairNameFEMethodPtr > FEMethodsSequence
PetscErrorCode TaoSetObjectiveAndGradient(Tao tao, Vec x, PetscReal *f, Vec g, void *ctx)
Sets the objective function value and gradient for a TAO optimization solver.
PetscErrorCode TaoSetGradient(Tao tao, Vec x, Vec f, void *ctx)
Sets the gradient vector for a TAO optimization context.
PetscErrorCode TaoSetHessian(Tao tao, Vec x, Mat H, Mat Hpre, void *ctx)
Sets the Hessian matrix for a TAO optimization context.
Deprecated interface functions.
static boost::shared_ptr< SinkType > createSink(boost::shared_ptr< std::ostream > stream_ptr, std::string comm_filter)
Create a sink object.
static boost::shared_ptr< std::ostream > getStrmWorld()
Get the strm world object.
static bool checkIfChannelExist(const std::string channel)
Check if channel exist.
Interface for TAO solvers.
TaoCtx(Interface &m_field, const std::string &problem_name)
MoFEMErrorCode copyLoops(const TaoCtx &tao_ctx)
Copy sequences from another TaoCtx.
FEMethodsSequence loopsInequalityJacobian
boost::movelib::unique_ptr< bool > vecAssembleSwitch
FEMethodsSequence & getInequalityJacobianLoops()
MoFEM::FEMethodsSequence FEMethodsSequence
BasicMethodsSequence & getPreProcEqualityConstraint()
MoFEM::Interface & mField
database Interface
moab::Interface & moab
moab Interface
FEMethodsSequence & getEqualityConstraintLoops()
virtual ~TaoCtx()=default
BasicMethodsSequence postInequalityConstraint
FEMethodsSequence & getGradientLoops()
PetscErrorCode evaluateConstraint(Tao tao, Vec x, Vec c, FEMethodsSequence &loops, BasicMethodsSequence &pre_process, BasicMethodsSequence &post_process, TaoMethod::TAOContext evaluation_context, PetscLogEvent log_event)
FEMethodsSequence & getInequalityConstraintLoops()
BasicMethodsSequence preEqualityJacobian
BasicMethodsSequence postObjective
Sequence of methods run after objective is evaluated.
BasicMethodsSequence & getPreProcGradient()
PetscLogEvent MOFEM_EVENT_TaoGradient
Log event for TAO Gradient.
BasicMethodsSequence preEqualityConstraint
friend PetscErrorCode TaoSetEqualityConstraints(Tao tao, Vec x, Vec c, void *ctx)
Evaluate equality constraints for a TAO optimization context.
friend PetscErrorCode TaoSetJacobianEquality(Tao tao, Vec x, Mat J, Mat Jpre, void *ctx)
Assemble the equality constraint Jacobian.
std::string problemName
problem name
BasicMethodsSequence & getPostProcGradient()
BasicMethodsSequence preInequalityConstraint
PetscLogEvent MOFEM_EVENT_TaoInequalityJacobian
BasicMethodsSequence & getPreProcEqualityJacobian()
BasicMethodsSequence & getPostProcObjective()
BasicMethodsSequence postEqualityConstraint
BasicMethodsSequence postGradient
Sequence of methods run after gradient is assembled.
PetscLogEvent MOFEM_EVENT_TaoHessian
Log event for TAO Hessian.
PetscErrorCode evaluateConstraintJacobian(Tao tao, Vec x, Mat J, Mat Jpre, FEMethodsSequence &loops, BasicMethodsSequence &pre_process, BasicMethodsSequence &post_process, TaoMethod::TAOContext evaluation_context, PetscLogEvent log_event)
BasicMethodsSequence & getPostProcInequalityConstraint()
boost::movelib::unique_ptr< bool > matAssembleSwitch
FEMethodsSequence loopsInequalityConstraint
FEMethodsSequence & getEqualityJacobianLoops()
BasicMethodsSequence preObjective
Sequence of methods run before objective is evaluated.
ObjectiveHook & getObjectiveHook()
Get an optional objective evaluator.
friend PetscErrorCode TaoSetHessian(Tao tao, Vec x, Mat H, Mat Hpre, void *ctx)
Sets the Hessian matrix for a TAO optimization context.
FEMethodsSequence loopsObjective
BasicMethodsSequence preGradient
Sequence of methods run before gradient is assembled.
GradientHook gradientHook
BasicMethodsSequence & getPostProcHessian()
PetscLogEvent MOFEM_EVENT_TaoEqualityJacobian
BasicMethodsSequence postEqualityJacobian
BasicMethodsSequence & getPostProcInequalityJacobian()
PetscLogEvent MOFEM_EVENT_TaoObjective
Log event for TAO Objective.
FEMethodsSequence loopsEqualityConstraint
BasicMethodsSequence & getPreProcInequalityJacobian()
PetscLogEvent MOFEM_EVENT_TaoInequalityConstraint
FEMethodsSequence & getObjectiveLoops()
friend PetscErrorCode TaoSetObjectiveAndGradient(Tao tao, Vec x, PetscReal *f, Vec g, void *ctx)
Sets the objective function value and gradient for a TAO optimization solver.
FEMethodsSequence & getHessianLoops()
ObjectiveAndGradientHook objectiveAndGradientHook
MoFEMErrorCode clearLoops()
Clear loops.
boost::function< MoFEMErrorCode(Tao tao, Vec x, PetscReal *objective)> ObjectiveHook
GradientHook & getGradientHook()
Get an optional gradient evaluator.
BasicMethodsSequence preInequalityJacobian
BasicMethodsSequence & getPostProcEqualityConstraint()
bool vErify
If true verify vector.
friend PetscErrorCode TaoSetObjective(Tao tao, Vec x, PetscReal *f, void *ctx)
Sets the objective function value for a TAO optimization context.
BasicMethodsSequence postHessian
Sequence of methods run after Hessian is assembled.
ObjectiveHook objectiveHook
BasicMethodsSequence & getPostProcEqualityJacobian()
BasicMethodsSequence preHessian
Sequence of methods run before Hessian is assembled.
friend PetscErrorCode TaoSetGradient(Tao tao, Vec x, Vec g, void *ctx)
Sets the gradient vector for a TAO optimization context.
FEMethodsSequence loopsEqualityJacobian
BasicMethodsSequence postInequalityJacobian
boost::function< MoFEMErrorCode(Tao tao, Vec x, PetscReal *objective, Vec gradient)> ObjectiveAndGradientHook
PetscLogEvent MOFEM_EVENT_TaoEqualityConstraint
FEMethodsSequence loopsGradient
friend PetscErrorCode TaoSetJacobianInequality(Tao tao, Vec x, Mat J, Mat Jpre, void *ctx)
Assemble the inequality constraint Jacobian.
BasicMethodsSequence & getPreProcObjective()
BasicMethodsSequence & getPreProcHessian()
boost::function< MoFEMErrorCode(Tao tao, Vec x, Vec gradient)> GradientHook
friend PetscErrorCode TaoSetInequalityConstraints(Tao tao, Vec x, Vec c, void *ctx)
Evaluate inequality constraints for a TAO optimization context.
ObjectiveAndGradientHook & getObjectiveAndGradientHook()
Get an optional combined objective-and-gradient evaluator.
BasicMethodsSequence & getPreProcInequalityConstraint()
MoFEM::BasicMethodsSequence BasicMethodsSequence
FEMethodsSequence loopsHessian
TAOContext
Context enumeration for TAO solver phases.