10 #include <gsl/gsl_integration.h>
11 #include <gsl/gsl_interp2d.h>
22 gsl_integration_workspace * gsl_work = gsl_integration_workspace_alloc(
GSL_WORKSPACE);
29 assert_true(fabs(imf_norm - 0.624632) < 0.01);
33 assert_true(fabs(agbyield / agbyield2 - 1) < 1e-3);
39 double agbmax, sniimax, abserr;
46 assert_true(sn1a < 1.3e-3);
48 message(0,
"agbyield %g max %g (in 200 Myr: %g)\n", agbyield, agbmax, agbyield3);
49 message(0,
"sniiyield %g max %g sn1a %g\n", sniiyield, sniimax, sn1a);
50 message(0,
"Total fraction of mass returned %g\n", (sniiyield + sn1a + agbyield)/imf_norm);
51 assert_true(agbyield < agbmax);
52 assert_true(sniiyield < sniimax);
53 assert_true((sniiyield + sn1a + agbyield)/imf_norm < 1.);
55 double masslow1, masshigh1;
56 double masslow2, masshigh2;
57 double masslowsum, masshighsum;
61 message(0,
"0 - 30: %g %g 30 - 60 %g %g 0 - 60 %g %g\n", masslow1, masshigh1, masslow2, masshigh2, masslowsum, masshighsum);
62 assert_true(fabs(masslow1 - masshigh2) < 0.01);
63 assert_true(fabs(masslowsum - masslow2) < 0.01);
67 const struct CMUnitTest tests[] = {
70 return cmocka_run_group_tests_mpi(tests, NULL, NULL);
void message(int where, const char *fmt,...)