Skip to content

Commit

Permalink
Add magnetic fields of prisms (#17)
Browse files Browse the repository at this point in the history
Add forward modelling functions for the magnetic field of a single rectangular
prism on a single computation point. These are three functions for each
component of the magnetic field vector and one other `magnetic_field` function
that computes all three in a more optimal way. Make these functions to reuse
the kernel functions defined for the gravity forward modelling. Add symmetry
tests for the new functions, test if the magnetic field has zero divergance and
if the `magnetic_field` function generates the same output as the three other
functions. Rename `prism/_forward.py` to `prism/_gravity.py` and
`test_prism.py` to `test_prism_gravity.py`.
  • Loading branch information
santisoler authored Nov 19, 2022
1 parent a124ea8 commit 29090c4
Show file tree
Hide file tree
Showing 7 changed files with 1,439 additions and 3 deletions.
3 changes: 2 additions & 1 deletion choclo/prism/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"""
Kernels and forward modelling functions for rectangular prisms
"""
from ._forward import (
from ._gravity import (
gravity_e,
gravity_ee,
gravity_en,
Expand All @@ -31,3 +31,4 @@
kernel_u,
kernel_uu,
)
from ._magnetic import magnetic_e, magnetic_field, magnetic_n, magnetic_u
2 changes: 1 addition & 1 deletion choclo/prism/_forward.py → choclo/prism/_gravity.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# This code is part of the Fatiando a Terra project (https://www.fatiando.org)
#
"""
Forward modelling function for rectangular prisms
Gravity forward modelling functions for rectangular prisms
"""
import numpy as np
from numba import jit
Expand Down
Loading

0 comments on commit 29090c4

Please sign in to comment.