1 /* Apache 2.0 INS-AMU 2015 */
7 double t
, *x
, *c
, *f
, *g
, *Jf
, *Jg
;
10 static SK_DEFSYS(test_sys
)
13 /* unused */ (void) Jce
; (void) hist
; (void) i
;
33 static SK_DEFSCH(test_sch
)
39 (*sys
)(sysd
, hist
, t
, 0, nx
, x
, NULL
, NULL
, NULL
, NULL
, nc
, c
, NULL
);
48 static SK_DEFOUT(test_out
)
51 /* unused */ (void) nc
; (void) c
;
57 static void test_hist_filler()
69 double x
[NX
], vd
[NX
], rand0
;
77 rand0
= rk_gauss(&rng
);
86 solv
= sk_solv_alloc();
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 EXPECT_EQ(rk_gauss(sk_solv_get_rng(solv
)), rand0
);
98 EXPECT_EQ(1,schd
.n_calls
);
99 EXPECT_EQ(DT
,schd
.dt
);
100 EXPECT_EQ(sk_solv_get_rng(solv
),schd
.rng
);
102 EXPECT_EQ(1,sysd
.n_calls
);
103 EXPECT_EQ(NX
,sysd
.nx
);
104 EXPECT_EQ(NC
,sysd
.nc
);
105 EXPECT_EQ(T0
,sysd
.t
);
106 EXPECT_EQ(T0
+DT
,sk_solv_get_t(solv
));
107 EXPECT_EQ(sk_solv_get_x(solv
),sysd
.x
);
108 EXPECT_EQ(sk_solv_get_c(solv
),sysd
.c
);
109 EXPECT_EQ(NULL
,sysd
.f
);
110 EXPECT_EQ(NULL
,sysd
.g
);
111 EXPECT_EQ(NULL
,sysd
.Jf
);
112 EXPECT_EQ(NULL
,sysd
.Jg
);
114 outd
.tf
= T0
+ 17 * DT
;
116 EXPECT_EQ(17,sysd
.n_calls
);
117 ASSERT_NEAR(sysd
.t
+DT
, outd
.tf
, 1e-14);