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

examples: Add a notebook with a toy variable-z topography implementation #1900

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

EdCaunt
Copy link
Contributor

@EdCaunt EdCaunt commented Apr 12, 2022

I made a notebook with a simple implementation of a toy variable-z curvilinear acoustic model with a cosine hill. Still WIP, needs tidy-up and explanations, but lmk your thoughts

@EdCaunt EdCaunt added the examples examples label Apr 12, 2022
@EdCaunt EdCaunt self-assigned this Apr 12, 2022
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@codecov
Copy link

codecov bot commented Apr 12, 2022

Codecov Report

Merging #1900 (e18da51) into master (f80847e) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1900   +/-   ##
=======================================
  Coverage   87.08%   87.08%           
=======================================
  Files         223      223           
  Lines       39847    39847           
  Branches     5169     5169           
=======================================
  Hits        34702    34702           
  Misses       4568     4568           
  Partials      577      577           

@@ -0,0 +1,453 @@
{
Copy link
Contributor Author

@EdCaunt EdCaunt Mar 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line #9.    pdx2 = p.dx2+p.dx.dzeta*zeta_dx+(p.dx.dzeta+p.dzeta2*zeta_dx)*zeta_dx+p.dzeta*zeta_dxx

Would be better to use a .subs() here and substitute into the standard equation (better for complex transforms)


Reply via ReviewNB

@@ -0,0 +1,453 @@
{
Copy link
Contributor Author

@EdCaunt EdCaunt Mar 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line #18.        for i in range(f.space_order//2):

Use Mathias' free-surface with a SubDomain


Reply via ReviewNB

@EdCaunt EdCaunt force-pushed the variable_z_notebook branch from c67142c to 19e53be Compare June 7, 2023 15:48
@@ -0,0 +1,549 @@
{
Copy link
Contributor

@rhodrin rhodrin Jun 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line #5.    def zeta_derivs(lambdify=False):

Maybe split this into several smaller functions that are easily relatable to the mathematical explanation that should be added in the intro?


Reply via ReviewNB

@@ -0,0 +1,549 @@
{
Copy link
Contributor

@rhodrin rhodrin Jun 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should explain why this is the case. Also, may be worth referencing the subdomains notebook here.


Reply via ReviewNB

@@ -0,0 +1,549 @@
{
Copy link
Contributor

@rhodrin rhodrin Jun 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the mathematics is added up top should be able to express this in a clearer manner.


Reply via ReviewNB

@rhodrin
Copy link
Contributor

rhodrin commented Jun 9, 2023

Overall looks good. Just added some comments above that I think would help make it more easily digestible.

"cell_type": "markdown",
"metadata": {},
"source": [
"# Variable-z curvilinear topography\n",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, a comment didn't seem to appear in my earlier review?

In any case, I think the intro needs to go through the mathematics of what is being done here in a nice clear manner. The code below can then be related back to this as appropriate.

@@ -0,0 +1,549 @@
{
Copy link
Contributor

@georgebisbas georgebisbas Jun 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line #3.    s_o = 8  # Space order

For homgeneity to the rest of the codebase I would use so


Reply via ReviewNB

@@ -0,0 +1,549 @@
{
Copy link
Contributor

@georgebisbas georgebisbas Jun 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line #6.    # Set up the function and equations

..up the TimeFunction...?


Reply via ReviewNB

@@ -0,0 +1,549 @@
{
Copy link
Contributor

@georgebisbas georgebisbas Jun 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line #12.    # Looks just like the normal equation

What is the "normal" equation?


Reply via ReviewNB

@@ -0,0 +1,549 @@
{
Copy link
Contributor

@georgebisbas georgebisbas Jun 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line #15.    src.coordinates.data[0, -1] = 3*grid.extent[1]/4  # Set depth

Maybe you can explcitly set the depth here, instead of having (3/4)*


Reply via ReviewNB

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did it this way since the source is vertically positioned in the iteration space, rather than the physical space. Eventually it would be nice for sources to respect coordinate transforms so that one can position them in physical space on a curvilinear grid however

@EdCaunt EdCaunt force-pushed the variable_z_notebook branch from 19e53be to 64e1d7d Compare June 21, 2023 12:51
Copy link
Contributor

@FabioLuporini FabioLuporini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks GTG now. Approved.

Copy link
Contributor

@georgebisbas georgebisbas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also see my comments are resolved, I have nothing more to add.

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

Successfully merging this pull request may close these issues.

4 participants