FourierFlows / FourierFlows.jl

Tools for building fast, hackable, pseudospectral partial differential equation solvers on periodic domains
https://bit.ly/FourierFlows
MIT License
202 stars 29 forks source link

Grid refactor #330

Closed navidcy closed 1 year ago

navidcy commented 1 year ago

This PR introduces device as a field of the grid. Then Equation, Vars, Params, Problem, etc can infer the device from the grid.

This is a breaking change. Main change is that now only dev::Device is a positional argument in grid constructors; all other args are keyword arguments.

Closes #322.

Also, after #331 we don't load CUDA functionality conditionally so I moved contents of CuFourierFlows.jl next to where their CPU-equivalent methods are defined.

jbisits commented 1 year ago

Really neat to put dev into the grid struct. Makes it neater to just pass grid to a function like Vars to create variables on the right device. When this is merged I can update PassiveTracerFlows with this new structure.