| Line 105... |
Line 105... |
/* Find the approximate eigenpairs from V */
|
/* Find the approximate eigenpairs from V */
|
PetscErrorCode (*calcPairs)(struct _dvdDashboard*);
|
PetscErrorCode (*calcPairs)(struct _dvdDashboard*);
|
void *calcPairs_data;
|
void *calcPairs_data;
|
|
|
/* Eigenpair test for convergence */
|
/* Eigenpair test for convergence */
|
PetscTruth (*testConv)(struct _dvdDashboard*, PetscScalar eigvr,
|
PetscBool (*testConv)(struct _dvdDashboard*, PetscScalar eigvr,
|
PetscScalar eigvi, PetscReal res, PetscReal *error);
|
PetscScalar eigvi, PetscReal res, PetscReal *error);
|
void *testConv_data;
|
void *testConv_data;
|
|
|
/* Number of converged eigenpairs */
|
/* Number of converged eigenpairs */
|
PetscInt nconv;
|
PetscInt nconv;
|
| Line 121... |
Line 121... |
PetscErrorCode (*improveX)(struct _dvdDashboard*, Vec *D, PetscInt max_size_D,
|
PetscErrorCode (*improveX)(struct _dvdDashboard*, Vec *D, PetscInt max_size_D,
|
PetscInt r_s, PetscInt r_e, PetscInt *size_D);
|
PetscInt r_s, PetscInt r_e, PetscInt *size_D);
|
void *improveX_data;
|
void *improveX_data;
|
|
|
/* Check for restarting */
|
/* Check for restarting */
|
PetscTruth (*isRestarting)(struct _dvdDashboard*);
|
PetscBool (*isRestarting)(struct _dvdDashboard*);
|
void *isRestarting_data;
|
void *isRestarting_data;
|
|
|
/* Perform restarting */
|
/* Perform restarting */
|
PetscErrorCode (*restartV)(struct _dvdDashboard*);
|
PetscErrorCode (*restartV)(struct _dvdDashboard*);
|
void *restartV_data;
|
void *restartV_data;
|
| Line 138... |
Line 138... |
Mat A, B; /* Problem matrices */
|
Mat A, B; /* Problem matrices */
|
MatType_t sA, sB; /* Matrix specifications */
|
MatType_t sA, sB; /* Matrix specifications */
|
EPType_t sEP; /* Problem specifications */
|
EPType_t sEP; /* Problem specifications */
|
PetscInt nev; /* number of eigenpairs */
|
PetscInt nev; /* number of eigenpairs */
|
EPSWhich which; /* spectrum selection */
|
EPSWhich which; /* spectrum selection */
|
PetscTruth
|
PetscBool
|
withTarget; /* if there is a target */
|
withTarget; /* if there is a target */
|
PetscScalar
|
PetscScalar
|
target[2]; /* target value */
|
target[2]; /* target value */
|
PetscReal tol; /* tolerance */
|
PetscReal tol; /* tolerance */
|
PetscTruth
|
PetscBool
|
correctXnorm; /* if true, tol < |r|/|x| */
|
correctXnorm; /* if true, tol < |r|/|x| */
|
|
|
/**** Subspaces specification ****/
|
/**** Subspaces specification ****/
|
Vec *V, /* searching subspace */
|
Vec *V, /* searching subspace */
|
*W, /* testing subspace */
|
*W, /* testing subspace */
|
| Line 328... |
Line 328... |
typedef void* dvdPrecondData; // DEPRECATED!!
|
typedef void* dvdPrecondData; // DEPRECATED!!
|
typedef PetscErrorCode (*dvdPrecond)(dvdDashboard*, PetscInt i, Vec x, Vec Px);
|
typedef PetscErrorCode (*dvdPrecond)(dvdDashboard*, PetscInt i, Vec x, Vec Px);
|
typedef PetscErrorCode (*dvdCallback)(dvdDashboard*);
|
typedef PetscErrorCode (*dvdCallback)(dvdDashboard*);
|
typedef PetscErrorCode (*e_Vchanged_type)(dvdDashboard*, PetscInt s_imm,
|
typedef PetscErrorCode (*e_Vchanged_type)(dvdDashboard*, PetscInt s_imm,
|
PetscInt e_imm, PetscInt s_new, PetscInt e_new);
|
PetscInt e_imm, PetscInt s_new, PetscInt e_new);
|
typedef PetscTruth (*isRestarting_type)(dvdDashboard*);
|
typedef PetscBool (*isRestarting_type)(dvdDashboard*);
|
typedef PetscErrorCode (*e_newIteration_type)(dvdDashboard*);
|
typedef PetscErrorCode (*e_newIteration_type)(dvdDashboard*);
|
typedef PetscErrorCode (*improveX_type)(dvdDashboard*, Vec *D, PetscInt max_size_D,
|
typedef PetscErrorCode (*improveX_type)(dvdDashboard*, Vec *D, PetscInt max_size_D,
|
PetscInt r_s, PetscInt r_e, PetscInt *size_D);
|
PetscInt r_s, PetscInt r_e, PetscInt *size_D);
|
|
|
/* Structures for blas */
|
/* Structures for blas */
|
| Line 391... |
Line 391... |
|
|
/* Routines for management of V */
|
/* Routines for management of V */
|
PetscErrorCode dvd_managementV_basic(dvdDashboard *d, dvdBlackboard *b,
|
PetscErrorCode dvd_managementV_basic(dvdDashboard *d, dvdBlackboard *b,
|
PetscInt bs, PetscInt max_size_V,
|
PetscInt bs, PetscInt max_size_V,
|
PetscInt mpd, PetscInt min_size_V,
|
PetscInt mpd, PetscInt min_size_V,
|
PetscInt plusk, PetscTruth harm,
|
PetscInt plusk, PetscBool harm,
|
PetscTruth allResiduals);
|
PetscBool allResiduals);
|
|
|
/* Some utilities */
|
/* Some utilities */
|
PetscErrorCode dvd_static_precond_PC(dvdDashboard *d, dvdBlackboard *b, PC pc);
|
PetscErrorCode dvd_static_precond_PC(dvdDashboard *d, dvdBlackboard *b, PC pc);
|
PetscErrorCode dvd_jacobi_precond(dvdDashboard *d, dvdBlackboard *b);
|
PetscErrorCode dvd_jacobi_precond(dvdDashboard *d, dvdBlackboard *b);
|
PetscErrorCode dvd_profiler(dvdDashboard *d, dvdBlackboard *b);
|
PetscErrorCode dvd_profiler(dvdDashboard *d, dvdBlackboard *b);
|
PetscErrorCode dvd_prof_init();
|
PetscErrorCode dvd_prof_init();
|
PetscErrorCode dvd_harm_conf(dvdDashboard *d, dvdBlackboard *b,
|
PetscErrorCode dvd_harm_conf(dvdDashboard *d, dvdBlackboard *b,
|
HarmType_t mode, PetscTruth fixedTarget,
|
HarmType_t mode, PetscBool fixedTarget,
|
PetscScalar t);
|
PetscScalar t);
|
|
|
/* Methods */
|
/* Methods */
|
PetscErrorCode dvd_schm_basic_preconf(dvdDashboard *d, dvdBlackboard *b,
|
PetscErrorCode dvd_schm_basic_preconf(dvdDashboard *d, dvdBlackboard *b,
|
PetscInt max_size_V, PetscInt mpd, PetscInt min_size_V, PetscInt bs,
|
PetscInt max_size_V, PetscInt mpd, PetscInt min_size_V, PetscInt bs,
|
PetscInt ini_size_V, PetscInt size_initV, PetscInt plusk, PC pc,
|
PetscInt ini_size_V, PetscInt size_initV, PetscInt plusk, PC pc,
|
HarmType_t harmMode, KSP ksp, InitType_t init, PetscTruth allResiduals);
|
HarmType_t harmMode, KSP ksp, InitType_t init, PetscBool allResiduals);
|
PetscErrorCode dvd_schm_basic_conf(dvdDashboard *d, dvdBlackboard *b,
|
PetscErrorCode dvd_schm_basic_conf(dvdDashboard *d, dvdBlackboard *b,
|
PetscInt max_size_V, PetscInt mpd, PetscInt min_size_V, PetscInt bs,
|
PetscInt max_size_V, PetscInt mpd, PetscInt min_size_V, PetscInt bs,
|
PetscInt ini_size_V, PetscInt size_initV, PetscInt plusk, PC pc,
|
PetscInt ini_size_V, PetscInt size_initV, PetscInt plusk, PC pc,
|
IP ip, HarmType_t harmMode, PetscTruth fixedTarget, PetscScalar t, KSP ksp,
|
IP ip, HarmType_t harmMode, PetscBool fixedTarget, PetscScalar t, KSP ksp,
|
PetscReal fix, InitType_t init, PetscTruth allResiduals);
|
PetscReal fix, InitType_t init, PetscBool allResiduals);
|
|
|
/* BLAS routines */
|
/* BLAS routines */
|
PetscErrorCode SlepcDenseMatProd(PetscScalar *C, PetscInt _ldC, PetscScalar b,
|
PetscErrorCode SlepcDenseMatProd(PetscScalar *C, PetscInt _ldC, PetscScalar b,
|
PetscScalar a,
|
PetscScalar a,
|
const PetscScalar *A, PetscInt _ldA, PetscInt rA, PetscInt cA, PetscTruth At,
|
const PetscScalar *A, PetscInt _ldA, PetscInt rA, PetscInt cA, PetscBool At,
|
const PetscScalar *B, PetscInt _ldB, PetscInt rB, PetscInt cB, PetscTruth Bt);
|
const PetscScalar *B, PetscInt _ldB, PetscInt rB, PetscInt cB, PetscBool Bt);
|
PetscErrorCode SlepcDenseMatProdTriang(
|
PetscErrorCode SlepcDenseMatProdTriang(
|
PetscScalar *C, MatType_t sC, PetscInt ldC,
|
PetscScalar *C, MatType_t sC, PetscInt ldC,
|
const PetscScalar *A, MatType_t sA, PetscInt ldA, PetscInt rA, PetscInt cA,
|
const PetscScalar *A, MatType_t sA, PetscInt ldA, PetscInt rA, PetscInt cA,
|
PetscTruth At,
|
PetscBool At,
|
const PetscScalar *B, MatType_t sB, PetscInt ldB, PetscInt rB, PetscInt cB,
|
const PetscScalar *B, MatType_t sB, PetscInt ldB, PetscInt rB, PetscInt cB,
|
PetscTruth Bt);
|
PetscBool Bt);
|
PetscErrorCode SlepcDenseMatInvProd(
|
PetscErrorCode SlepcDenseMatInvProd(
|
PetscScalar *A, PetscInt _ldA, PetscInt dimA,
|
PetscScalar *A, PetscInt _ldA, PetscInt dimA,
|
PetscScalar *B, PetscInt _ldB, PetscInt rB, PetscInt cB, PetscInt *auxI);
|
PetscScalar *B, PetscInt _ldB, PetscInt rB, PetscInt cB, PetscInt *auxI);
|
PetscErrorCode SlepcDenseNorm(PetscScalar *A, PetscInt ldA, PetscInt _rA,
|
PetscErrorCode SlepcDenseNorm(PetscScalar *A, PetscInt ldA, PetscInt _rA,
|
PetscInt cA, PetscScalar *eigi);
|
PetscInt cA, PetscScalar *eigi);
|
| Line 479... |
Line 479... |
PetscInt V_new_e, PetscScalar *auxS, Vec auxV,
|
PetscInt V_new_e, PetscScalar *auxS, Vec auxV,
|
PetscRandom rand);
|
PetscRandom rand);
|
PetscErrorCode dvd_compute_eigenvectors(PetscInt n_, PetscScalar *S,
|
PetscErrorCode dvd_compute_eigenvectors(PetscInt n_, PetscScalar *S,
|
PetscInt ldS_, PetscScalar *T, PetscInt ldT_, PetscScalar *pX,
|
PetscInt ldS_, PetscScalar *T, PetscInt ldT_, PetscScalar *pX,
|
PetscInt ldpX_, PetscScalar *pY, PetscInt ldpY_, PetscScalar *auxS,
|
PetscInt ldpX_, PetscScalar *pY, PetscInt ldpY_, PetscScalar *auxS,
|
PetscInt size_auxS, PetscTruth doProd);
|
PetscInt size_auxS, PetscBool doProd);
|
PetscErrorCode dvd_compute_eigenvalues(PetscInt n, PetscScalar *S,
|
PetscErrorCode dvd_compute_eigenvalues(PetscInt n, PetscScalar *S,
|
PetscInt ldS, PetscScalar *T, PetscInt ldT, PetscScalar *eigr,
|
PetscInt ldS, PetscScalar *T, PetscInt ldT, PetscScalar *eigr,
|
PetscScalar *eigi);
|
PetscScalar *eigi);
|
|
|
/* SLEPc interface routines */
|
/* SLEPc interface routines */
|
| Line 491... |
Line 491... |
PetscErrorCode EPSCreate_DAVIDSON(EPS eps);
|
PetscErrorCode EPSCreate_DAVIDSON(EPS eps);
|
PetscErrorCode EPSDestroy_DAVIDSON(EPS eps);
|
PetscErrorCode EPSDestroy_DAVIDSON(EPS eps);
|
PetscErrorCode EPSSetUp_DAVIDSON(EPS eps);
|
PetscErrorCode EPSSetUp_DAVIDSON(EPS eps);
|
PetscErrorCode EPSSolve_DAVIDSON(EPS eps);
|
PetscErrorCode EPSSolve_DAVIDSON(EPS eps);
|
PetscErrorCode EPSComputeVectors_QZ(EPS eps);
|
PetscErrorCode EPSComputeVectors_QZ(EPS eps);
|
PetscErrorCode EPSDAVIDSONSetKrylovStart_DAVIDSON(EPS eps,PetscTruth krylovstart);
|
PetscErrorCode EPSDAVIDSONSetKrylovStart_DAVIDSON(EPS eps,PetscBool krylovstart);
|
PetscErrorCode EPSDAVIDSONGetKrylovStart_DAVIDSON(EPS eps,PetscTruth *krylovstart);
|
PetscErrorCode EPSDAVIDSONGetKrylovStart_DAVIDSON(EPS eps,PetscBool *krylovstart);
|
PetscErrorCode EPSDAVIDSONSetBlockSize_DAVIDSON(EPS eps,PetscInt blocksize);
|
PetscErrorCode EPSDAVIDSONSetBlockSize_DAVIDSON(EPS eps,PetscInt blocksize);
|
PetscErrorCode EPSDAVIDSONGetBlockSize_DAVIDSON(EPS eps,PetscInt *blocksize);
|
PetscErrorCode EPSDAVIDSONGetBlockSize_DAVIDSON(EPS eps,PetscInt *blocksize);
|
PetscErrorCode EPSDAVIDSONSetRestart_DAVIDSON(EPS eps,PetscInt minv,PetscInt plusk);
|
PetscErrorCode EPSDAVIDSONSetRestart_DAVIDSON(EPS eps,PetscInt minv,PetscInt plusk);
|
PetscErrorCode EPSDAVIDSONGetRestart_DAVIDSON(EPS eps,PetscInt *minv,PetscInt *plusk);
|
PetscErrorCode EPSDAVIDSONGetRestart_DAVIDSON(EPS eps,PetscInt *minv,PetscInt *plusk);
|
PetscErrorCode EPSDAVIDSONGetInitialSize_DAVIDSON(EPS eps,PetscInt *initialsize);
|
PetscErrorCode EPSDAVIDSONGetInitialSize_DAVIDSON(EPS eps,PetscInt *initialsize);
|
| Line 508... |
Line 508... |
/**** Solver options ****/
|
/**** Solver options ****/
|
PetscInt blocksize, /* block size */
|
PetscInt blocksize, /* block size */
|
initialsize, /* initial size of V */
|
initialsize, /* initial size of V */
|
minv, /* size of V after restarting */
|
minv, /* size of V after restarting */
|
plusk; /* keep plusk eigenvectors from the last iteration */
|
plusk; /* keep plusk eigenvectors from the last iteration */
|
PetscTruth ipB; /* truth if V'B*V=I */
|
PetscBool ipB; /* true if V'B*V=I */
|
PetscInt method; /* method for improving the approximate solution */
|
PetscInt method; /* method for improving the approximate solution */
|
PetscReal fix; /* the fix parameter */
|
PetscReal fix; /* the fix parameter */
|
PetscTruth krylovstart; /* true if the starting subspace is a Krylov basis */
|
PetscBool krylovstart; /* true if the starting subspace is a Krylov basis */
|
|
|
/**** Solver data ****/
|
/**** Solver data ****/
|
dvdDashboard ddb;
|
dvdDashboard ddb;
|
|
|
/**** Things to destroy ****/
|
/**** Things to destroy ****/
|