From 54518c76b364c8d2648f44105e364e57b782f349 Mon Sep 17 00:00:00 2001 From: lazersos Date: Sat, 25 Jan 2025 09:27:40 +0100 Subject: [PATCH] pySTEL: Added end statement when writing out a coil. --- pySTEL/libstell/coils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pySTEL/libstell/coils.py b/pySTEL/libstell/coils.py index 87db353e..97a18b3a 100644 --- a/pySTEL/libstell/coils.py +++ b/pySTEL/libstell/coils.py @@ -101,6 +101,9 @@ def rescalecoils(self,npts_new): y = self.groups[i].coils[j].y z = self.groups[i].coils[j].z s = np.linspace(0.0,1.0,self.groups[i].coils[j].npts) + x[-1] = x[0] + y[-1] = y[0] + z[-1] = z[0] cx = CubicSpline(s,x,bc_type='periodic') cy = CubicSpline(s,y,bc_type='periodic') cz = CubicSpline(s,z,bc_type='periodic') @@ -378,6 +381,7 @@ def write_coils_file(self,filename): f.write(f"{self.groups[i].coils[j].x[k]:.10E} {self.groups[i].coils[j].y[k]:.10E} {self.groups[i].coils[j].z[k]:.10E} {current[k]:.10E}\n") k = self.groups[i].coils[j].npts-1 f.write(f"{self.groups[i].coils[j].x[k]:.10E} {self.groups[i].coils[j].y[k]:.10E} {self.groups[i].coils[j].z[k]:.10E} {current[k]:.10E} {i+1} {self.groups[i].name}\n") + f.write(f"end\n") f.close() def coilbiot(self,x,y,z,extcur=None):