HPCSys-Lab/simwave

acoustic solver returns only one full snap

krober10nd opened this issue · 3 comments

  • MWE
 import numpy as np
 from pywave import *
 
 shape = (512, 512)
 spacing = (15.0, 15.0)
 time = 10000
 vel = Data(shape=shape)
 compiler = Compiler(program_version="sequential")
 grid = Grid(shape=vel.shape())
 
 src_points, src_values = get_source_points(
     grid_shape=shape, source_location=(30, 255.5), half_width=4
 )
 
 rec_points = np.array([], dtype=np.uint)
 rec_values = np.array([], dtype=np.float32)
 for i in range(512):
     points, values = get_source_points(
         grid_shape=shape, source_location=(30, i), half_width=4
     )
     rec_points = np.append(rec_points, points)
     rec_values = np.append(rec_values, values)
 
 setup = Setup(
     grid=grid,
     velocity=vel,
     origin=(255, 255.5),
     spacing=spacing,
     progatation_time=time,
     frequency=5.0,
     nbl=150,
     compiler=compiler,
     src_points_interval=src_points,
     src_points_values=src_values,
     rec_points_interval=rec_points,
     rec_points_values=rec_values,
     num_receivers=511,
 )
 
 solver = AcousticSolver(setup=setup)
 
 wavefields, rec, exec_time = solver.forward()

print(wavefields.shape)

wavefields.shape has the size of only one snap? Shouldn't this save all timesnaps?

Yes, It should. I disabled that in the C code (and python as wall), because I was testing a few things first. But I am gonna enable it again.

The solver now returns all (or less, according to the jump factor) snaps.

Confirmed fixed.