1 /* Apache 2.0 INS-AMU 2015 */
9 double t
, *x
, *c
, *f
, *g
, *Jf
, *Jg
;
12 static SK_DEFSYS(test_sys
)
34 static SK_DEFSCH(test_sch
)
40 (*sys
)(sysd
, t
, nx
, x
, NULL
, NULL
, NULL
, NULL
, nc
, c
);
49 static SK_DEFOUT(test_out
)
57 static void test_hist_filler()
70 double x
[NX
], vd
[NX
], rand0
;
78 rand0
= rk_gauss(&rng
);
87 sk_solv_init(&solv
, &test_sys
, &sysd
,
88 &test_sch
, &schd
, &test_out
, &outd
,
89 &test_hist_filler
, NULL
, SEED
, NX
, x
, NC
, vi
, vd
,
92 sk_test_true(rand0
==rk_gauss(&solv
.rng
));
98 sk_test_true(schd
.n_calls
==1);
99 sk_test_true(schd
.dt
==DT
);
100 sk_test_true(schd
.rng
==&solv
.rng
);
102 sk_test_true(sysd
.n_calls
==1);
103 sk_test_true(sysd
.nx
==NX
);
104 sk_test_true(sysd
.nc
==NC
);
105 sk_test_true(sysd
.t
==T0
+DT
);
106 sk_test_true(sysd
.x
==solv
.x
);
107 sk_test_true(sysd
.c
==solv
.c
);
108 sk_test_true(sysd
.f
==NULL
);
109 sk_test_true(sysd
.g
==NULL
);
110 sk_test_true(sysd
.Jf
==NULL
);
111 sk_test_true(sysd
.Jg
==NULL
);
113 outd
.tf
= T0
+ 17 * DT
;
115 sk_test_true(sysd
.n_calls
==17);
116 sk_test_tol(sysd
.t
, outd
.tf
, 1e-15);