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

Vorticity confinement support #183

Open
Xayah-Hina opened this issue Jan 15, 2025 · 2 comments
Open

Vorticity confinement support #183

Xayah-Hina opened this issue Jan 15, 2025 · 2 comments

Comments

@Xayah-Hina
Copy link

Hi~ I noticed that field.curl for 3D is not yet supported, would this function to be supported in future version? thx~

# file '_field_math.py', line 647
def curl(field: Field, at='corner'):
    """
    Computes the finite-difference curl of the give 2D `StaggeredGrid`.

    Args:
        field: `Field`
        at: Either `center` or `face`.
    """
    assert 'vector' in field.shape, f"curl requires a vector field but got {field}"
    assert field.spatial_rank in (2, 3), "curl is only defined in 2 and 3 spatial dimensions."
    if field.is_grid and field.is_staggered and field.spatial_rank == 2 and at == 'corner':
......
    elif field.is_grid and field.is_centered and field.spatial_rank == 2 and at == 'corner':
...... 
    raise NotImplementedError("Only 2D curl at corner currently supported")
@holl-
Copy link
Collaborator

holl- commented Jan 15, 2025

Hi @Xayah-Hina Do you need this for staggered or centered grids, and sampled at the corners or centers?

@Xayah-Hina
Copy link
Author

Hi @Xayah-Hina Do you need this for staggered or centered grids, and sampled at the corners or centers?

Yes for staggered grids(velocity field) and centered grids(force fields). I also want some useful field operations like Helmholtz Decomposition for 3D vector fields. Is that possible to implement? thx~

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

No branches or pull requests

2 participants