26 if (!strcmp(
class,
_RK_)) {
29 params->
A = (
double*) calloc (params->
nstages*params->
nstages,
sizeof(
double));
30 params->
b = (
double*) calloc (params->
nstages ,
sizeof(
double));
31 params->
c = (
double*) calloc (params->
nstages ,
sizeof(
double));
36 }
else if (!strcmp(type,
_RK_22_)) {
38 params->
A = (
double*) calloc (params->
nstages*params->
nstages,
sizeof(
double));
39 params->
b = (
double*) calloc (params->
nstages ,
sizeof(
double));
40 params->
c = (
double*) calloc (params->
nstages ,
sizeof(
double));
46 params->
b[0] = params->
b[1] = 0.5;
47 }
else if (!strcmp(type,
_RK_33_)) {
49 params->
A = (
double*) calloc (params->
nstages*params->
nstages,
sizeof(
double));
50 params->
b = (
double*) calloc (params->
nstages ,
sizeof(
double));
51 params->
c = (
double*) calloc (params->
nstages ,
sizeof(
double));
55 params->
A[3] = 2.0/3.0; params->
A[6] = 2.0/3.0-1.0/4.0; params->
A[7] = 1.0/4.0;
56 params->
c[1] = 2.0/3.0; params->
c[2] = 2.0/3.0;
57 params->
b[0] = 1.0/4.0; params->
b[1] = -1.0/4.0; params->
b[2] = 1.0;
58 }
else if (!strcmp(type,
_RK_44_)) {
60 params->
A = (
double*) calloc (params->
nstages*params->
nstages,
sizeof(
double));
61 params->
b = (
double*) calloc (params->
nstages ,
sizeof(
double));
62 params->
c = (
double*) calloc (params->
nstages ,
sizeof(
double));
66 params->
A[4] = 0.5; params->
A[9] = 0.5; params->
A[14] = 1.0;
67 params->
c[1] = params->
c[2] = 0.5; params->
c[3] = 1.0;
68 params->
b[0] = 1.0/6.0; params->
b[1] = 1.0/3.0; params->
b[2] = 1.0/3.0; params->
b[3] = 1.0/6.0;
71 params->
A = (
double*) calloc (params->
nstages*params->
nstages,
sizeof(
double));
72 params->
b = (
double*) calloc (params->
nstages ,
sizeof(
double));
73 params->
c = (
double*) calloc (params->
nstages ,
sizeof(
double));
77 params->
A[3] = 1.0; params->
A[6] = 0.25; params->
A[7] = 0.25;
78 params->
c[1] = 1.0; params->
c[2] = 0.5;
79 params->
b[0] = params->
b[1] = 1.0/6.0; params->
b[2] = 2.0/3.0;
81 fprintf(stderr,
"Error in TimeExplicitRKInitialize(): %s is not a supported ",type);
82 fprintf(stderr,
"multi-stage time integration scheme of class %s.\n",
class);
86 fprintf(stderr,
"Error in TimeExplicitRKInitialize(): Code should not have ");
87 fprintf(stderr,
"reached here for %s class of time-integrators. This is a ",
class);
88 fprintf(stderr,
"coding mistake.\n");
#define _ArraySetValue_(x, size, value)
int TimeExplicitRKInitialize(char *, char *, void *, void *)
Structure containing the parameters for an explicit Runge-Kutta method.
Contains function declarations for time integration.
Some basic definitions and macros.
Contains macros and function definitions for common array operations.