Пример #1
0
iteration = 1
niters = 4

# create data array
y 	= np.zeros( (nsteps+1, 2, N, 3) )

# load initial data
y0, charge_src, charge_targ, dipstr_src, dipvec_src   = mu.load_initial_data(input_dir)
y[0,:] = y0[:]

# load pfasst data
mu.load_pfasst_data(output_dir, y, level, iteration)

# load pfasst data
idx = 1 # for velocity (niters, nsteps, N, 3)
data = mc.get_data(output_dir, nsources, idx)

data2 = np.zeros((niters, nsteps+1, 2, N, 3))
mu.load_pfasst_data_all(output_dir, data2, level)

err = abs ( data  - data2[:,1:,1,:nsources] )

magerr = np.zeros((niters, nsteps, nsources))
maxmag = np.zeros((niters, nsteps))
p = np.zeros(maxmag.shape)

""""
for k in range(niters):
  for i in range(nsteps):  
    for j in range(nsources):
      magerr[k,i,j] = la.norm(err[k,i,j,:])
Пример #2
0
# Run
#---------------------------------------

data_dir = "/home/namdi/Documents/School/UNC/Parallel_Time/Data"

fpath = data_dir + "/Results/2014_05/10" 
fpath = fpath + "/pmrfmm_s64_a3_f5"

# load parameters
fname = fpath + "/t_0/info.txt"
nsources, ntargets, distribution = mu.load_parameters2(fname)

# the data has shape (niters, nsteps, N, 3)
# the data does not contain the initial condition
idx = 1
vel = mc.get_data(fpath, nsources, idx)

# load initial data y0 (2, N, 3)
fpath = fpath + "/t_0"
y0, charge_src, charge_targ, dipstr_src, dipvec_src   = mu.load_initial_data(fpath)

# store the number of steps (not including the initial condition) and iterations
niters = vel.shape[0]
nsteps = vel.shape[1]

# the mommentum of the initial condition
mom0 = sum(y0[1,:])

mom = np.zeros((niters, nsteps,3))
mag = np.zeros((niters, nsteps))
p = np.zeros(mag.shape)