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

Move Domain.dx to OnGrid.dx #135

Open
astanziola opened this issue Aug 3, 2023 · 0 comments
Open

Move Domain.dx to OnGrid.dx #135

astanziola opened this issue Aug 3, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@astanziola
Copy link
Member

astanziola commented Aug 3, 2023

The .dx attribute only make sense for fields defined on a grid, and can be uniquely found from the shape of OnGrid.params and the size of the domain.

It is much more natural to define the domain as

domain = Domain(size: tuple)

# Or, potentially
domain = Domain.from_grid(N, dx)

It would be even better to define domains that are not rectangular, for example

domain = Domain()  # Abstract domain

class RectangularDomain(Domain):
  L: tuple

class SphericalDomain(Domain):
  R: float

which then allows to define non standard discretizations. For example, Continuous can work on arbitrarily shaped domains, FourierSeries probably only makes sense on RectangularDomain while something like a SphericalFourierSeries (see for example s2fft) could be implemented on a SphericalDomain.

This is clearly a breaking change.

@astanziola astanziola added enhancement New feature or request question Further information is requested and removed question Further information is requested labels Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant