oops, these were still 2D...
This commit is contained in:
parent
64d53cf72b
commit
cc3d16cf2c
|
|
@ -58,7 +58,7 @@ pub fn krist(space: &impl Metric, pos: Vec3) -> Tens3 {
|
|||
let d = space.part_derivs_at(pos);
|
||||
// ret[i][l][k] = sum((m) => .5f * g[m][i] * (d[k][l][m] + d[l][k][m] - d[m][k][l]))
|
||||
make_tens3(|i, l, k| {
|
||||
0.5 * (0..2)
|
||||
0.5 * (0..3)
|
||||
.map(|m| g.col(m)[i] * (d[l].col(k)[m] + d[k].col(m)[l] - d[m].col(k)[l]))
|
||||
.sum::<f32>()
|
||||
})
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ mod test {
|
|||
let pos = vec3(x, y, z);
|
||||
let computed = testee.part_derivs_at(pos);
|
||||
let reference = approx.part_derivs_at(pos);
|
||||
let eq = (0..2).all(|coord| computed[coord].abs_diff_eq(reference[coord], epsilon));
|
||||
let eq = (0..3).all(|coord| computed[coord].abs_diff_eq(reference[coord], epsilon));
|
||||
assert!(
|
||||
eq,
|
||||
"Bad derivative computation at {pos}:\n explicit: {computed:?}\n numerical: {reference:?}\n"
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user