oops, these were still 2D...

This commit is contained in:
numzero 2024-11-07 00:37:30 +03:00
parent 64d53cf72b
commit cc3d16cf2c
2 changed files with 2 additions and 2 deletions

View File

@ -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>()
})

View File

@ -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"