26 static int index_list[23] = {1, 2, 3, 4, 5, 6, 7, 9, 11, 14, 17, 21, 27, 34, 42, 53, 67, 84, 106, 133, 167, 211, 265};
46 int arnoldi(
const double scale,
const int p,
const double h,
const double* A,
const double* v,
const double* sc,
double* beta,
double* Vm,
double* Hm,
double* phiHm)
65 for (
int i = 0; i <= j; i++)
79 #ifndef CONST_TIME_STEP 88 store = Hm[(j - 1) *
STRIDE + j];
89 Hm[(j - 1) *
STRIDE + j] = 0.0;
92 memset(&Hm[j *
STRIDE], 0, (j + 2) *
sizeof(
double));
98 for (
int i = 1; i < p; i++)
101 memset(&Hm[(j + i) *
STRIDE], 0, (j + i + 2) *
sizeof(
double));
102 Hm[(j + i) *
STRIDE + (j + i - 1)] = 1.0;
118 err = h * (*beta) * fabs(store * phiHm[(j) *
STRIDE + (j) - 1]) *
sc_norm(&Vm[(j) *
NSP], sc);
121 Hm[(j - 1) *
STRIDE + j] = store;
125 #if defined(LOG_OUTPUT) && defined(EXACT_KRYLOV) 133 #ifdef CONST_TIME_STEP __device__ double dotproduct(const double *__restrict__ w, const double *__restrict__ Vm)
Performs the dot product of the w (NSP x 1) vector with the given subspace vector (NSP x 1) ...
__device__ void scale_subtract(const double s, const double *__restrict__ Vm, double *__restrict__ w)
Subtracts Vm scaled by s from w.
int expAc_variable(const int m, const double *A, const double c, double *phiA)
Compute the zeroth order Phi (exponential) matrix function. This is the regular matrix exponential...
Header definition for Jacobian vector multiplier, used in exponential integrators.
#define STRIDE
the matrix dimensions
A file generated by Scons that specifies various options to the solvers.
__device__ void scale_mult(const double s, const double *__restrict__ w, double *__restrict__ Vm)
Sets Vm to s * w.
int phiAc_variable(const int m, const double *A, const double c, double *phiA)
Compute the first order Phi (exponential) matrix function.
__device__ double normalize(const double *__restrict__ v, double *__restrict__ v_out)
Normalize the input vector using a 2-norm.
Header for Matrix exponential (phi) methods.
void sparse_multiplier(const double *A, const double *Vm, double *w)
Implements Jacobian \ vector multiplication in sparse (or unrolled) form.
__device__ void scale(const double *__restrict__ y0, const double *__restrict__ y1, double *__restrict__ sc)
Get scaling for weighted norm.
simple convenience file to include the correct solver properties file
static int index_list[23]
The list of indicies to check the Krylov projection error at.
static int arnoldi(const double scale, const int p, const double h, const double *A, const double *v, const double *sc, double *beta, double *Vm, double *Hm, double *phiHm)
Runs the arnoldi iteration to calculate the Krylov projection.
__device__ double sc_norm(const double *__restrict__ nums, const double *__restrict__ sc)
Perform weighted norm.
Implementation of various linear algebra functions needed in the exponential integrators.
__device__ double two_norm(const double *__restrict__ v)
Computes and returns the two norm of a vector.