PISM, A Parallel Ice Sheet Model  stable v2.1.1 committed by Constantine Khrulev on 2024-12-04 13:36:58 -0900
Static Public Member Functions | Static Protected Member Functions | List of all members
pism::taoutil::TaoLCLCallbacks< Problem > Class Template Reference

Adaptor to connect a TAO objective function callback to a C++ object method. More...

#include <TaoUtil.hh>

Static Public Member Functions

static void connect (Tao tao, Problem &p, Vec c, Mat Jc, Mat Jd, Mat Jcpc=NULL, Mat Jcinv=NULL)
 

Static Protected Member Functions

static PetscErrorCode constraints_callback (Tao tao, Vec x, Vec c, void *ctx)
 
static PetscErrorCode jacobian_state_callback (Tao tao, Vec x, Mat J, Mat Jpc, Mat Jinv, void *ctx)
 
static PetscErrorCode jacobian_design_callback (Tao tao, Vec x, Mat J, void *ctx)
 

Detailed Description

template<class Problem>
class pism::taoutil::TaoLCLCallbacks< Problem >

Adaptor to connect a TAO objective function callback to a C++ object method.

The TAO library interfaces with user code via C-style callback functions. This class makes it convenient to associate a TAO Linearly Constrained Augmented Lagrangian (LCL) callbacks with C++ object methods. To assign

void MyObject::evaluateConstraints(Tao tao,Vec x,Vec c);
void MyObject::evaluateConstraintsJacobianState(Tao tao, Vec x, Mat *J, Mat *Jpc, Mat *Jinv, MatStructure *structure);
void MyObject::evaluateConstraintsJacobianDesign(Tao tao, Vec x, Mat *J);
const int J[]
Definition: ssafd_code.cc:34

as the LCL callbacks to a Tao tao,

MyObject obj;
TaoLCLCallback<MyObject>::connect(tao,obj);

The method names for the callback (evaluateConstraints, etc.) are hard-coded.

Definition at line 461 of file TaoUtil.hh.


The documentation for this class was generated from the following file: