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