Skip to content

Commit

Permalink
pySTEL: Added end statement when writing out a coil.
Browse files Browse the repository at this point in the history
  • Loading branch information
lazersos committed Jan 25, 2025
1 parent 0e1df72 commit 54518c7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pySTEL/libstell/coils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 54518c7

Please sign in to comment.