print ' N        - number of panels'
    print ' tau      - porosity parameter'
    print ' progtype - pyvec/pyfort\n'
    sys.exit(0)

if progtype == 'pyvec':
    from panel_method_vectorized import panel_method_vectorized as panel_method
elif progtype == 'pyfort':
    from panel_method import panel_method
else:
    print 'Using vectorized code'
    from panel_method_vectorized import panel_method_vectorized as panel_method

# Get grid coordinates
from make_grid_ellipse import make_grid_ellipse
Z = make_grid_ellipse(a, b, N)

start = time.clock()
m11, b11 = panel_method(a, b, N, Z, tau)
end = time.clock()

print '-----------------------------------------------'
print 'Runtime: %.5f s' % (end-start)
print 'Geometry: Cylinder'
print 'Number of panels: %d' % N
print 'Radius: %d' % a
print '-----------------------------------------------'
print '    m11 = ', m11
print '    b11 = ', b11
print '-----------------------------------------------'
    print 'Using vectorized code'
    from panel_method_vectorized import panel_method_vectorized as panel_method


# Get grid coordinates
if geom == 'ellipse':
    from make_grid_ellipse import make_grid_ellipse
    Z = make_grid_ellipse(a, b, N)
else:
    print 'choose ellipse or rectangle'
    sys.exit(0)

tau = np.linspace(0, 1, 50)
m11_list = []; b11_list = []
for t in tau:
    m11, m22, m12, m66, b11 = panel_method(a, b, N, Z, t)
    m11_list.append(m11)
    b11_list.append(b11)
plt.plot(tau, m11_list, tau, b11_list)
plt.legend(['Added mass', 'Damping'])
plt.title('Added mass and damping vs porosity coeff $\\tau$')
plt.xlabel('$\\tau$', fontsize=30)

tau = 0.3; mu = 0.4
A = np.linspace(0, 1, 100)
m11_list = []; b11_list = []
plt.figure()
for A_ in A:
    m11, m22, m12, m66, b11 = panel_method(a, b, N, Z, tau, A_)
    m11_list.append(m11)
    b11_list.append(b11)
if progtype == 'pyvec':
    from panel_method_vectorized import panel_method_vectorized as panel_method
elif progtype == 'pyfort':
    from panel_method import panel_method
else:
    print 'Using vectorized code'
    from panel_method_vectorized import panel_method_vectorized as panel_method

# Get grid coordinates
from make_grid_ellipse import make_grid_ellipse
Z = make_grid_ellipse(a, b, N)

b_ = np.linspace(0, 5, 100)
m11_list = []; b11_list = []; Cd_list = []
for t in b_:
    m11, b11, Cd = panel_method(a, b, N, Z, bpor=t, ngc=ngc)
    m11_list.append(m11)
    b11_list.append(b11)
    Cd_list.append(Cd)
    
# Plot m11 vs b
plt.plot(b_, m11_list, b_, b11_list)
plt.legend(['Added mass', 'Damping'])
plt.title('Added mass and damping vs b')
plt.xlabel('b', fontsize=30)

# Plot Cd
plt.figure(); plt.plot(b_, Cd_list)
plt.title('Drag coefficient $C_D$ vs b')

# Plot m11 and b11 vs KCpor
    from panel_method_vectorized import panel_method_vectorized as panel_method


# Get grid coordinates
if geom == 'ellipse':
    from make_grid_ellipse import make_grid_ellipse
    Z = make_grid_ellipse(a, b, N)
elif geom == 'rectangle':
    from rectangle_cosspace import rectangle_cosspace
    X, Y = rectangle_cosspace(a, b, N)
else:
    print 'choose ellipse or rectangle'
    sys.exit(0)

start = time.clock()
m11, m22, m12, m66, b11 = panel_method(a, b, N, Z)
end = time.clock()

print '-----------------------------------------------'
print 'Runtime: %.2f s' % (end-start)
print 'Geometry: %s' % geom
print 'Number of panels: %d' % N
if geom == 'ellipse':
    print 'Major radius: %d' % a
    print 'Minor radius: %d' % b
else:
    print 'Height: %d' % a
    print 'Length: %d' % b 
print '-----------------------------------------------'
print '             [%8.5f  %8.5f  %8.5f]' % (m11, abs(m12), 0)
print '    mij =    [%8.5f  %8.5f  %8.5f]' % (abs(m12), m22, 0), ', i,j = 1,2,6.'
elif progtype == 'pyfort':
    from panel_method import panel_method
else:
    print 'Using vectorized code'
    from panel_method_vectorized import panel_method_vectorized as panel_method

    
# Get grid coordinates
from make_grid_ellipse import make_grid_ellipse
Z = make_grid_ellipse(a, b, N)


tau = np.linspace(0, 1, 50)
m11_list = []; b11_list = []; Cd_list = []
for t in tau:
    m11, b11, Cd = panel_method(a, b, N, Z, t)
    m11_list.append(m11)
    b11_list.append(b11)
    Cd_list.append(Cd)
    
# Plot m11 vs tau
plt.plot(tau, m11_list, tau, b11_list)
plt.legend(['Added mass', 'Damping'])
plt.title('Added mass and damping vs porosity coeff $\\tau$')
plt.xlabel('$\\tau$', fontsize=30)


# Plot Cd vs tau
plt.figure()
plt.plot(tau, Cd_list)
plt.legend(['Drag coefficient'])