Skip to content

Conversation

@patsytau
Copy link
Contributor

@patsytau patsytau commented Nov 15, 2024

In rescaleToUnit, the transformation is computed as a vector with three components, each 1/lengthScale. However, when computing the determinant of this, it results in a scaling of 1/lengthScale^3. Therefore compute the inverse scale as 1/std::cbrt(lengthScale).

Addresses #281

In rescaleToUnit, the transformation is computed as a vector with three components, each 1/lengthScale.
However, when computing the determinant of this, it results in a scaling of 1/lengthScale^3.
Therefore compute the inverse scale as 1/std::cbrt(lengthScale).
@patsytau
Copy link
Contributor Author

patsytau commented Nov 15, 2024

You may want to check this with something more substantial than the single cube I used ;)

@nmwsharp nmwsharp merged commit 0bcea11 into nmwsharp:master Dec 28, 2024
@nmwsharp
Copy link
Owner

Thank you for tracking this down and submitting a fix!! As you say there was a missing cube root after the determinant.

(I pushed a change to move the cube root to the lengthScale() computation, since the length scale should also be the non-cubed value).

I tested on a handful of other meshes and it seems to be working as expected. Merged! I'm hoping to deploy a new version of the Python bindings within the week; the fix will be propagated there then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants