Skip to content

Commit f3bb1ee

Browse files
committedAug 6, 2016
Merge branch 'master' of https://github.com/zimoun/mtf
2 parents 659c148 + 23b3810 commit f3bb1ee

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed
 

‎show-off.py

+27-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import numpy as np
55
import scipy.linalg as la
6+
import matplotlib.pyplot as plt
67
from time import time
78

89
import bempp.api as bem
@@ -12,6 +13,7 @@
1213

1314
lmbda = 0.5
1415
kRef = 2 * np.pi / lmbda
16+
print('KRef:', kRef)
1517

1618
#meshname = 'geo/mtf-logo.msh'
1719
meshname = 'geo/rings.msh'
@@ -69,10 +71,10 @@
6971
#################################################
7072

7173
def dir_data(x, normal, dom_ind, result):
72-
result[0] = -np.exp( 1j * kRef * x[1])
74+
result[0] = -np.exp( 1j * kRef * x[0])
7375

7476
def neu_data(x, normal, dom_ind, result):
75-
result[0] = -1j * normal[1] * kRef * np.exp( 1j * kRef * x[1])
77+
result[0] = -1j * normal[0] * kRef * np.exp( 1j * kRef * x[0])
7678

7779
#################################################
7880
#################################################
@@ -169,3 +171,26 @@ def rescaleRes(res, P, b):
169171
bem.export(grid_function=gsold,
170172
file_name="soldI.msh",
171173
transformation=np.imag)
174+
175+
print('solution saved.')
176+
177+
# Nx = 200
178+
# Ny = 200
179+
# xmin, xmax, ymin, ymax = [-0.5, 4.5, -0.5, 1.5]
180+
# plot_grid = np.mgrid[xmin:xmax:Nx * 1j, ymin:ymax:Ny * 1j]
181+
# points = np.vstack((plot_grid[0].ravel(),
182+
# plot_grid[1].ravel(),
183+
# np.zeros(plot_grid[0].size)))
184+
# u = np.zeros(points.shape[1], dtype=np.complex)
185+
# u[:] = np.nan
186+
187+
# slp = bem.operators.potential.helmholtz.single_layer(
188+
# space, points, kRef)
189+
# dlp = bem.operators.potential.helmholtz.double_layer(
190+
# space, points, kRef)
191+
# u = slp * gsoln - dlp * gsoln
192+
193+
# uu = u.reshape((Nx, Ny))
194+
# plt.imshow(np.real(uu.T), extent=[xmin, xmax, ymin, ymax])
195+
# plt.colorbar()
196+
# plt.show()

0 commit comments

Comments
 (0)
Please sign in to comment.