File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
modules/createEVENT/Celeris/celeris Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -225,7 +225,7 @@ def __init__( # noqa: C901
225225 self .WaveType = WaveType # -1 to read from a file
226226 self .sine_wave = sine_wave
227227 self .data = np .zeros ((2 , 4 ))
228- self .N_data = 2
228+ self .N_data = 1
229229 self .W_data = None
230230 self .init_eta = init_eta
231231 self .amplitude = Amplitude
@@ -349,13 +349,17 @@ def get_data(self): # noqa: D102
349349 Returns:
350350 ti.field: A Taichi field of shape `(N_data, 4)` containing wave parameters.
351351 """
352+ data = None # noqa: N806
352353 if self .WaveType == - 1 :
353354 self .load_data ()
354355 data = ti .field (self .precision , shape = (self .N_data , 4 ))
355356 data .from_numpy (self .data )
356357 elif self .WaveType == 1 or self .WaveType == 2 :
357358 data = ti .field (self .precision , shape = (self .N_data , 4 ))
358359 data .from_numpy (np .array ([self .sine_wave ]))
360+ else :
361+ data = ti .field (self .precision , shape = (self .N_data , 4 ))
362+ data .from_numpy (np .array ([[0 , 0 , 0 , 0 ]]))
359363 return data
360364
361365
You can’t perform that action at this time.
0 commit comments