-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsurfaces_plot.py
67 lines (56 loc) · 2.67 KB
/
surfaces_plot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import os
from simsopt.geo import SurfaceRZFourier
from simsopt.util.permanent_magnet_helper_functions import *
nphi = 64 # need to set this to 64 for a real run
ntheta = 64 # same as above
# Make the output directory
OUT_DIR = 'Plots/ISTELL_surfaces_plots/'
os.makedirs(OUT_DIR, exist_ok=True)
#create the outside boundary for the PMs (corresponds to the coil limit)
s_out = SurfaceRZFourier.from_nphi_ntheta(nphi = nphi, ntheta = ntheta, range='full torus', nfp=2, stellsym=True)
s_out.set_rc( 0, 0, 0.52)
s_out.set_rc( 1, 0, 0.2025)
s_out.set_zs( 1, 0, 0.2025)
s_out.to_vtk(OUT_DIR + "surf_coil_full")
#create the outside boundary for the PMs (corresponds to the coil limit)
s_out = SurfaceRZFourier.from_nphi_ntheta(nphi = nphi, ntheta = ntheta, range='half period', nfp=2, stellsym=True)
s_out.set_rc( 0, 0, 0.52)
s_out.set_rc( 1, 0, 0.2025)
s_out.set_zs( 1, 0, 0.2025)
s_out.to_vtk(OUT_DIR + "surf_coil")
#create the outside boundary for the PMs (corresponds to the coil limit if we align the coils with the VV)
s_out = SurfaceRZFourier.from_nphi_ntheta(nphi = nphi, ntheta = ntheta, range='half period', nfp=2, stellsym=True)
s_out.set_rc( 0, 0, 0.46)
s_out.set_rc( 1, 0, 0.2025)
s_out.set_zs( 1, 0, 0.2025)
s_out.to_vtk(OUT_DIR + "surf_coil_aligned")
#create the outside boundary for the PMs (corresponds to the coil limit if we align the coils with the VV)
s_out = SurfaceRZFourier.from_nphi_ntheta(nphi = nphi, ntheta = ntheta, range='full torus', nfp=2, stellsym=True)
s_out.set_rc( 0, 0, 0.46)
s_out.set_rc( 1, 0, 0.2025)
s_out.set_zs( 1, 0, 0.2025)
s_out.to_vtk(OUT_DIR + "surf_coil_aligned_full")
#create the inside boundary for the PMs (corresponds to the copper shell)
s_in = SurfaceRZFourier.from_nphi_ntheta(nphi = nphi, ntheta = ntheta, range='half period', nfp=2, stellsym=True)
s_in.set_rc(0, 0, 0.46)
s_in.set_rc(1, 0, 0.1275)
s_in.set_zs(1, 0, 0.1275)
s_in.to_vtk(OUT_DIR + "surf_copper_shell")
#create the inside boundary for the PMs (corresponds to the copper shell)
s_in = SurfaceRZFourier.from_nphi_ntheta(nphi = nphi, ntheta = ntheta, range='full torus', nfp=2, stellsym=True)
s_in.set_rc(0, 0, 0.46)
s_in.set_rc(1, 0, 0.1275)
s_in.set_zs(1, 0, 0.1275)
s_in.to_vtk(OUT_DIR + "surf_copper_shell_full")
#create the VV surface
s_in = SurfaceRZFourier.from_nphi_ntheta(nphi = nphi, ntheta = ntheta, range='half period', nfp=2, stellsym=True)
s_in.set_rc(0, 0, 0.46)
s_in.set_rc(1, 0, 0.085)
s_in.set_zs(1, 0, 0.085)
s_in.to_vtk(OUT_DIR + "surf_VV")
#create the VV surface
s_in = SurfaceRZFourier.from_nphi_ntheta(nphi = nphi, ntheta = ntheta, range='full torus', nfp=2, stellsym=True)
s_in.set_rc(0, 0, 0.46)
s_in.set_rc(1, 0, 0.085)
s_in.set_zs(1, 0, 0.085)
s_in.to_vtk(OUT_DIR + "surf_VV_full")