-
Notifications
You must be signed in to change notification settings - Fork 24
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
Add a cruller (twisted torus) geometry #450
Conversation
meshmode/mesh/generation.py
Outdated
n_major=n_major, | ||
n_minor=n_minor, | ||
order=order, | ||
twist=lambda u, v: 1.0 + 0.25 * np.cos(5.0 * u + 3.0 * v), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't have knobs to actually tweak this, since I thought it's easy enough to use generate_torus_and_cycle_vertices
directly in that case. Maybe that 0.25
could be tweakable to control how strong the waviness is..
meshmode/mesh/generation.py
Outdated
node_vertex_consistency_tolerance: float | bool | None = None, | ||
unit_nodes: np.ndarray | None = None, | ||
twist: Callable[[np.ndarray, np.ndarray], np.ndarray] | None = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming? :\
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still trying to figure out what this even does... 🙂 "Twist" makes sense, but then what puts the "divets" into the surface?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, as it is now, it does some funky amplitude modulation on r_minor
, so maybe something more in that direction.. I don't know..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed it to r_minor_func
and added some docs to explain what it does. Any suggestions welcome! 😁
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's much better!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I previously thought "twist" would "twist" the u-v coordinate system (without shrinking the radius).)
meshmode/mesh/generation.py
Outdated
node_vertex_consistency_tolerance: float | bool | None = None, | ||
unit_nodes: np.ndarray | None = None, | ||
twist: Callable[[np.ndarray, np.ndarray], np.ndarray] | None = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still trying to figure out what this even does... 🙂 "Twist" makes sense, but then what puts the "divets" into the surface?
This just gently modifies
generate_torus_and_cycle_vertices
to allow creating the cruller geometry from https://doi.org/10.1016/j.jcp.2019.109047. Looks like this: