forked from Shallyn/pyWaveformGenerator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpRK4pdeIntegrator.h
67 lines (54 loc) · 2.48 KB
/
pRK4pdeIntegrator.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/**
* Writer: Xiaolin.liu
* xiaolin.liu@mail.bnu.edu.cn
*
* This module contains basic functions for calculation.
* Functions list:
* Kernel:
* 20xx.xx.xx, LOC
**/
#ifndef __INCLUDE_PRK4PDEINTEGRATOR__
#define __INCLUDE_PRK4PDEINTEGRATOR__
#include "pUtils.h"
#include <gsl/gsl_odeiv.h>
#include <gsl/gsl_spline.h>
typedef struct tagARKIntegrator
{
gsl_odeiv_step *step;
gsl_odeiv_control *control;
gsl_odeiv_evolve *evolve;
gsl_odeiv_system *sys;
int (* dydt) (double t, const double y[], double dydt[], void * params);
int (* stop) (double t, const double y[], double dydt[], void * params);
int retries; /* retries with smaller step when derivatives encounter singularity */
int stopontestonly; /* stop only on test, use tend to size buffers only */
int returncode;
} ARKIntegrator;
ARKIntegrator *XLALAdaptiveRungeKutta4Init(int dim,
int (*dydt) (double t, const double y[], double dydt[], void *params), /* These are XLAL functions! */
int (*stop) (double t, const double y[], double dydt[], void *params),
double eps_abs, double eps_rel);
void DestroyARKIntegrator(ARKIntegrator *integrator);
int XLALAdaptiveRungeKutta4NoInterpolate(ARKIntegrator * integrator,
void * params, REAL8 * yinit, REAL8 tinit, REAL8 tend,
REAL8 deltat_or_h0, REAL8 min_deltat_or_h0,
REAL8Array **t_and_y_out);
int XLALAdaptiveRungeKutta4NoInterpolateWithDeriv(ARKIntegrator * integrator,
void * params, REAL8 * yinit, REAL8 tinit, REAL8 tend,
REAL8 deltat_or_h0, REAL8 min_deltat_or_h0,
REAL8Array **t_and_y_and_dydt_out);
int XLALAdaptiveRungeKutta4NoInterpolateWithDerivPrec(ARKIntegrator * integrator,
void * params, REAL8 * yinit, REAL8 tinit, REAL8 tend,
REAL8 deltat_or_h0, REAL8 min_deltat_or_h0,
REAL8Array **t_and_y_and_dydt_out);
int XLALAdaptiveRungeKutta4WithDerivPrec(ARKIntegrator * integrator,
void * params, REAL8 * yinit, REAL8 tinit, REAL8 tend,
REAL8 deltat_or_h0, REAL8 min_deltat_or_h0,
REAL8Array **t_and_y_and_dydt_out);
int XLALAdaptiveRungeKutta4(ARKIntegrator * integrator,
void *params, REAL8 * yinit, REAL8 tinit, REAL8 tend,
REAL8 deltat, REAL8Array ** yout);
int XLALAdaptiveRungeKutta4WithDeriv(ARKIntegrator * integrator,
void *params, REAL8 * yinit, REAL8 tinit, REAL8 tend,
REAL8 deltat, REAL8Array ** yout);
#endif