xref: /petsc/src/snes/impls/fas/fasimpls.h (revision 6273346d76c04da314646f01a57ee4ec0081c8d9)
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>
6421d9b32SPeter Brune 
7421d9b32SPeter Brune typedef struct {
8421d9b32SPeter Brune 
9421d9b32SPeter Brune   /* flags for knowing the global place of this FAS object */
10421d9b32SPeter Brune   PetscInt       level;                        /* level = 0 coarsest level */
11421d9b32SPeter Brune   PetscInt       levels;                       /* if level + 1 = levels; we're the last turtle */
12421d9b32SPeter Brune 
13646217ecSPeter Brune   PetscViewer    monitor;                      /* debuggging output for FAS */
14421d9b32SPeter Brune 
15421d9b32SPeter Brune   /* smoothing objects */
16*ee78dd50SPeter Brune   SNES           upsmooth;                     /* the SNES for presmoothing */
17*ee78dd50SPeter Brune   SNES           downsmooth;                   /* the SNES for postsmoothing */
18421d9b32SPeter Brune 
19421d9b32SPeter Brune   /* coarse grid correction objects */
206273346dSPeter Brune   SNES           next;                         /* the SNES instance for the next coarser level in the hierarchy */
216273346dSPeter Brune   SNES           previous;                     /* the SNES instance for the next finer level in the hierarchy */
22421d9b32SPeter Brune   Mat            interpolate;                  /* interpolation */
23efe1f98aSPeter Brune   Mat            inject;                       /* injection operator (unscaled) */
24421d9b32SPeter Brune   Mat            restrct;                      /* restriction operator */
25421d9b32SPeter Brune   Vec            rscale;                       /* the pointwise scaling of the restriction operator */
26421d9b32SPeter Brune 
27*ee78dd50SPeter Brune   /* method parameters */
28*ee78dd50SPeter Brune   PetscInt       n_cycles;                     /* number of cycles on this level */
29*ee78dd50SPeter Brune   PetscInt       max_up_it;                    /* number of pre-smooths */
30*ee78dd50SPeter Brune   PetscInt       max_down_it;                  /* number of post-smooth cycles */
31d1adcc6fSPeter Brune   PetscBool      usedmfornumberoflevels;       /* uses a DM to generate a number of the levels */
326273346dSPeter Brune 
336273346dSPeter Brune   /* Galerkin FAS state */
346273346dSPeter Brune   PetscBool      galerkin;                     /* use Galerkin formation of the coarse problem */
356273346dSPeter Brune   Vec            Xg;                           /* Galerkin solution projection */
366273346dSPeter Brune   Vec            Fg;                           /* Galerkin function projection */
376273346dSPeter Brune 
38421d9b32SPeter Brune } SNES_FAS;
39421d9b32SPeter Brune 
40421d9b32SPeter Brune #endif
41