-
Notifications
You must be signed in to change notification settings - Fork 60
Utilities: Locate and square/circle intersection area #594
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
Conversation
For the utility unit tests that I added here, I had tried to set up a simpler GNUmakefile that would only build the relevant parts of the code, but for some reason I couldn't figure out, this was causing issues with CUDA. So I've reverted it to just use the standard @marchdf and @jrood-nrel - thoughts on the approach here for unit testing utilities? It's definitely not the prettiest but maybe it's good for now? |
I am fine with the slightly overly complicated gnumakefile for the unit tests. There's probably some needed amrex options that need to be set that aren't allowing you to remove as much as you would like... |
These functions are handy to have available for prob source files without needing to reimplement each time:
locate
: find the largest index that is less than an input value in a sorted array (used for interpolation). We have this implemented a few times across PeleC, PeleLMeX, and PelePhysics. I will collapse this to a single implementation for simplicity.rectangle_circle_intersection_area
: useful for problems with round uniform-velocity inlets, by computing the intersection area with a cell we can scale the inlet velocity accordingly rather than a binary based on whether the cell center is within the inlet. This allows a mss flow to be specified and kept constant regardless of the resolution with which the inlet is resolved (even if it is smaller than a single cell!)