Skip to content

Vertically stretched Cartesian grid #47

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

Closed
ali-ramadhan opened this issue Feb 12, 2019 · 4 comments · Fixed by #543
Closed

Vertically stretched Cartesian grid #47

ali-ramadhan opened this issue Feb 12, 2019 · 4 comments · Fixed by #543
Assignees
Labels
feature 🌟 Something new and shiny

Comments

@ali-ramadhan
Copy link
Member

ali-ramadhan commented Feb 12, 2019

Current operators assume constant Δz which allow the model to use faster operators and use a tiny bit less space, so they'd have to be rewritten a tiny bit to account for a variable Δz when that gets implemented.

We can either write new operators that get dispatched on HorizontallyRegularCartesianGrid structs (already possible), or maybe the performance gain is so tiny that we just make RegularCartesianGrid a subset of HorizontallyRegularCartesianGrid and only have one set of operators.

HorizontallyRegularCartesianGrid might be a descriptive but pretty bad struct name.

@ali-ramadhan ali-ramadhan added the feature 🌟 Something new and shiny label Feb 12, 2019
@glwagner
Copy link
Member

Perhaps it makes sense to create a single issue for the addition of a new grid type, and keep track of all the various things that must be done to accommodate it there?

Note that this the addition of a new grid type doesn't create any problems in the code. The old functions will work just fine as-is provided you write new operators specifically for the new grid type.

@ali-ramadhan ali-ramadhan changed the title Operators will need to take into account varying Δz on a HorizontallyRegularCartesianGrid. Support for a HorizontallyRegularCartesianGrid that allows for variable Δz. Feb 12, 2019
@ali-ramadhan
Copy link
Member Author

Good idea. I'll do that here but I'll keep the Poisson solver separate as that's a pretty nontrivial part of this.

And yes, we'd just need some new operators but since they're so similar to the old operators I'm wondering if it might make more sense to just get the two grids to share the same operators to cut down on the amount of code that needs to be maintained.

RegularCartesianGrid might slow down a tiny bit but most simulations will want more resolution near the boundaries anyways so HorizontallyRegularCartesianGrid might end up being faster for all practical cases in either case.

@glwagner
Copy link
Member

I vote for writing new operators for new grid types. I think it makes sense to use the fastest algorithm available.

It is also potentially confusing to a future reader of the code if 'Δz' is --- unnecessarily --- an array of constants. I believe the code is clearer if the code structure, structs, etc reflect intent accurately and in detail. A regular grid has a constant Δz by definition; therefore, Δz should be a scalar.

You may find that regular grids have advantages and will be used often in the future. It is much easier to double the resolution of a regular grid, for example.

@ali-ramadhan
Copy link
Member Author

Good idea. I'll do that here but I'll keep the Poisson solver separate as that's a pretty nontrivial part of this.

And yes, we'd just need some new operators but since they're so similar to the old operators I'm wondering if it might make more sense to just get the two grids to share the same operators to cut down on the amount of code that needs to be maintained.

RegularCartesianGrid might slow down a tiny bit but most simulations will want more resolution near the boundaries anyways so HorizontallyRegularCartesianGrid might end up being faster for all practical cases in either case.

@ali-ramadhan ali-ramadhan self-assigned this Mar 6, 2019
@ali-ramadhan ali-ramadhan added this to the v0.5 milestone Mar 6, 2019
@ali-ramadhan ali-ramadhan modified the milestones: v0.5, v0.6, v0.7 Apr 3, 2019
@ali-ramadhan ali-ramadhan pinned this issue May 29, 2019
@ali-ramadhan ali-ramadhan changed the title Support for a HorizontallyRegularCartesianGrid that allows for variable Δz. Vertically stretched Cartesian grid Aug 2, 2019
@ali-ramadhan ali-ramadhan unpinned this issue Oct 18, 2019
@ali-ramadhan ali-ramadhan removed this from the Variable Δz grid milestone Oct 21, 2019
ali-ramadhan added a commit that referenced this issue Oct 19, 2020
Stop hard coding in gravity.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 🌟 Something new and shiny
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants