xref: /petsc/src/snes/impls/fas/fasimpls.h (revision 6a388c361ff2893f4363aecae9e02aa0b4e91a18)
1 #ifndef _SNES_FASIMPLS
2 #define _SNES_FASIMPLS
3 
4 #include <private/snesimpl.h>
5 #include <private/linesearchimpl.h>
6 #include <private/dmimpl.h>
7 #include <petscsnesfas.h>
8 
9 typedef struct {
10 
11   /* flags for knowing the global place of this FAS object */
12   PetscInt       level;                        /* level = 0 coarsest level */
13   PetscInt       levels;                       /* if level + 1 = levels; we're the last turtle */
14 
15   PetscViewer    monitor;                      /* debuggging output for FAS */
16 
17   /* smoothing objects */
18   SNES           upsmooth;                     /* the SNES for presmoothing */
19   SNES           downsmooth;                   /* the SNES for postsmoothing */
20 
21   LineSearch     linesearch_smooth;            /* the line search for default upsmoothing */
22   LineSearch     linesearch;                   /* the line search used to stabilize coarse corrections */
23 
24   /* coarse grid correction objects */
25   SNES           next;                         /* the SNES instance for the next coarser level in the hierarchy */
26   SNES           previous;                     /* the SNES instance for the next finer level in the hierarchy */
27   Mat            interpolate;                  /* interpolation */
28   Mat            inject;                       /* injection operator (unscaled) */
29   Mat            restrct;                      /* restriction operator */
30   Vec            rscale;                       /* the pointwise scaling of the restriction operator */
31 
32   /* method parameters */
33   PetscInt       n_cycles;                     /* number of cycles on this level */
34   SNESFASType    fastype;                      /* FAS type */
35   PetscInt       max_up_it;                    /* number of pre-smooths */
36   PetscInt       max_down_it;                  /* number of post-smooth cycles */
37   PetscBool      usedmfornumberoflevels;       /* uses a DM to generate a number of the levels */
38 
39   /* Galerkin FAS state */
40   PetscBool      galerkin;                     /* use Galerkin formation of the coarse problem */
41   Vec            Xg;                           /* Galerkin solution projection */
42   Vec            Fg;                           /* Galerkin function projection */
43 
44 } SNES_FAS;
45 
46 #endif
47