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

Add a cruller (twisted torus) geometry #450

Merged
merged 1 commit into from
Feb 10, 2025
Merged

Conversation

alexfikl
Copy link
Collaborator

@alexfikl alexfikl commented Feb 8, 2025

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:

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),
Copy link
Collaborator Author

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..

node_vertex_consistency_tolerance: float | bool | None = None,
unit_nodes: np.ndarray | None = None,
twist: Callable[[np.ndarray, np.ndarray], np.ndarray] | None = None,
Copy link
Collaborator Author

@alexfikl alexfikl Feb 8, 2025

Choose a reason for hiding this comment

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

Naming? :\

Copy link
Owner

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?

Copy link
Collaborator Author

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..

Copy link
Collaborator Author

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! 😁

Copy link
Owner

Choose a reason for hiding this comment

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

That's much better!

Copy link
Owner

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).)

node_vertex_consistency_tolerance: float | bool | None = None,
unit_nodes: np.ndarray | None = None,
twist: Callable[[np.ndarray, np.ndarray], np.ndarray] | None = None,
Copy link
Owner

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?

@inducer inducer merged commit b15327f into inducer:main Feb 10, 2025
13 checks passed
@alexfikl alexfikl deleted the cruller branch February 10, 2025 13:54
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