1*c2fc9fa9SBarry Smith #include <private/snesimpl.h> 2*c2fc9fa9SBarry Smith 3*c2fc9fa9SBarry Smith 4*c2fc9fa9SBarry Smith 5*c2fc9fa9SBarry Smith #define PetscScalarNorm(a,b) (PetscSqrtScalar((a)*(a)+(b)*(b))) 6*c2fc9fa9SBarry Smith /* 7*c2fc9fa9SBarry Smith Private context for semismooth newton method with line search for solving 8*c2fc9fa9SBarry Smith system of mixed complementarity equations 9*c2fc9fa9SBarry Smith */ 10*c2fc9fa9SBarry Smith 11*c2fc9fa9SBarry Smith #ifndef __SNES_VISS_H 12*c2fc9fa9SBarry Smith #define __SNES_VISS_H 13*c2fc9fa9SBarry Smith 14*c2fc9fa9SBarry Smith typedef struct { 15*c2fc9fa9SBarry Smith Vec phi; /* pointer to semismooth function */ 16*c2fc9fa9SBarry Smith PetscReal phinorm; /* 2-norm of the semismooth function */ 17*c2fc9fa9SBarry Smith PetscReal merit; /* Merit function */ 18*c2fc9fa9SBarry Smith Vec dpsi; /* Merit function gradient */ 19*c2fc9fa9SBarry Smith Vec Da; /* B sub-differential work vector (diag perturbation) */ 20*c2fc9fa9SBarry Smith Vec Db; /* B sub-differential work vector (row scaling) */ 21*c2fc9fa9SBarry Smith Vec z; /* B subdifferential work vector */ 22*c2fc9fa9SBarry Smith Vec t; /* B subdifferential work vector */ 23*c2fc9fa9SBarry Smith 24*c2fc9fa9SBarry Smith PetscScalar norm_d; /* two norm of the descent direction */ 25*c2fc9fa9SBarry Smith 26*c2fc9fa9SBarry Smith /* Copy of user supplied function evaluation routine */ 27*c2fc9fa9SBarry Smith PetscErrorCode (*computeuserfunction)(SNES,Vec,Vec,void*); 28*c2fc9fa9SBarry Smith /* user supplied function for checking redundant equations for SNESSolveVI_RS2 */ 29*c2fc9fa9SBarry Smith PetscErrorCode (*checkredundancy)(SNES,IS,IS*,void*); 30*c2fc9fa9SBarry Smith } SNES_VISS; 31*c2fc9fa9SBarry Smith 32*c2fc9fa9SBarry Smith #endif 33*c2fc9fa9SBarry Smith 34