Beispiel #1
0
  ax.scatter(y[step, 0, 0:nsources, 0], y[step, 0, 0:nsources, 1], y[step, 0, 0:nsources, 2])
  
  plt.show()
  return
  
#-----------------------------------------------------------
# Run code
#-----------------------------------------------------------

# the input directory the directory for input data

input_dir = '/home/namdi/Documents/School/UNC/Parallel_Time/Data/test_fmm/t_0'

# read parameters
fname = input_dir + str("/info.txt")
nsources, ntargets, distribution, dt, nsteps = mu.load_parameters(fname)

N = nsources + ntargets

# 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[:]

# plot the data
plot3D_timestep(y, nsources, 0)

uu =1
Beispiel #2
0
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)

# calculate the change in mommentum
for i in range(niters):
  for j in range(nsteps):