summaryrefslogtreecommitdiff
path: root/coil_parasitics.py
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2023-10-06 16:17:25 +0200
committerjaseg <git@jaseg.de>2023-10-06 16:17:25 +0200
commit78f5bf965f1fc92952b749bd2e7422b2b874adcf (patch)
tree706bf875c1cea1aef165785096243df5389e9343 /coil_parasitics.py
parent84f7e5d25b1323a1a83b5d6a66c354416e84ff8c (diff)
downloadgerbonara-78f5bf965f1fc92952b749bd2e7422b2b874adcf.tar.gz
gerbonara-78f5bf965f1fc92952b749bd2e7422b2b874adcf.tar.bz2
gerbonara-78f5bf965f1fc92952b749bd2e7422b2b874adcf.zip
Mesh WIP
Diffstat (limited to 'coil_parasitics.py')
-rw-r--r--coil_parasitics.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/coil_parasitics.py b/coil_parasitics.py
index 5bb7b02..47d5cd2 100644
--- a/coil_parasitics.py
+++ b/coil_parasitics.py
@@ -73,14 +73,14 @@ def elmer_grid(infile, outfile=None, intype=None, outtype=None, cwd=None, **kwar
if outfile is not None:
kwargs['out'] = str(outfile)
- args = ['ElmerGrid', intype, outtype, infile]
+ args = ['ElmerGrid', intype, outtype, str(infile)]
for key, value in kwargs.items():
args.append(f'-{key}')
if isinstance(value, (tuple, list)):
args.extend(str(v) for v in value)
else:
args.append(str(value))
- subprocess.run(args, cwd=cwd)
+ subprocess.run(args, cwd=cwd, check=True)
def elmer_solver(cwd):
subprocess.run(['ElmerSolver'], cwd=cwd)
@@ -138,7 +138,7 @@ def run_capacitance_simulation(mesh_file, sim_dir):
sim.write_startinfo(tmpdir)
sim.write_sif(tmpdir)
# Convert mesh from gmsh to elemer formats. Also scale it from 1 unit = 1 mm to 1 unit = 1 m (SI units)
- elmer_grid(mesh_file.name, 'mesh', cwd=tmpdir, scale=[1e-3, 1e-3, 1e-3])
+ elmer_grid(mesh_file.absolute(), 'mesh', cwd=tmpdir, scale=[1e-3, 1e-3, 1e-3])
elmer_solver(tmpdir)
capacitance_matrix = np.loadtxt(tmpdir / 'capacitance.txt')
@@ -212,7 +212,7 @@ def run_inductance_simulation(mesh_file, sim_dir):
sim.write_startinfo(tmpdir)
sim.write_sif(tmpdir)
# Convert mesh from gmsh to elemer formats. Also scale it from 1 unit = 1 mm to 1 unit = 1 m (SI units)
- elmer_grid(mesh_file.name, 'mesh', cwd=tmpdir, scale=[1e-3, 1e-3, 1e-3])
+ elmer_grid(mesh_file.absolute(), 'mesh', cwd=tmpdir, scale=[1e-3, 1e-3, 1e-3])
elmer_solver(tmpdir)