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

Sp reimplement #1211

Merged
merged 18 commits into from
Apr 27, 2023
Merged

Sp reimplement #1211

merged 18 commits into from
Apr 27, 2023

Conversation

jcapriot
Copy link
Member

@jcapriot jcapriot commented Apr 13, 2023

Summary

Reimplements the SP method in SimPEG.

PR Checklist

  • If this is a work in progress PR, set as a Draft PR
  • Linted my code according to the style guides.
  • Added tests to verify changes to the code.
  • Added necessary documentation to any new functions/classes following the
    expect style.
  • Added relevant method tags (i.e. GRAV, EM, etc.)
  • Marked as ready for review (ff this is was a draft PR), and converted
    to a Pull Request
  • Tagged @simpeg/simpeg-developers when ready for review.

What does this implement/fix?

This reimplements the SP code in SimPEG, making heavy use of the existing DC formulation. It is written that the q property is the model.

It also defines a few new maps that are specific to the SP methodology, one relating the secondary current density vector defined at cell-centers to q by taking the negative divergence of it. The second relates the hydraulic head to the q. These two maps are simple extensions of the LinearMap. Together with the simple formulation relating to q these should mimic all of the previous functionality of the SP code.

Additional information

I went back and forth deciding on the name of the module this lives, i.e. it is either spontaneous_potential or self_potential. I went in favor of spontaneous purely because the word self has a common meaning in python programming. But I'm happy either way.

@jcapriot jcapriot added the SP label Apr 13, 2023
@jcapriot jcapriot requested a review from sgkang April 13, 2023 19:31
@jcapriot
Copy link
Member Author

@sgkang Here is my implementation of the SP simulation. Very lightweight as it inherits almost everything from the DC Simulation.

from scipy.interpolate import NearestNDInterpolator, LinearNDInterpolator


def readSeepageModel(fname, mesh=None, xsurf=None, ysurf=None):
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure this has a place in SimPEG right now...

Copy link
Contributor

Choose a reason for hiding this comment

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

no need to bring this in.

@codecov
Copy link

codecov bot commented Apr 13, 2023

Codecov Report

Merging #1211 (ffbf663) into main (b3b2ca9) will decrease coverage by 0.19%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1211      +/-   ##
==========================================
- Coverage   81.99%   81.81%   -0.19%     
==========================================
  Files         159      162       +3     
  Lines       24411    24481      +70     
==========================================
+ Hits        20016    20028      +12     
- Misses       4395     4453      +58     
Impacted Files Coverage Δ
.../electromagnetics/static/resistivity/simulation.py 96.49% <100.00%> (+0.01%) ⬆️
...magnetics/static/spontaneous_potential/__init__.py 100.00% <100.00%> (ø)
...gnetics/static/spontaneous_potential/simulation.py 100.00% <100.00%> (ø)
...omagnetics/static/spontaneous_potential/sources.py 100.00% <100.00%> (ø)

... and 3 files with indirect coverage changes

Copy link
Contributor

@sgkang sgkang left a comment

Choose a reason for hiding this comment

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

Looking great. Your SP implementation is concise and elegant.
Played a little bit with the sparse inversion, and it seems working well.

It seemed the sensitivity (or Ainv) is not updated while inversion, but it would be nice if you could check.

It would be great to add some tutorials at least for each of three source types, and further replicate Craig's field example.

image

Above example is accessible through: https://curvenote.com/@sgkang09/researches/sp-3d-inv-charge.2

@jcapriot
Copy link
Member Author

Thanks Seogi for the review. I've made the requested updates and will pull this in. Feels good to not have the leftover pieces from before the simulation switchover in the codebase anymore!

We can add tutorials and such in another PR.

@jcapriot jcapriot merged commit 499b199 into simpeg:main Apr 27, 2023
15 of 16 checks passed
@jcapriot jcapriot deleted the SP_Reimplement branch April 27, 2023 20:52
@lheagy lheagy mentioned this pull request Apr 9, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants