|
|
#ifndef _STIMPL
|
#ifndef _STIMPL
|
#define _STIMPL
|
#define _STIMPL
|
|
|
#include "slepceps.h"
|
#include "slepceps.h"
|
|
|
extern PetscEvent ST_SetUp, ST_Apply, ST_ApplyB, ST_ApplyNoB, ST_ApplyTranspose, ST_InnerProduct;
|
extern PetscEvent ST_SetUp, ST_Apply, ST_ApplyB, ST_ApplyNoB, ST_ApplyTranspose, ST_InnerProduct;
|
extern PetscFList STList;
|
extern PetscFList STList;
|
|
|
typedef struct _STOps *STOps;
|
typedef struct _STOps *STOps;
|
|
|
struct _STOps {
|
struct _STOps {
|
int (*setup)(ST);
|
int (*setup)(ST);
|
int (*apply)(ST,Vec,Vec);
|
int (*apply)(ST,Vec,Vec);
|
int (*applyB)(ST,Vec,Vec);
|
int (*applyB)(ST,Vec,Vec);
|
int (*applynoB)(ST,Vec,Vec);
|
int (*applynoB)(ST,Vec,Vec);
|
int (*applytrans)(ST,Vec,Vec);
|
int (*applytrans)(ST,Vec,Vec);
|
int (*setshift)(ST,PetscScalar);
|
int (*setshift)(ST,PetscScalar);
|
int (*setfromoptions)(ST);
|
int (*setfromoptions)(ST);
|
int (*presolve)(ST);
|
|
int (*postsolve)(ST);
|
int (*postsolve)(ST);
|
int (*backtr)(ST,PetscScalar*,PetscScalar*);
|
int (*backtr)(ST,PetscScalar*,PetscScalar*);
|
int (*destroy)(ST);
|
int (*destroy)(ST);
|
int (*view)(ST,PetscViewer);
|
int (*view)(ST,PetscViewer);
|
};
|
};
|
|
|
struct _p_ST {
|
struct _p_ST {
|
PETSCHEADER(struct _STOps);
|
PETSCHEADER(struct _STOps);
|
/*------------------------- User parameters --------------------------*/
|
/*------------------------- User parameters --------------------------*/
|
Mat A,B; /* Matrices which define the eigensystem */
|
Mat A,B; /* Matrices which define the eigensystem */
|
PetscScalar sigma; /* Value of the shift */
|
PetscScalar sigma; /* Value of the shift */
|
STMatMode shift_matrix;
|
STMatMode shift_matrix;
|
STBilinearForm bilinear_form;
|
STBilinearForm bilinear_form;
|
MatStructure str; /* whether matrices have the same pattern or not */
|
MatStructure str; /* whether matrices have the same pattern or not */
|
Mat mat;
|
Mat mat;
|
|
|
/*------------------------- Misc data --------------------------*/
|
/*------------------------- Misc data --------------------------*/
|
KSP ksp;
|
KSP ksp;
|
Vec w;
|
Vec w;
|
void *data;
|
void *data;
|
int setupcalled;
|
int setupcalled;
|
int lineariterations;
|
int lineariterations;
|
int (*checknullspace)(ST,int,const Vec[]);
|
int (*checknullspace)(ST,int,const Vec[]);
|
|
|
/*------------------------- Cache Bx product -------------------*/
|
/*------------------------- Cache Bx product -------------------*/
|
PetscInt xid;
|
PetscInt xid;
|
PetscInt xstate;
|
PetscInt xstate;
|
Vec Bx;
|
Vec Bx;
|
};
|
};
|
|
|
EXTERN PetscErrorCode STRegisterAll(char*);
|
EXTERN PetscErrorCode STRegisterAll(char*);
|
EXTERN PetscErrorCode STRegister(const char*,const char*,const char*,int(*)(ST));
|
EXTERN PetscErrorCode STRegister(const char*,const char*,const char*,int(*)(ST));
|
#if defined(PETSC_USE_DYNAMIC_LIBRARIES)
|
#if defined(PETSC_USE_DYNAMIC_LIBRARIES)
|
#define STRegisterDynamic(a,b,c,d) STRegister(a,b,c,0)
|
#define STRegisterDynamic(a,b,c,d) STRegister(a,b,c,0)
|
#else
|
#else
|
#define STRegisterDynamic(a,b,c,d) STRegister(a,b,c,d)
|
#define STRegisterDynamic(a,b,c,d) STRegister(a,b,c,d)
|
#endif
|
#endif
|
|
|
EXTERN PetscErrorCode STApplyB_Default(ST,Vec,Vec);
|
EXTERN PetscErrorCode STApplyB_Default(ST,Vec,Vec);
|
EXTERN PetscErrorCode STView_Default(ST,PetscViewer);
|
EXTERN PetscErrorCode STView_Default(ST,PetscViewer);
|
EXTERN PetscErrorCode STAssociatedKSPSolve(ST,Vec,Vec);
|
EXTERN PetscErrorCode STAssociatedKSPSolve(ST,Vec,Vec);
|
EXTERN PetscErrorCode STAssociatedKSPSolveTranspose(ST,Vec,Vec);
|
EXTERN PetscErrorCode STAssociatedKSPSolveTranspose(ST,Vec,Vec);
|
EXTERN PetscErrorCode STCheckNullSpace_Default(ST,int,const Vec[]);
|
EXTERN PetscErrorCode STCheckNullSpace_Default(ST,int,const Vec[]);
|
EXTERN PetscErrorCode STMatShellCreate(ST st,Mat *mat);
|
EXTERN PetscErrorCode STMatShellCreate(ST st,Mat *mat);
|
|
|
#endif
|
#endif
|
|
|
|
|
|
|