Subversion Repositories slepc-dev

Rev

Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1376 slepc 1
/*
2
       This file implements a wrapper to the ARPACK package
6 dsic.upv.es!jroman 3
 
1376 slepc 4
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1672 slepc 5
   SLEPc - Scalable Library for Eigenvalue Problem Computations
2575 eromero 6
   Copyright (c) 2002-2011, Universitat Politecnica de Valencia, Spain
1376 slepc 7
 
1672 slepc 8
   This file is part of SLEPc.
9
 
10
   SLEPc is free software: you can redistribute it and/or modify it under  the
11
   terms of version 3 of the GNU Lesser General Public License as published by
12
   the Free Software Foundation.
13
 
14
   SLEPc  is  distributed in the hope that it will be useful, but WITHOUT  ANY
15
   WARRANTY;  without even the implied warranty of MERCHANTABILITY or  FITNESS
16
   FOR  A  PARTICULAR PURPOSE. See the GNU Lesser General Public  License  for
17
   more details.
18
 
19
   You  should have received a copy of the GNU Lesser General  Public  License
20
   along with SLEPc. If not, see <http://www.gnu.org/licenses/>.
1376 slepc 21
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
6 dsic.upv.es!jroman 22
*/
1376 slepc 23
 
2293 jroman 24
#include <private/epsimpl.h>        /*I "slepceps.h" I*/
2298 jroman 25
#include <private/stimpl.h>         /*I "slepcst.h" I*/
2283 jroman 26
#include <../src/eps/impls/external/arpack/arpackp.h>
6 dsic.upv.es!jroman 27
 
1947 jroman 28
PetscErrorCode EPSSolve_ARPACK(EPS);
29
 
6 dsic.upv.es!jroman 30
#undef __FUNCT__  
31
#define __FUNCT__ "EPSSetUp_ARPACK"
476 dsic.upv.es!antodo 32
PetscErrorCode EPSSetUp_ARPACK(EPS eps)
6 dsic.upv.es!jroman 33
{
476 dsic.upv.es!antodo 34
  PetscErrorCode ierr;
1509 slepc 35
  PetscInt       ncv;
476 dsic.upv.es!antodo 36
  EPS_ARPACK     *ar = (EPS_ARPACK *)eps->data;
6 dsic.upv.es!jroman 37
 
38
  PetscFunctionBegin;
260 dsic.upv.es!antodo 39
  if (eps->ncv) {
2214 jroman 40
    if (eps->ncv<eps->nev+2) SETERRQ(((PetscObject)eps)->comm,1,"The value of ncv must be at least nev+2");
1220 slepc 41
  } else /* set default value of ncv */
1928 jroman 42
    eps->ncv = PetscMin(PetscMax(20,2*eps->nev+1),eps->n);
2499 jroman 43
  if (eps->mpd) { ierr = PetscInfo(eps,"Warning: parameter mpd ignored\n");CHKERRQ(ierr); }
1928 jroman 44
  if (!eps->max_it) eps->max_it = PetscMax(300,(PetscInt)(2*eps->n/eps->ncv));
1942 jroman 45
  if (!eps->which) eps->which = EPS_LARGEST_MAGNITUDE;
260 dsic.upv.es!antodo 46
 
6 dsic.upv.es!jroman 47
  ncv = eps->ncv;
48
#if defined(PETSC_USE_COMPLEX)
1040 slepc 49
  ierr = PetscFree(ar->rwork);CHKERRQ(ierr);
6 dsic.upv.es!jroman 50
  ierr = PetscMalloc(ncv*sizeof(PetscReal),&ar->rwork);CHKERRQ(ierr);
1645 slepc 51
  ar->lworkl = PetscBLASIntCast(3*ncv*ncv+5*ncv);
1040 slepc 52
  ierr = PetscFree(ar->workev);CHKERRQ(ierr);
6 dsic.upv.es!jroman 53
  ierr = PetscMalloc(3*ncv*sizeof(PetscScalar),&ar->workev);CHKERRQ(ierr);
54
#else
2331 jroman 55
  if (eps->ishermitian) {
1645 slepc 56
    ar->lworkl = PetscBLASIntCast(ncv*(ncv+8));
1220 slepc 57
  } else {
1645 slepc 58
    ar->lworkl = PetscBLASIntCast(3*ncv*ncv+6*ncv);
1040 slepc 59
    ierr = PetscFree(ar->workev);CHKERRQ(ierr);
6 dsic.upv.es!jroman 60
    ierr = PetscMalloc(3*ncv*sizeof(PetscScalar),&ar->workev);CHKERRQ(ierr);
61
  }
62
#endif
1040 slepc 63
  ierr = PetscFree(ar->workl);CHKERRQ(ierr);
6 dsic.upv.es!jroman 64
  ierr = PetscMalloc(ar->lworkl*sizeof(PetscScalar),&ar->workl);CHKERRQ(ierr);
1040 slepc 65
  ierr = PetscFree(ar->select);CHKERRQ(ierr);
2216 jroman 66
  ierr = PetscMalloc(ncv*sizeof(PetscBool),&ar->select);CHKERRQ(ierr);
1040 slepc 67
  ierr = PetscFree(ar->workd);CHKERRQ(ierr);
1928 jroman 68
  ierr = PetscMalloc(3*eps->nloc*sizeof(PetscScalar),&ar->workd);CHKERRQ(ierr);
6 dsic.upv.es!jroman 69
 
2499 jroman 70
  if (eps->extraction) { ierr = PetscInfo(eps,"Warning: extraction type ignored\n");CHKERRQ(ierr); }
1426 slepc 71
 
1940 jroman 72
  if (eps->balance!=EPS_BALANCE_NONE)
2214 jroman 73
    SETERRQ(((PetscObject)eps)->comm,PETSC_ERR_SUP,"Balancing not supported in the Arpack interface");
1819 jroman 74
 
1941 jroman 75
  ierr = EPSAllocateSolution(eps);CHKERRQ(ierr);
1231 slepc 76
  ierr = EPSDefaultGetWork(eps,2);CHKERRQ(ierr);
6 dsic.upv.es!jroman 77
 
1947 jroman 78
  /* dispatch solve method */
2214 jroman 79
  if (eps->leftvecs) SETERRQ(((PetscObject)eps)->comm,PETSC_ERR_SUP,"Left vectors not supported in this solver");
1947 jroman 80
  eps->ops->solve = EPSSolve_ARPACK;
6 dsic.upv.es!jroman 81
  PetscFunctionReturn(0);
82
}
83
 
84
#undef __FUNCT__  
85
#define __FUNCT__ "EPSSolve_ARPACK"
476 dsic.upv.es!antodo 86
PetscErrorCode EPSSolve_ARPACK(EPS eps)
6 dsic.upv.es!jroman 87
{
1089 slepc 88
  PetscErrorCode ierr;
2316 jroman 89
  EPS_ARPACK     *ar = (EPS_ARPACK *)eps->data;
2331 jroman 90
  char           bmat[1],howmny[] = "A";
2316 jroman 91
  const char     *which;
2331 jroman 92
  PetscBLASInt   n,iparam[11],ipntr[14],ido,info,nev,ncv,fcomm;
93
  PetscScalar    sigmar,*pV,*resid;
94
  Vec            x,y,w = eps->work[0];
2316 jroman 95
  Mat            A;
2331 jroman 96
  PetscBool      isSinv,isShift,rvec;
1229 slepc 97
#if !defined(PETSC_USE_COMPLEX)
98
  PetscScalar    sigmai = 0.0;
99
#endif
2316 jroman 100
 
6 dsic.upv.es!jroman 101
  PetscFunctionBegin;
1645 slepc 102
  nev = PetscBLASIntCast(eps->nev);
103
  ncv = PetscBLASIntCast(eps->ncv);
1515 slepc 104
  fcomm = PetscBLASIntCast(MPI_Comm_c2f(((PetscObject)eps)->comm));
1928 jroman 105
  n = PetscBLASIntCast(eps->nloc);
106
  ierr = VecCreateMPIWithArray(((PetscObject)eps)->comm,eps->nloc,PETSC_DECIDE,PETSC_NULL,&x);CHKERRQ(ierr);
107
  ierr = VecCreateMPIWithArray(((PetscObject)eps)->comm,eps->nloc,PETSC_DECIDE,PETSC_NULL,&y);CHKERRQ(ierr);
6 dsic.upv.es!jroman 108
  ierr = VecGetArray(eps->V[0],&pV);CHKERRQ(ierr);
1941 jroman 109
  ierr = EPSGetStartVector(eps,0,eps->work[1],PETSC_NULL);CHKERRQ(ierr);
1231 slepc 110
  ierr = VecGetArray(eps->work[1],&resid);CHKERRQ(ierr);
6 dsic.upv.es!jroman 111
 
112
  ido  = 0;            /* first call to reverse communication interface */
113
  info = 1;            /* indicates a initial vector is provided */
114
  iparam[0] = 1;       /* use exact shifts */
1645 slepc 115
  iparam[2] = PetscBLASIntCast(eps->max_it);  /* maximum number of Arnoldi update iterations */
6 dsic.upv.es!jroman 116
  iparam[3] = 1;       /* blocksize */
117
  iparam[4] = 0;       /* number of converged Ritz values */
118
 
119
  /*
120
     Computational modes ([]=not supported):
121
            symmetric    non-symmetric    complex
122
        1     1  'I'        1  'I'         1  'I'
123
        2     3  'I'        3  'I'         3  'I'
124
        3     2  'G'        2  'G'         2  'G'
125
        4     3  'G'        3  'G'         3  'G'
126
        5   [ 4  'G' ]    [ 3  'G' ]
127
        6   [ 5  'G' ]    [ 4  'G' ]
128
   */
2092 jroman 129
  ierr = PetscTypeCompare((PetscObject)eps->OP,STSINVERT,&isSinv);CHKERRQ(ierr);
1229 slepc 130
  ierr = PetscTypeCompare((PetscObject)eps->OP,STSHIFT,&isShift);CHKERRQ(ierr);
131
  ierr = STGetShift(eps->OP,&sigmar);CHKERRQ(ierr);
132
  ierr = STGetOperators(eps->OP,&A,PETSC_NULL);CHKERRQ(ierr);
133
 
134
  if (isSinv) {
135
    /* shift-and-invert mode */
136
    iparam[6] = 3;
1358 slepc 137
    if (eps->ispositive) bmat[0] = 'G';
1229 slepc 138
    else bmat[0] = 'I';
1358 slepc 139
  } else if (isShift && eps->ispositive) {
1229 slepc 140
    /* generalized shift mode with B positive definite */
141
    iparam[6] = 2;
142
    bmat[0] = 'G';
143
  } else {
144
    /* regular mode */
145
    if (eps->ishermitian && eps->isgeneralized)
2214 jroman 146
      SETERRQ(((PetscObject)eps)->comm,PETSC_ERR_SUP,"Spectral transformation not supported by ARPACK hermitian solver");
1229 slepc 147
    iparam[6] = 1;
148
    bmat[0] = 'I';
6 dsic.upv.es!jroman 149
  }
150
 
151
#if !defined(PETSC_USE_COMPLEX)
152
    if (eps->ishermitian) {
91 dsic.upv.es!antodo 153
      switch(eps->which) {
2161 jroman 154
        case EPS_TARGET_MAGNITUDE:
91 dsic.upv.es!antodo 155
        case EPS_LARGEST_MAGNITUDE:  which = "LM"; break;
156
        case EPS_SMALLEST_MAGNITUDE: which = "SM"; break;
2161 jroman 157
        case EPS_TARGET_REAL:
91 dsic.upv.es!antodo 158
        case EPS_LARGEST_REAL:       which = "LA"; break;
159
        case EPS_SMALLEST_REAL:      which = "SA"; break;
2214 jroman 160
        default: SETERRQ(((PetscObject)eps)->comm,1,"Wrong value of eps->which");
91 dsic.upv.es!antodo 161
      }
176 dsic.upv.es!antodo 162
    } else {
163
#endif
91 dsic.upv.es!antodo 164
      switch(eps->which) {
2161 jroman 165
        case EPS_TARGET_MAGNITUDE:
91 dsic.upv.es!antodo 166
        case EPS_LARGEST_MAGNITUDE:  which = "LM"; break;
167
        case EPS_SMALLEST_MAGNITUDE: which = "SM"; break;
2161 jroman 168
        case EPS_TARGET_REAL:
91 dsic.upv.es!antodo 169
        case EPS_LARGEST_REAL:       which = "LR"; break;
170
        case EPS_SMALLEST_REAL:      which = "SR"; break;
2161 jroman 171
        case EPS_TARGET_IMAGINARY:
91 dsic.upv.es!antodo 172
        case EPS_LARGEST_IMAGINARY:  which = "LI"; break;
173
        case EPS_SMALLEST_IMAGINARY: which = "SI"; break;
2214 jroman 174
        default: SETERRQ(((PetscObject)eps)->comm,1,"Wrong value of eps->which");
91 dsic.upv.es!antodo 175
      }
176 dsic.upv.es!antodo 176
#if !defined(PETSC_USE_COMPLEX)
177
    }
178
#endif
179
 
740 dsic.upv.es!antodo 180
  do {
176 dsic.upv.es!antodo 181
 
182
#if !defined(PETSC_USE_COMPLEX)
183
    if (eps->ishermitian) {
2331 jroman 184
      ARsaupd_(&fcomm,&ido,bmat,&n,which,&nev,&eps->tol,
185
               resid,&ncv,pV,&n,iparam,ipntr,ar->workd,
186
               ar->workl,&ar->lworkl,&info,1,2);
176 dsic.upv.es!antodo 187
    }
188
    else {
2331 jroman 189
      ARnaupd_(&fcomm,&ido,bmat,&n,which,&nev,&eps->tol,
190
               resid,&ncv,pV,&n,iparam,ipntr,ar->workd,
191
               ar->workl,&ar->lworkl,&info,1,2);
6 dsic.upv.es!jroman 192
    }
193
#else
2331 jroman 194
    ARnaupd_(&fcomm,&ido,bmat,&n,which,&nev,&eps->tol,
195
             resid,&ncv,pV,&n,iparam,ipntr,ar->workd,
196
             ar->workl,&ar->lworkl,ar->rwork,&info,1,2);
6 dsic.upv.es!jroman 197
#endif
571 dsic.upv.es!antodo 198
 
1229 slepc 199
    if (ido == -1 || ido == 1 || ido == 2) {
200
      if (ido == 1 && iparam[6] == 3 && bmat[0] == 'G') {
201
        /* special case for shift-and-invert with B semi-positive definite*/
2330 jroman 202
        ierr = VecPlaceArray(x,&ar->workd[ipntr[2]-1]);CHKERRQ(ierr);
1229 slepc 203
      } else {
2330 jroman 204
        ierr = VecPlaceArray(x,&ar->workd[ipntr[0]-1]);CHKERRQ(ierr);
1229 slepc 205
      }
2330 jroman 206
      ierr = VecPlaceArray(y,&ar->workd[ipntr[1]-1]);CHKERRQ(ierr);
1229 slepc 207
 
208
      if (ido == -1) {
209
        /* Y = OP * X for for the initialization phase to
2316 jroman 210
           force the starting vector into the range of OP */
2330 jroman 211
        ierr = STApply(eps->OP,x,y);CHKERRQ(ierr);
1229 slepc 212
      } else if (ido == 2) {
213
        /* Y = B * X */
2330 jroman 214
        ierr = IPApplyMatrix(eps->ip,x,y);CHKERRQ(ierr);
1229 slepc 215
      } else { /* ido == 1 */
216
        if (iparam[6] == 3 && bmat[0] == 'G') {
217
          /* Y = OP * X for shift-and-invert with B semi-positive definite */
2316 jroman 218
          ierr = STAssociatedKSPSolve(eps->OP,x,y);CHKERRQ(ierr);
219
        } else if (iparam[6] == 2) {
1229 slepc 220
          /* X=A*X Y=B^-1*X for shift with B positive definite */
2316 jroman 221
          ierr = MatMult(A,x,y);CHKERRQ(ierr);
222
          if (sigmar != 0.0) {
223
            ierr = IPApplyMatrix(eps->ip,x,w);CHKERRQ(ierr);
1229 slepc 224
            ierr = VecAXPY(y,sigmar,w);CHKERRQ(ierr);
2316 jroman 225
          }
2330 jroman 226
          ierr = VecCopy(y,x);CHKERRQ(ierr);
1229 slepc 227
          ierr = STAssociatedKSPSolve(eps->OP,x,y);CHKERRQ(ierr);
2316 jroman 228
        } else  {
1229 slepc 229
          /* Y = OP * X */
2330 jroman 230
          ierr = STApply(eps->OP,x,y);CHKERRQ(ierr);        
2316 jroman 231
        }
1755 antodo 232
        ierr = IPOrthogonalize(eps->ip,0,PETSC_NULL,eps->nds,PETSC_NULL,eps->DS,y,PETSC_NULL,PETSC_NULL,PETSC_NULL);CHKERRQ(ierr);
6 dsic.upv.es!jroman 233
      }
1229 slepc 234
 
2330 jroman 235
      ierr = VecResetArray(x);CHKERRQ(ierr);
236
      ierr = VecResetArray(y);CHKERRQ(ierr);
742 dsic.upv.es!antodo 237
    } else if (ido != 99) {
2394 jroman 238
      SETERRQ1(((PetscObject)eps)->comm,1,"Internal error in ARPACK reverse comunication interface (ido=%d)\n",ido);
6 dsic.upv.es!jroman 239
    }
740 dsic.upv.es!antodo 240
 
241
  } while (ido != 99);
6 dsic.upv.es!jroman 242
 
243
  eps->nconv = iparam[4];
1223 slepc 244
  eps->its = iparam[2];
6 dsic.upv.es!jroman 245
 
2214 jroman 246
  if (info==3) { SETERRQ(((PetscObject)eps)->comm,1,"No shift could be applied in xxAUPD.\n"
740 dsic.upv.es!antodo 247
                           "Try increasing the size of NCV relative to NEV."); }
2214 jroman 248
  else if (info!=0 && info!=1) { SETERRQ1(((PetscObject)eps)->comm,PETSC_ERR_LIB,"Error reported by ARPACK subroutine xxAUPD (%d)",info);}
6 dsic.upv.es!jroman 249
 
393 dsic.upv.es!antodo 250
  rvec = PETSC_TRUE;
6 dsic.upv.es!jroman 251
 
740 dsic.upv.es!antodo 252
  if (eps->nconv > 0) {
6 dsic.upv.es!jroman 253
#if !defined(PETSC_USE_COMPLEX)
740 dsic.upv.es!antodo 254
    if (eps->ishermitian) {
2313 jroman 255
      ierr = EPSMonitor(eps,iparam[2],iparam[4],&ar->workl[ipntr[5]-1],eps->eigi,&ar->workl[ipntr[6]-1],eps->ncv);CHKERRQ(ierr);
2331 jroman 256
      ARseupd_ (&fcomm,&rvec,howmny,ar->select,eps->eigr,
257
                pV,&n,&sigmar,
258
                bmat,&n,which,&nev,&eps->tol,
259
                resid,&ncv,pV,&n,iparam,ipntr,ar->workd,
260
                ar->workl,&ar->lworkl,&info,1,1,2);
740 dsic.upv.es!antodo 261
    }
262
    else {
2313 jroman 263
      ierr = EPSMonitor(eps,iparam[2],iparam[4],&ar->workl[ipntr[5]-1],&ar->workl[ipntr[6]-1],&ar->workl[ipntr[7]-1],eps->ncv);CHKERRQ(ierr);
2331 jroman 264
      ARneupd_ (&fcomm,&rvec,howmny,ar->select,eps->eigr,eps->eigi,
265
                pV,&n,&sigmar,&sigmai,ar->workev,
266
                bmat,&n,which,&nev,&eps->tol,
267
                resid,&ncv,pV,&n,iparam,ipntr,ar->workd,
268
                ar->workl,&ar->lworkl,&info,1,1,2);
740 dsic.upv.es!antodo 269
    }
270
#else
2313 jroman 271
    ierr = EPSMonitor(eps,eps->its,iparam[4],&ar->workl[ipntr[5]-1],eps->eigi,(PetscReal*)&ar->workl[ipntr[7]-1],eps->ncv);CHKERRQ(ierr);
2331 jroman 272
    ARneupd_ (&fcomm,&rvec,howmny,ar->select,eps->eigr,
273
              pV,&n,&sigmar,ar->workev,
274
              bmat,&n,which,&nev,&eps->tol,
275
              resid,&ncv,pV,&n,iparam,ipntr,ar->workd,
276
              ar->workl,&ar->lworkl,ar->rwork,&info,1,1,2);
6 dsic.upv.es!jroman 277
#endif
2214 jroman 278
    if (info!=0) { SETERRQ1(((PetscObject)eps)->comm,PETSC_ERR_LIB,"Error reported by ARPACK subroutine xxEUPD (%d)",info); }
740 dsic.upv.es!antodo 279
  }
6 dsic.upv.es!jroman 280
 
2331 jroman 281
  ierr = VecRestoreArray(eps->V[0],&pV);CHKERRQ(ierr);
282
  ierr = VecRestoreArray(eps->work[1],&resid);CHKERRQ(ierr);
283
  if (eps->nconv >= eps->nev) eps->reason = EPS_CONVERGED_TOL;
740 dsic.upv.es!antodo 284
  else eps->reason = EPS_DIVERGED_ITS;
6 dsic.upv.es!jroman 285
 
286
  if (eps->ishermitian) {
287
    ierr = PetscMemcpy(eps->errest,&ar->workl[ipntr[8]-1],eps->nconv);CHKERRQ(ierr);
288
  } else {
289
    ierr = PetscMemcpy(eps->errest,&ar->workl[ipntr[10]-1],eps->nconv);CHKERRQ(ierr);
290
  }
291
 
2305 jroman 292
  ierr = VecDestroy(&x);CHKERRQ(ierr);
293
  ierr = VecDestroy(&y);CHKERRQ(ierr);
6 dsic.upv.es!jroman 294
  PetscFunctionReturn(0);
295
}
296
 
