True, M, bh * 1, pad_zone=pad_zone, heaviside=MOL.step, qfs_tolerance=qfs_tolerance, coordinate_tolerance=coordinate_tolerance, coordinate_scheme=coordinate_scheme) ebdyc = EmbeddedBoundaryCollection([ ebdy, ]) # register the grid print('\nRegistering the grid') ebdyc.register_grid(grid, verbose=verbose) # give ebdyc a bumpy function ebdyc.ready_bump(MOL.bump, (1.2 - ebdy.radial_width, 1.2 - ebdy.radial_width), ebdyc[0].radial_width) ################################################################################ # Get solution, forces, BCs k = 8 * np.pi / 3 solution_func = lambda x, y: -np.cos(x) * np.exp(np.sin(x)) * np.sin(y) force_func = lambda x, y: (2.0 * np.cos(x) + 3.0 * np.cos(x) * np.sin(x) - np. cos(x)**3) * np.exp(np.sin(x)) * np.sin(y) # solution_func = lambda x, y: np.exp(np.sin(k*x))*np.sin(k*y) # force_func = lambda x, y: k**2*np.exp(np.sin(k*x))*np.sin(k*y)*(np.cos(k*x)**2-np.sin(k*x)-1.0) f = force_func(ebdyc.grid.xg, ebdyc.grid.yg) * ebdyc.phys frs = [force_func(ebdy.radial_x, ebdy.radial_y) for ebdy in ebdyc] ua = solution_func(ebdyc.grid.xg, ebdyc.grid.yg) * ebdyc.phys
ebdy = EmbeddedBoundary(bdy, True, M, bh / grid_upsample, pad_zone=0, heaviside=MOL.step, qfs_tolerance=qfs_tolerance, coordinate_tolerance=coordinate_tolerance, coordinate_scheme=coordinate_scheme) ebdyc = EmbeddedBoundaryCollection([ ebdy, ]) grid = ebdyc.generate_grid(bh / grid_upsample) ebdyc.register_grid(grid, verbose=verbose) ebdyc.ready_bump(MOL.bump, (grid.x_bounds[1] - ebdy.radial_width, grid.y_bounds[1] - ebdy.radial_width), ebdyc[0].radial_width) # register the grid print('\nRegistering the grid') ebdyc.register_grid(grid, verbose=verbose) ################################################################################ # Get solution, forces, BCs if problem == 'easy': solution_func = lambda x, y: -np.cos(x) * np.exp(np.sin(x)) * np.sin(y) force_func = lambda x, y: (2.0 * np.cos(x) + 3.0 * np.cos(x) * np.sin(x) - np.cos(x)**3) * np.exp(np.sin(x)) * np.sin(y) else: k = 10 * np.pi / 3 solution_func = lambda x, y: np.exp(np.sin(k * x)) * np.sin(k * y)
ng, x_endpoints=[True, False], y_endpoints=[True, False]) # construct embedded boundary bdys = [bdy1, bdy2, bdy3] ebdys = [ EmbeddedBoundary(bdy, bdy is bdy1, M, bh, pad_zone, MOL.step) for bdy in bdys ] ebdyc = EmbeddedBoundaryCollection(ebdys) # register the grid print('\nRegistering the grid') ebdyc.register_grid(grid, verbose=verbose) # give ebdyc a bumpy function ebdyc.ready_bump(MOL.bump, (3.5 - ebdys[0].radial_width, 3.5 - ebdys[0].radial_width), ebdys[0].radial_width) ################################################################################ # Extract radial information from ebdy and construct annular solver # Testing the radial Stokes solver print(' Testing Radial Stokes Solver') a = 8.0 b = 7.0 p_a = 3.0 p_b = 1.0 sin = np.sin cos = np.cos esin = lambda x: np.exp(sin(x)) psix = lambda x, y: esin(a * x) * cos(b * y)
bdys = [bdy1, bdy2, bdy3] ebdys = [ EmbeddedBoundary(bdy, bdy is bdy1, M, bh, pad_zone=pad_zone, heaviside=MOL.step) for bdy in bdys ] ebdyc = EmbeddedBoundaryCollection(ebdys) # register the grid print('\nRegistering the grid') ebdyc.register_grid(grid, verbose=verbose) # give ebdyc a bumpy function ebdyc.ready_bump(MOL.bump, (2.6 - ebdys[0].radial_width, 2.6 - ebdys[0].radial_width), ebdys[0].radial_width) ################################################################################ # Extract radial information from ebdy and construct annular solver # Testing the radial Stokes solver print(' Testing Radial Stokes Solver') a = 8.0 b = 7.0 p_a = 2.0 p_b = 1.0 sin = np.sin cos = np.cos esin = lambda x: np.exp(sin(x)) psix = lambda x, y: esin(a * x) * cos(b * y)
pad_zone=pad_zone, heaviside=MOL.step, qfs_tolerance=1e-14, qfs_fsuf=2) ebdys = [ ebdy, ] ebdyc = EmbeddedBoundaryCollection([ ebdy, ]) # register the grid print('\nRegistering the grid') ebdyc.register_grid(grid) # give ebdyc a bumpy function ebdyc.ready_bump( MOL.bump, (np.pi / 2 - ebdy.radial_width, np.pi / 2 - ebdy.radial_width), ebdyc[0].radial_width) ################################################################################ # Extract radial information from ebdy and construct annular solver # Testing the radial Stokes solver print(' Testing Radial Stokes Solver') a = 3.0 b = 2.0 p_a = 2.0 p_b = 1.0 sin = np.sin cos = np.cos esin = lambda x: np.exp(sin(x)) psix = lambda x, y: esin(a * x) * cos(b * y)