xref: /petsc/src/snes/impls/fas/fasimpls.h (revision 07144faae8d9ae592719efdbb82dce8f06715f56)
1421d9b32SPeter Brune #ifndef _SNES_FASIMPLS
2421d9b32SPeter Brune #define _SNES_FASIMPLS
3421d9b32SPeter Brune 
4421d9b32SPeter Brune #include <private/snesimpl.h>
5*ee78dd50SPeter Brune #include <private/dmimpl.h>
607144faaSPeter Brune #include <petscsnesfas.h>
7421d9b32SPeter Brune 
8421d9b32SPeter Brune typedef struct {
9421d9b32SPeter Brune 
10421d9b32SPeter Brune   /* flags for knowing the global place of this FAS object */
11421d9b32SPeter Brune   PetscInt       level;                        /* level = 0 coarsest level */
12421d9b32SPeter Brune   PetscInt       levels;                       /* if level + 1 = levels; we're the last turtle */
13421d9b32SPeter Brune 
14646217ecSPeter Brune   PetscViewer    monitor;                      /* debuggging output for FAS */
15421d9b32SPeter Brune 
16421d9b32SPeter Brune   /* smoothing objects */
17*ee78dd50SPeter Brune   SNES           upsmooth;                     /* the SNES for presmoothing */
18*ee78dd50SPeter Brune   SNES           downsmooth;                   /* the SNES for postsmoothing */
19421d9b32SPeter Brune 
20421d9b32SPeter Brune   /* coarse grid correction objects */
216273346dSPeter Brune   SNES           next;                         /* the SNES instance for the next coarser level in the hierarchy */
226273346dSPeter Brune   SNES           previous;                     /* the SNES instance for the next finer level in the hierarchy */
23421d9b32SPeter Brune   Mat            interpolate;                  /* interpolation */
24efe1f98aSPeter Brune   Mat            inject;                       /* injection operator (unscaled) */
25421d9b32SPeter Brune   Mat            restrct;                      /* restriction operator */
26421d9b32SPeter Brune   Vec            rscale;                       /* the pointwise scaling of the restriction operator */
27421d9b32SPeter Brune 
28*ee78dd50SPeter Brune   /* method parameters */
29*ee78dd50SPeter Brune   PetscInt       n_cycles;                     /* number of cycles on this level */
3007144faaSPeter Brune   SNESFASType    fastype;                      /* FAS type */
31*ee78dd50SPeter Brune   PetscInt       max_up_it;                    /* number of pre-smooths */
32*ee78dd50SPeter Brune   PetscInt       max_down_it;                  /* number of post-smooth cycles */
33d1adcc6fSPeter Brune   PetscBool      usedmfornumberoflevels;       /* uses a DM to generate a number of the levels */
346273346dSPeter Brune 
356273346dSPeter Brune   /* Galerkin FAS state */
366273346dSPeter Brune   PetscBool      galerkin;                     /* use Galerkin formation of the coarse problem */
376273346dSPeter Brune   Vec            Xg;                           /* Galerkin solution projection */
386273346dSPeter Brune   Vec            Fg;                           /* Galerkin function projection */
396273346dSPeter Brune 
40421d9b32SPeter Brune } SNES_FAS;
41421d9b32SPeter Brune 
42421d9b32SPeter Brune #endif
43