Changes to 1D Cathode example

Now it is uses the text mesh format.
All output files are now included as they are simple csv files easy to
understand.
This commit is contained in:
Jorge Gonzalez 2026-02-28 13:26:02 +01:00
commit 7d884224f0
62 changed files with 2550 additions and 1018 deletions

18
runs/1D_Cathode/mesh.py Normal file
View file

@ -0,0 +1,18 @@
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])