297
#undef __FUNCT__  
176 dsic.upv.es!antodo 298
#define __FUNCT__ "EPSBackTransform_ARPACK"
476 dsic.upv.es!antodo 299
PetscErrorCode EPSBackTransform_ARPACK(EPS eps)
176 dsic.upv.es!antodo 300
{
476 dsic.upv.es!antodo 301
  PetscErrorCode ierr;
2216 jroman 302
  PetscBool      isSinv;
176 dsic.upv.es!antodo 303
 
304
  PetscFunctionBegin;
2092 jroman 305
  ierr = PetscTypeCompare((PetscObject)eps->OP,STSINVERT,&isSinv);CHKERRQ(ierr);
1229 slepc 306
  if (!isSinv) {
307
    ierr = EPSBackTransform_Default(eps);CHKERRQ(ierr);
442 dsic.upv.es!antodo 308
  }
176 dsic.upv.es!antodo 309
  PetscFunctionReturn(0);
310
}
311
 
312
#undef __FUNCT__  
2348 jroman 313
#define __FUNCT__ "EPSReset_ARPACK"
314
PetscErrorCode EPSReset_ARPACK(EPS eps)
6 dsic.upv.es!jroman 315
{
476 dsic.upv.es!antodo 316
  PetscErrorCode ierr;
317
  EPS_ARPACK     *ar = (EPS_ARPACK *)eps->data;
6 dsic.upv.es!jroman 318
 
319
  PetscFunctionBegin;
1040 slepc 320
  ierr = PetscFree(ar->workev);CHKERRQ(ierr);
321
  ierr = PetscFree(ar->workl);CHKERRQ(ierr);
322
  ierr = PetscFree(ar->select);CHKERRQ(ierr);
323
  ierr = PetscFree(ar->workd);CHKERRQ(ierr);
6 dsic.upv.es!jroman 324
#if defined(PETSC_USE_COMPLEX)
1040 slepc 325
  ierr = PetscFree(ar->rwork);CHKERRQ(ierr);
6 dsic.upv.es!jroman 326
#endif
260 dsic.upv.es!antodo 327
  ierr = EPSDefaultFreeWork(eps);CHKERRQ(ierr);
1596 slepc 328
  ierr = EPSFreeSolution(eps);CHKERRQ(ierr);
6 dsic.upv.es!jroman 329
  PetscFunctionReturn(0);
330
}
331
 
