def update_d(self, u, dd): # print('inside_update_d ushape',u.shape) # print('inside_update_d fre grad ushape',freq_gradient(u).shape) out_dd = () for jj in range(0, len(dd)): if jj < 3: # derivative y # tmp_d =get_Diff(u,jj) out_dd = out_dd + (CsSolver.get_Diff(u, jj),) elif jj == 3: # rho tmpu = numpy.copy(u) tmpu = scipy.fftpack.fftn(tmpu, axes=(2,)) # tmpu[:,:,0,:] = tmpu[:,:,0,:]*0.0 out_dd = out_dd + (tmpu,) elif jj == 4: average_u = numpy.sum(u, 2) tmpu = numpy.copy(u) # for jj in range(0,u.shape[2]): # tmpu[:,:,jj,:]= tmpu[:,:,jj,:] - average_u out_dd = out_dd + (tmpu,) # elif jj == 3: # out_dd = out_dd + (freq_gradient(u),) return out_dd
def update_d(self, u, dd): # print('inside_update_d ushape',u.shape) # print('inside_update_d fre grad ushape',freq_gradient(u).shape) out_dd = () for jj in range(0, len(dd)): if jj < 3: # derivative y #tmp_d =get_Diff(u,jj) out_dd = out_dd + (CsSolver.get_Diff(u, jj), ) elif jj == 3: # rho tmpu = numpy.copy(u) tmpu = scipy.fftpack.fftn(tmpu, axes=(2, )) # tmpu[:,:,0,:] = tmpu[:,:,0,:]*0.0 out_dd = out_dd + (tmpu, ) elif jj == 4: average_u = numpy.sum(u, 2) tmpu = numpy.copy(u) # for jj in range(0,u.shape[2]): # tmpu[:,:,jj,:]= tmpu[:,:,jj,:] - average_u out_dd = out_dd + (tmpu, ) # elif jj == 3: # out_dd = out_dd + (freq_gradient(u),) return out_dd