/// The repulsive part of the potential f(rho), but calculates rho from input distance vector
/// r, and unit normal n
The repulsive part of the potential f(rho), but calculates rho from input distance vector
r, and unit normal n
The repulsive part of the potential f ( rho ) but calculates rho from input distance vector r and unit normal n
fn crespi_f(params: &Params, distsq: f64, r: V3, n: V3) -> (f64, V3, V3) {
    // first we need the transverse distances (aka rho^2)
    let (rhosq, rhosq_d_r, rhosq_d_n) = rho_squared(distsq, r, n);
    // then we calculate f itself
    let (f, f_d_rhosq) = crespi_fp(params, rhosq);
    let value = f;
    let d_r = f_d_rhosq * rhosq_d_r;
    let d_n = f_d_rhosq * rhosq_d_n;
    (value, d_r, d_n)
}
fn crespi_f ( params : & Params , distsq : f64 , r : V3 , n : V3 ) -> ( f64 , V3 , V3 ) { // first we need the transverse distances (aka rho^2) let ( rhosq , rhosq_d_r , rhosq_d_n ) = rho_squared ( distsq , r , n ) ; // then we calculate f itself let ( f , f_d_rhosq ) = crespi_fp ( params , rhosq ) ; let value = f ; let d_r = f_d_rhosq * rhosq_d_r ; let d_n = f_d_rhosq * rhosq_d_n ; ( value , d_r , d_n ) }
The repulsive part of the potential f(rho), but calculates rho from input distance vector
r, and unit normal n
The repulsive part of the potential f ( rho ) but calculates rho from input distance vector r and unit normal n
params
&Params
distsq
f64
r
V3
n
V3