xref: /petsc/src/snes/impls/vi/ss/vissimpl.h (revision bebe2cf65d55febe21a5af8db2bd2e168caaa2e7)
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 #if !defined(__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   PetscScalar norm_d;              /* two norm of the descent direction */
24 
25   /* Copy of user supplied function evaluation routine  */
26   PetscErrorCode (*computeuserfunction)(SNES,Vec,Vec,void*);
27   /* user supplied function for checking redundant equations for SNESSolveVI_RS2 */
28   PetscErrorCode (*checkredundancy)(SNES,IS,IS*,void*);
29 } SNES_VINEWTONSSLS;
30 
31 #endif
32 
33