Actual source code: dvdtestconv.c

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

  6:    This file is part of SLEPc.
  7:    SLEPc is distributed under a 2-clause BSD license (see LICENSE).
  8:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  9: */
 10: /*
 11:    SLEPc eigensolver: "davidson"

 13:    Step: test for convergence
 14: */

 16: #include "davidson.h"

 18: static PetscBool dvd_testconv_slepc_0(dvdDashboard *d,PetscScalar eigvr,PetscScalar eigvi,PetscReal r,PetscReal *err)
 19: {
 20:   PetscFunctionBegin;
 21:   PetscCallAbort(PetscObjectComm((PetscObject)d->eps),(*d->eps->converged)(d->eps,eigvr,eigvi,r,err,d->eps->convergedctx));
 22:   PetscFunctionReturn(PetscNot(*err>=d->eps->tol));
 23: }

 25: PetscErrorCode dvd_testconv_slepc(dvdDashboard *d, dvdBlackboard *b)
 26: {
 27:   PetscFunctionBegin;
 28:   /* Setup the step */
 29:   if (b->state >= DVD_STATE_CONF) {
 30:     PetscCall(PetscFree(d->testConv_data));
 31:     d->testConv = dvd_testconv_slepc_0;
 32:   }
 33:   PetscFunctionReturn(PETSC_SUCCESS);
 34: }