2348 jroman 332
#undef __FUNCT__  
333
#define __FUNCT__ "EPSDestroy_ARPACK"
334
PetscErrorCode EPSDestroy_ARPACK(EPS eps)
335
{
336
  PetscErrorCode ierr;
337
 
338
  PetscFunctionBegin;
339
  ierr = PetscFree(eps->data);CHKERRQ(ierr);
340
  PetscFunctionReturn(0);
341
}
342
 
6 dsic.upv.es!jroman 343
EXTERN_C_BEGIN
344
#undef __FUNCT__  
345
#define __FUNCT__ "EPSCreate_ARPACK"
476 dsic.upv.es!antodo 346
PetscErrorCode EPSCreate_ARPACK(EPS eps)
6 dsic.upv.es!jroman 347
{
476 dsic.upv.es!antodo 348
  PetscErrorCode ierr;
6 dsic.upv.es!jroman 349
 
350
  PetscFunctionBegin;
2329 jroman 351
  ierr = PetscNewLog(eps,EPS_ARPACK,&eps->data);CHKERRQ(ierr);
503 dsic.upv.es!antodo 352
  eps->ops->setup                = EPSSetUp_ARPACK;
6 dsic.upv.es!jroman 353
  eps->ops->destroy              = EPSDestroy_ARPACK;
2348 jroman 354
  eps->ops->reset                = EPSReset_ARPACK;
176 dsic.upv.es!antodo 355
  eps->ops->backtransform        = EPSBackTransform_ARPACK;
503 dsic.upv.es!antodo 356
  eps->ops->computevectors       = EPSComputeVectors_Default;
6 dsic.upv.es!jroman 357
  PetscFunctionReturn(0);
358
}
359
EXTERN_C_END