21 assert_true(fabs(
NU_V0(1, 1, 1e3) - 100*
NU_V0(1, 1, 1e5)) < 1e-6);
23 assert_true(fabs(10*
NU_V0(1, 0.1, 1e5) -
NU_V0(1, 1, 1e5)) < 1e-6);
25 assert_true(fabs(0.5*
NU_V0(0.5, 1, 1e5) -
NU_V0(1, 1, 1e5)) < 1e-6);
51 int64_t MaxID = 100000;
52 gsl_rng * g_rng = gsl_rng_alloc(gsl_rng_ranlxd1);
53 for (nsample=0; nsample < MaxID; nsample++)
56 double v2 = sqrt(Vel[0]*Vel[0]+Vel[1]*Vel[1]+Vel[2]*Vel[2]);
62 memset(Vel, 0, 3*
sizeof(
float));
67 assert_true(fabs(mean - 3*pow(M_PI,4)/90./1.202057*(7./8)/(3/4.)*100) < 1);
73 const struct CMUnitTest tests[] = {
77 return cmocka_run_group_tests_mpi(tests, NULL, NULL);
double fermi_dirac_cumprob[LENGTH_FERMI_DIRAC_TABLE]
double fermi_dirac_vel[LENGTH_FERMI_DIRAC_TABLE]
static void test_thermal_vel(void **state)
static void test_mean_velocity(void **state)
double NU_V0(const double Time, const double kBTNubyMNu, const double UnitVelocity_in_cm_per_s)
double init_thermalvel(struct thermalvel *thermals, const double v_amp, double max_fd, const double min_fd)
void add_thermal_speeds(struct thermalvel *thermals, gsl_rng *g_rng, float Vel[])
#define LENGTH_FERMI_DIRAC_TABLE