xref: /petsc/src/snes/impls/fas/fasimpls.h (revision af0996ce37bc06907c37d8d91773840993d61e62)
1519f805aSKarl Rupp #if !defined(_SNES_FASIMPLS)
2421d9b32SPeter Brune #define _SNES_FASIMPLS
3421d9b32SPeter Brune 
4*af0996ceSBarry Smith #include <petsc/private/snesimpl.h>
5*af0996ceSBarry Smith #include <petsc/private/linesearchimpl.h>
6*af0996ceSBarry Smith #include <petsc/private/dmimpl.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 */
17ab8d36c9SPeter Brune   SNES smoothu;                                /* the SNES for presmoothing */
18ab8d36c9SPeter Brune   SNES smoothd;                                /* the SNES for postsmoothing */
1922c1e704SPeter Brune 
20421d9b32SPeter Brune   /* coarse grid correction objects */
216273346dSPeter Brune   SNES next;                                   /* the SNES instance for the next coarser level in the hierarchy */
22ab8d36c9SPeter Brune   SNES fine;                                   /* the finest SNES instance; used as a reference for prefixes */
236273346dSPeter Brune   SNES previous;                               /* the SNES instance for the next finer level in the hierarchy */
24421d9b32SPeter Brune   Mat  interpolate;                            /* interpolation */
25efe1f98aSPeter Brune   Mat  inject;                                 /* injection operator (unscaled) */
26421d9b32SPeter Brune   Mat  restrct;                                /* restriction operator */
27421d9b32SPeter Brune   Vec  rscale;                                 /* the pointwise scaling of the restriction operator */
28421d9b32SPeter Brune 
29ee78dd50SPeter Brune   /* method parameters */
30ee78dd50SPeter Brune   PetscInt    n_cycles;                        /* number of cycles on this level */
3107144faaSPeter Brune   SNESFASType fastype;                         /* FAS type */
32ee78dd50SPeter Brune   PetscInt    max_up_it;                       /* number of pre-smooths */
33ee78dd50SPeter Brune   PetscInt    max_down_it;                     /* number of post-smooth cycles */
34d1adcc6fSPeter Brune   PetscBool   usedmfornumberoflevels;          /* uses a DM to generate a number of the levels */
35928e959bSPeter Brune   PetscBool   full_downsweep;                  /* smooth on the initial full downsweep */
3687f44e3fSPeter Brune   PetscBool   continuation;                    /* sets the setup to default to continuation */
378c94862eSPeter Brune   PetscInt    full_stage;                      /* stage of the full cycle -- 0 is the upswing, 1 is the downsweep and final V-cycle */
386273346dSPeter Brune 
396273346dSPeter Brune   /* Galerkin FAS state */
406273346dSPeter Brune   PetscBool galerkin;                          /* use Galerkin formation of the coarse problem */
416273346dSPeter Brune   Vec       Xg;                                /* Galerkin solution projection */
426273346dSPeter Brune   Vec       Fg;                                /* Galerkin function projection */
436273346dSPeter Brune 
440dd27c6cSPeter Brune   /* if logging times for each level */
450dd27c6cSPeter Brune   PetscLogEvent eventsmoothsetup;              /* level setup */
460dd27c6cSPeter Brune   PetscLogEvent eventsmoothsolve;              /* level smoother solves */
470dd27c6cSPeter Brune   PetscLogEvent eventresidual;                 /* level residual evaluation */
480dd27c6cSPeter Brune   PetscLogEvent eventinterprestrict;           /* level interpolation and restriction */
490dd27c6cSPeter Brune 
508c94862eSPeter Brune 
51421d9b32SPeter Brune } SNES_FAS;
52421d9b32SPeter Brune 
53421d9b32SPeter Brune #endif
54