Skip to content

Commit

Permalink
Computing L in 3D completed & tested
Browse files Browse the repository at this point in the history
FSM on rectilinear grid not accurate, disabled in python
  • Loading branch information
bernard-giroux committed Jan 25, 2024
1 parent 8096b29 commit 7820b5d
Show file tree
Hide file tree
Showing 16 changed files with 1,920,021 additions and 24 deletions.
20 changes: 13 additions & 7 deletions src/ttcrpy/rgrid.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,9 @@ cdef class Grid3d:

if compute_L and not self.cell_slowness:
raise NotImplementedError('compute_L defined only for grids with slowness defined for cells')

if compute_L and self.method == b'f':
raise NotImplementedError('compute_L defined for the FSM')

evID = None
if source.shape[1] == 5:
Expand Down Expand Up @@ -1085,6 +1088,7 @@ cdef class Grid3d:

# we build an array of matrices, for each event
L = []
NN = self.get_number_of_cells()
for n in range(nTx):
nnz = 0
for ni in range(l_data[n].size()):
Expand All @@ -1095,15 +1099,17 @@ cdef class Grid3d:

k = 0
MM = vRx[n].size()
NN = self.get_number_of_cells()
for i in range(MM):
indptr[i] = k
for j in range(NN):
for nn in range(l_data[n][i].size()):
if self._f2c_ind(l_data[n][i][nn].i) == j:
indices[k] = j
val[k] = l_data[n][i][nn].v
k += 1
# for j in range(NN):
for nn in range(l_data[n][i].size()):
indices[k] = self._f2c_ind(l_data[n][i][nn].i)
val[k] = l_data[n][i][nn].v
k += 1
# if self._f2c_ind(l_data[n][i][nn].i) == j:
# indices[k] = j
# val[k] = l_data[n][i][nn].v
# k += 1

indptr[MM] = k
L.append( sp.csr_matrix((val, indices, indptr), shape=(MM,NN)) )
Expand Down
Loading

0 comments on commit 7820b5d

Please sign in to comment.