Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Colorize hyper rectangle with simplices #16713

Merged

Conversation

nmuch
Copy link
Contributor

@nmuch nmuch commented Mar 4, 2024

No description provided.

Copy link
Member

@peterrum peterrum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/rebuild

Comment on lines 8795 to 8802
double epsilon = 10;
for (unsigned int i = 0; i < dim; ++i)
epsilon = std::min(epsilon,
0.01 * (std::abs(p2[i] - p1[i]) / repetitions[i]));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the right way to approach this. p2[i] - p1[i] is a quantity that depends on the magnitude of the points chosen as inputs, so it has physical units. But eps=10 does not. You need to start with an eps that has the right order of magnitude. Alternatively, you could start with eps=infinity, i.e., eps=std::numeric_limits<double>::max().

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. I'll use the numeric limits and update subdivided_hyper_rectangle() (without simplicies), too.

@nmuch nmuch force-pushed the colorize-hyper-rectangle-with-simplices branch from 4cc6a55 to ab2c3d5 Compare March 6, 2024 08:08
Copy link
Member

@kronbichler kronbichler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix, and thanks to @bangerth for noticing!

@bangerth
Copy link
Member

bangerth commented Mar 6, 2024

This looks right now. Thank you!

It would be nice to have a test that checks this. Do you know how to clone existing tests and add those?

@nmuch nmuch force-pushed the colorize-hyper-rectangle-with-simplices branch from 5280e54 to 13bd970 Compare March 7, 2024 13:56
@kronbichler kronbichler merged commit f84052e into dealii:master Mar 8, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants