import numpy as np
import csv

x0 = 0.0
Dx = 4.0e-5
xF = x0 + 50.0*Dx

x = np.arange(x0,xF + Dx,Dx)
p = np.zeros_like(x)
p[ 0] = 1
p[-1] = 2
p = np.int32(p)

with open('mesh.csv', 'w') as csvfile:
    csvwriter = csv.writer(csvfile)
    csvwriter.writerow(['Position(m)','Physical ID'])
    for x_i, p_i in zip(x, p):
        csvwriter.writerow([x_i,p_i])
