static double form_volume(double length_a, double length_b, double length_c) { return length_a * length_b * length_c; } static double effective_radius(int mode, double length_a, double length_b, double length_c) { switch (mode) { case 1: // equivalent sphere return cbrt(0.75*length_a*length_b*length_c/M_PI); case 2: // half length_a return 0.5 * length_a; case 3: // half length_b return 0.5 * length_b; case 4: // half length_c return 0.5 * length_c; case 5: // equivalent circular cross-section return sqrt(length_a*length_b/M_PI); case 6: // half ab diagonal return 0.5*sqrt(length_a*length_a + length_b*length_b); case 7: // half diagonal return 0.5*sqrt(length_a*length_a + length_b*length_b + length_c*length_c); } } static void Fq(double q, double *F1, double *F2, double sld, double solvent_sld, double length_a, double length_b, double length_c) { const double mu = 0.5 * q * length_b; // Scale sides by B const double a_scaled = length_a / length_b; const double c_scaled = length_c / length_b; // outer integral (with gauss points), integration limits = 0, 1 double outer_total_F1 = 0.0; //initialize integral double outer_total_F2 = 0.0; //initialize integral for( int i=0; i