Пример #1
0
                        Fixed_SLP,
                        on_surface=True,
                        form_b2c=False,
                        vector=True)
    qfs_list.append(qfs)

sigmal = [qfs([
    tau,
]) for qfs, tau in zip(qfs_list, taul)]
sigmav = np.column_stack([v2f(sigma) for sigma in sigmal])

out = Stokes_Layer_Apply(ebdyc.bdy_inward_sources,
                         ebdyc.grid_and_radial_pts,
                         forces=sigmav)
outu, outv = v2f(out)
gslpu, rslplu = ebdyc.divide_grid_and_radial(outu)
gslpv, rslplv = ebdyc.divide_grid_and_radial(outv)

uc[ebdyc.phys] += gslpu
vc[ebdyc.phys] += gslpv
for ur, rslp in zip(urs, rslplu):
    ur += rslp
for vr, rslp in zip(vrs, rslplv):
    vr += rslp

if plot:
    mue = np.ma.array(uc, mask=ebdyc.ext)
    fig, ax = plt.subplots()
    clf = ax.pcolormesh(grid.xg, grid.yg, mue)
    for ebdy in ebdys:
        ax.plot(ebdy.bdy.x, ebdy.bdy.y, color='black', linewidth=3)
Пример #2
0
bv = solver.get_boundary_values(uers)
tau = np.linalg.solve(A, bcs2v - bv)
qfs = QFS_Evaluator(ebdy.bdy_qfs,
                    True, [
                        Singular_DLP,
                    ],
                    Naive_SLP,
                    on_surface=True,
                    form_b2c=False)
sigma = qfs([
    tau,
])
out = Laplace_Layer_Apply(ebdyc.bdy_inward_sources,
                          ebdyc.grid_and_radial_pts,
                          charge=sigma)
gslp, rslpl = ebdyc.divide_grid_and_radial(out)
rslp = rslpl[0]
uer += rslp.reshape(uer.shape)
ue[ebdyc.phys] += gslp

if plot:
    fig, ax = plt.subplots()
    ax.pcolormesh(grid.xg, grid.yg, mue)
    ax.plot(ebdy.bdy.x, ebdy.bdy.y, color='black', linewidth=3)
    ax.plot(ebdy.interface.x, ebdy.interface.y, color='white', linewidth=3)

# compute the error
rerr = np.abs(uer - uar)
gerr = np.abs(ue - ua)
gerrp = gerr[ebdyc.phys]
mgerr = np.ma.array(gerr, mask=ebdyc.ext)
Пример #3
0
		# set the radial values
		c_new.radial_value_list[0][:] = ch[gp.N:].reshape(ebdy.radial_shape)
		# overwrite under grid under annulus by radial grid
		_ = new_ebdyc.interpolate_radial_to_grid(c_new.radial_value_list, c_new.grid_value)

		# now solve diffusion equation
		if nu > 0:
			solver1 = ModifiedHelmholtzSolver(new_ebdyc, solver_type=solver_type, k=first_helmholtz_k)
			c_new_update = solver1(c_new/first_zeta, tol=1e-12, verbose=True)
			A = s1_singular(new_ebdyc.ebdys[0].bdy) - half_eye(new_ebdyc.ebdys[0].bdy)
			bvn = solver1.get_boundary_normal_derivatives(c_new_update.radial_value_list)
			tau = -np.linalg.solve(A, -bvn)
			qfs = QFS_Evaluator(new_ebdyc.ebdys[0].bdy_qfs, True, [Singular_SLP1,], Naive_SLP1, on_surface=True, form_b2c=False)
			sigma = qfs([tau,])
			out = MH_Layer_Apply(new_ebdyc.bdy_inward_sources, new_ebdyc.grid_and_radial_pts, charge=sigma, k=first_helmholtz_k)
			gslp, rslpl = new_ebdyc.divide_grid_and_radial(out)
			rslp = rslpl[0]
			c_new_update.radial_value_list[0] += rslp.reshape(M, nb)
			c_new_update.grid_value[new_ebdyc.phys] += gslp
			c_new = c_new_update

		# overwrite under grid under annulus by radial grid
		_ = new_ebdyc.interpolate_radial_to_grid(c_new.radial_value_list, c_new.grid_value)

	else:  # the second order method

		bx = ebdy.bdy.x + 0.5*dt*(3*ub - ubo_new_parm)
		by = ebdy.bdy.y + 0.5*dt*(3*vb - vbo_new_parm)
		bx, by, new_t = arc_length_parameterize(bx, by, return_t=True)
		bu_interp = interp1d(0, 2*np.pi, bdy.dt, ub, p=True)
		bv_interp = interp1d(0, 2*np.pi, bdy.dt, vb, p=True)