Skip to content

Commit

Permalink
fix elastic cfl and damp init
Browse files Browse the repository at this point in the history
  • Loading branch information
mloubout committed Nov 19, 2023
1 parent 83752f1 commit cf10579
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pysource/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def __init__(self, origin, spacing, shape, space_order=8, nbl=40, dtype=np.float
# Absorbing boundary layer
if self.nbl != 0:
# Create dampening field as symbol `damp`
self.damp = Function(name="damp", grid=self.grid)
self.damp = Function(name="damp", grid=self.grid, space_order=0)
initialize_damp(self.damp, self.padsizes, abc_type=abc_type, fs=fs)
self._physical_parameters = ['damp']
else:
Expand Down Expand Up @@ -409,7 +409,7 @@ def _cfl_coeff(self):
so = max(self._space_order // 2, 2)
coeffs = fd_w(1, range(-so, so), .5)
c_fd = sum(np.abs(coeffs[-1][-1])) / 2
return np.sqrt(self.dim) / self.dim / c_fd
return .9 * np.sqrt(self.dim) / self.dim / c_fd
a1 = 4 # 2nd order in time
so = max(self._space_order // 2, 4)
coeffs = fd_w(2, range(-so, so), 0)[-1][-1]
Expand Down Expand Up @@ -550,7 +550,7 @@ def __init__(self, tti, visco, elastic, spacing, fs, space_order, p_params):
self.dimensions = self.grid.dimensions

# Create the function for the physical parameters
self.damp = Function(name='damp', grid=self.grid)
self.damp = Function(name='damp', grid=self.grid, space_order=0)
for p in set(p_params) - {'damp'}:
setattr(self, p, Function(name=p, grid=self.grid, space_order=space_order))
if 'irho' not in p_params:
Expand Down

0 comments on commit cf10579

Please sign in to comment.