Actual source code: mfnimpl.h

slepc-3.5.2 2014-10-10
Report Typos and Errors
  1: /*
  2:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  3:    SLEPc - Scalable Library for Eigenvalue Problem Computations
  4:    Copyright (c) 2002-2014, Universitat Politecnica de Valencia, Spain

  6:    This file is part of SLEPc.

  8:    SLEPc is free software: you can redistribute it and/or modify it under  the
  9:    terms of version 3 of the GNU Lesser General Public License as published by
 10:    the Free Software Foundation.

 12:    SLEPc  is  distributed in the hope that it will be useful, but WITHOUT  ANY
 13:    WARRANTY;  without even the implied warranty of MERCHANTABILITY or  FITNESS
 14:    FOR  A  PARTICULAR PURPOSE. See the GNU Lesser General Public  License  for
 15:    more details.

 17:    You  should have received a copy of the GNU Lesser General  Public  License
 18:    along with SLEPc. If not, see <http://www.gnu.org/licenses/>.
 19:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 20: */

 22: #if !defined(_MFNIMPL)
 23: #define _MFNIMPL

 25: #include <slepcmfn.h>
 26: #include <slepc-private/slepcimpl.h>

 28: PETSC_EXTERN PetscLogEvent MFN_SetUp, MFN_Solve;

 30: typedef struct _MFNOps *MFNOps;

 32: struct _MFNOps {
 33:   PetscErrorCode (*solve)(MFN,Vec,Vec);
 34:   PetscErrorCode (*setup)(MFN);
 35:   PetscErrorCode (*setfromoptions)(MFN);
 36:   PetscErrorCode (*publishoptions)(MFN);
 37:   PetscErrorCode (*destroy)(MFN);
 38:   PetscErrorCode (*reset)(MFN);
 39:   PetscErrorCode (*view)(MFN,PetscViewer);
 40: };

 42: /*
 43:      Maximum number of monitors you can run with a single MFN
 44: */
 45: #define MAXMFNMONITORS 5

 47: /*
 48:    Defines the MFN data structure.
 49: */
 50: struct _p_MFN {
 51:   PETSCHEADER(struct _MFNOps);
 52:   /*------------------------- User parameters ---------------------------*/
 53:   Mat            A;              /* the problem matrix */
 54:   PetscInt       max_it;         /* maximum number of iterations */
 55:   PetscInt       ncv;            /* number of basis vectors */
 56:   PetscReal      tol;            /* tolerance */
 57:   SlepcFunction  function;       /* which function to compute */
 58:   PetscScalar    sfactor;        /* scaling factor */
 59:   PetscBool      errorifnotconverged;    /* error out if MFNSolve() does not converge */

 61:   /*-------------- User-provided functions and contexts -----------------*/
 62:   PetscErrorCode (*monitor[MAXMFNMONITORS])(MFN,PetscInt,PetscReal,void*);
 63:   PetscErrorCode (*monitordestroy[MAXMFNMONITORS])(void**);
 64:   void           *monitorcontext[MAXMFNMONITORS];
 65:   PetscInt       numbermonitors;

 67:   /*----------------- Child objects and working data -------------------*/
 68:   DS             ds;             /* direct solver object */
 69:   BV             V;              /* set of basis vectors */
 70:   PetscRandom    rand;           /* random number generator */
 71:   PetscInt       nwork;          /* number of work vectors */
 72:   Vec            *work;          /* work vectors */
 73:   void           *data;          /* placeholder for solver-specific stuff */

 75:   /* ----------------------- Status variables -------------------------- */
 76:   PetscInt       its;            /* number of iterations so far computed */
 77:   PetscInt       nv;             /* size of current Schur decomposition */
 78:   PetscReal      errest;         /* error estimate */
 79:   PetscInt       setupcalled;
 80:   MFNConvergedReason reason;
 81: };

 83: #endif