1: #include <petsc-private/snesimpl.h>
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: */
11: #ifndef __SNES_VISS_H
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 */
24: PetscScalar norm_d; /* two norm of the descent direction */
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_VISS;
32: #endif