import numpy from pylab import * from rbf_solver2 import rbf_solver data = numpy.load('cylinder') x = data['x'] y = data['y'] c = data['c'] r = data['r'] s = data['s'] rbf_solver(x, y, c, r, 0.007) fig = plt.figure() ax1 = fig.add_subplot(121) ax2 = fig.add_subplot(122) x1 = arange(len(c)) ax1.scatter(x, y, c = c, marker = 'o', s = 10, edgecolors='none') ax2.plot(x1,c,'k--') ax1.set_title('Solution') ax2.set_title('point values') plt.show()
-0.2*exp(-(9*particle.xi-4)**2-(9*particle.yi-7)**2) particle.wi = particle.ei #particle.gj = exp(-(particle.xj**2+particle.yj**2)/\ # (4*parameter.vis*parameter.t))/(pi*4*parameter.vis*parameter.t)*particle.h**2 particle.gj = (0.75*exp(-((9*particle.xj-2)**2+(9*particle.yj-2)**2)/4)\ +0.75*exp(-((9*particle.xj+1)**2)/49-((9*particle.yj+1)**2)/10)\ +0.5*exp(-((9*particle.xj-7)**2+(9*particle.yj-3)**2)/4)\ -0.2*exp(-(9*particle.xj-4)**2-(9*particle.yj-7)**2))*particle.h**2 toc = tic tic = cpu_time() t[0] = tic - toc # solve rbf using c wrapper if parameter.wrapper == 1: rbf_solver(particle.xi, particle.yi, particle.gj, particle.ei, particle.sigma, parameter.vis) toc = tic tic = cpu_time() # generate clusters particle, cluster = get_cluster(particle, cluster) # set up reference data if parameter.wrapper == 1: particle, cluster = get_trunc(particle, cluster) particle, cluster = get_vorticity(particle, cluster) particle.gj = particle.ei * particle.h**2 particle.ei = particle.wi particle.wi = particle.gj / particle.h**2
-0.2*exp(-(9*particle.xi-4)**2-(9*particle.yi-7)**2) particle.wi = particle.ei #particle.gj = exp(-(particle.xj**2+particle.yj**2)/\ # (4*parameter.vis*parameter.t))/(pi*4*parameter.vis*parameter.t)*particle.h**2 particle.gj = (0.75*exp(-((9*particle.xj-2)**2+(9*particle.yj-2)**2)/4)\ +0.75*exp(-((9*particle.xj+1)**2)/49-((9*particle.yj+1)**2)/10)\ +0.5*exp(-((9*particle.xj-7)**2+(9*particle.yj-3)**2)/4)\ -0.2*exp(-(9*particle.xj-4)**2-(9*particle.yj-7)**2))*particle.h**2 toc = tic tic = cpu_time() t[0] = tic-toc # solve rbf using c wrapper if parameter.wrapper == 1: rbf_solver(particle.xi,particle.yi,particle.gj,particle.ei, particle.sigma,parameter.vis) toc = tic tic = cpu_time() # generate clusters particle,cluster = get_cluster(particle,cluster) # set up reference data if parameter.wrapper == 1: particle,cluster = get_trunc(particle,cluster) particle,cluster = get_vorticity(particle,cluster) particle.gj = particle.ei*particle.h**2 particle.ei = particle.wi particle.wi = particle.gj/particle.h**2