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.
The
.dx
attribute only make sense for fields defined on a grid, and can be uniquely found from the shape ofOnGrid.params
and the size of the domain.It is much more natural to define the domain as
It would be even better to define domains that are not rectangular, for example
which then allows to define non standard discretizations. For example,
Continuous
can work on arbitrarily shaped domains,FourierSeries
probably only makes sense onRectangularDomain
while something like aSphericalFourierSeries
(see for example s2fft) could be implemented on aSphericalDomain
.This is clearly a breaking change.