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

Filter refactor #100

Open
navidcy opened this issue Jan 3, 2019 · 2 comments
Open

Filter refactor #100

navidcy opened this issue Jan 3, 2019 · 2 comments

Comments

@navidcy
Copy link
Member

navidcy commented Jan 3, 2019

After the ClockReplacesState #96 refactor we are now able to construct a module whose sol is an array of arrays of different types (see, for example, https://github.com/FourierFlows/GeophysicalFlows.jl/blob/96fbb1b7844da0aa35764769e487125ef4f4de5b/src/barotropicqg.jl#L167). This brings up the necessity to generalize the makefilter since at its current form it won't work with the BarotropicQG with U(t) as implemented in the branch above.

Actually, a better suggestion is to remove FilteredTimeSteppers all together and instead add the optional post-timestep application of a function poststep! to sol. This way the user can prescribe filters in the form of the solution within any module and then apply them, e.g., through

function poststep!(sol, params)
  @. sol *= params.filter
end
@glwagner
Copy link
Member

glwagner commented Jan 9, 2019

Except it should probably be

function poststep!(prob)
  @. prob.sol *= prob.params.filter
  nothing
end

@glwagner
Copy link
Member

glwagner commented Jun 1, 2021

Functions that are applied at the end of a time-step are sometimes referred to as "callbacks" in other contexts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants