Skip to content

Commit

Permalink
Fix naming in get fields
Browse files Browse the repository at this point in the history
  • Loading branch information
domfournier committed Dec 27, 2024
1 parent a472828 commit de9ee29
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 4 additions & 2 deletions simpeg/potential_fields/gravity/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def __init__(
self._sensitivity_gravity = _sensitivity_gravity_serial
self._forward_gravity = _forward_gravity_serial

def fields(self, m):
def fields(self, m=None):
"""
Forward model the gravity field of the mesh on the receivers in the survey
Expand All @@ -160,7 +160,9 @@ def fields(self, m):
Gravity fields generated by the given model on every receiver
location.
"""
self.model = m
if m is not None:
self.model = m

if self.store_sensitivities == "forward_only":
# Compute the linear operation without forming the full dense G
if self.engine == "choclo":
Expand Down
7 changes: 4 additions & 3 deletions simpeg/potential_fields/magnetics/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,10 @@ def M(self, M):
M = np.asarray(M)
self._M = M.reshape((self.nC, 3))

def fields(self, model):
self.model = model
# model = self.chiMap * model
def fields(self, m=None):
if m is not None:
self.model = m

if self.store_sensitivities == "forward_only":
if self.engine == "choclo":
fields = self._forward(self.chi)
Expand Down

0 comments on commit de9ee29

Please sign in to comment.