Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Splines new #79

Merged
merged 78 commits into from
May 6, 2022
Merged
Changes from 1 commit
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
996a53f
Added Spline support
ni-lon98 Jul 23, 2020
c68d02f
Add Spline example
ni-lon98 Jul 23, 2020
8836656
Add Spline example
ni-lon98 Jul 23, 2020
b7b38fd
Create splines.f90
ni-lon98 Jul 23, 2020
5146af7
Add straight cost function
ni-lon98 Aug 12, 2020
5a5d244
add straight cost function
ni-lon98 Aug 12, 2020
a28d2ec
add straight cost function
ni-lon98 Aug 12, 2020
add11ce
add straight cost function
ni-lon98 Aug 12, 2020
43414a1
add straight cost function
ni-lon98 Aug 12, 2020
6dd47f1
add straight cost function
ni-lon98 Aug 12, 2020
7f8977e
add straight cost function
ni-lon98 Aug 12, 2020
bbd8306
add straight cost function
ni-lon98 Aug 12, 2020
7b07ee4
Update Makefile
ni-lon98 Aug 26, 2020
304db7b
read surface from boozer
ni-lon98 Aug 26, 2020
659a924
read surface from boozer
ni-lon98 Aug 26, 2020
262af28
read surface from boozer
ni-lon98 Aug 26, 2020
fb59cf4
add coeff. for straight cost function
ni-lon98 Aug 26, 2020
bd5d361
read surf from boozer
ni-lon98 Aug 26, 2020
2163f6c
read surf from boozer
ni-lon98 Aug 26, 2020
78921b7
fix bugs for compilation and in rdbooz.f90
zhucaoxiang Aug 27, 2020
3f54a86
swap boozer reading order
Aug 27, 2020
2cdaabf
test check_deriv
Sep 3, 2020
9e033cf
fix check_deriv
ni-lon98 Sep 3, 2020
dd64b52
Add documentation header
ni-lon98 Sep 17, 2020
3f80938
Add documentation header
ni-lon98 Sep 17, 2020
86dee2d
Update initial.f90
ni-lon98 Jul 11, 2021
abadc8e
Update documentation
ni-lon98 Jul 11, 2021
6c7363d
curvature and straight values written to HDF5
ni-lon98 Jul 11, 2021
7d1cdbb
write curvature and straight to HDF5
ni-lon98 Jul 11, 2021
562421a
write curvature and straight to HDF5
ni-lon98 Jul 11, 2021
0aa5dce
write curvature and straight to HDF5
ni-lon98 Jul 11, 2021
b7df7f2
write curvature and straight to HDF5
ni-lon98 Jul 11, 2021
e804ecb
Merge branch 'develop' into Splines_new
ni-lon98 Oct 12, 2021
cafe011
fix double definition
ni-lon98 Oct 12, 2021
d0b7253
Update solvers.f90
ni-lon98 Oct 12, 2021
def771d
Update solvers.f90
ni-lon98 Oct 12, 2021
927ad33
Update curvature.f90
ni-lon98 Oct 12, 2021
b64f2f6
Update curvature.f90
ni-lon98 Oct 12, 2021
2ae609f
Update curvature.f90
ni-lon98 Oct 12, 2021
1108589
Update curvature.f90
ni-lon98 Oct 12, 2021
0cfbcf8
Update saving.f90
ni-lon98 Oct 12, 2021
73e6f5b
Update diagnos.f90
ni-lon98 Oct 12, 2021
20c9387
Update diagnos.f90
ni-lon98 Oct 12, 2021
e931880
Update Makefile
ni-lon98 Oct 12, 2021
eae469c
Update deriv.input
ni-lon98 Oct 12, 2021
8dabaf0
Update deriv.input
ni-lon98 Oct 12, 2021
049137d
Update deriv.input
ni-lon98 Oct 13, 2021
6512619
Update deriv.input
ni-lon98 Oct 13, 2021
5b288b8
Update deriv.input
ni-lon98 Oct 13, 2021
f6a8eaf
Update deriv.input
ni-lon98 Oct 13, 2021
3afdde6
Update deriv.input
ni-lon98 Oct 13, 2021
1d4ade5
Update deriv.input
ni-lon98 Oct 13, 2021
5269cdc
Update deriv.input
ni-lon98 Oct 13, 2021
950aab8
Update deriv.input
ni-lon98 Oct 13, 2021
b00dd12
Update deriv.input
ni-lon98 Oct 13, 2021
e245990
Update deriv.input
ni-lon98 Oct 13, 2021
12c78f3
Update deriv.input
ni-lon98 Oct 13, 2021
02e4c8f
Update deriv.input
ni-lon98 Oct 13, 2021
e60275d
Update deriv.input
ni-lon98 Oct 17, 2021
c78c1c5
Update deriv.input
ni-lon98 Oct 17, 2021
46a2e0d
Update deriv.input
ni-lon98 Oct 17, 2021
ebbe34d
Update deriv.input
ni-lon98 Oct 17, 2021
233d724
Update deriv.input
ni-lon98 Oct 17, 2021
1526e08
Implement new curvature function for splines as well
ni-lon98 Mar 26, 2022
223be06
Update straight function to be consistent with curvature
ni-lon98 Mar 26, 2022
52f9304
Update stright function to be consistent with new curvature function
ni-lon98 Mar 26, 2022
be2aad9
Merge branch 'develop' into Splines_new
ni-lon98 Mar 26, 2022
ebe9822
Change straight cost function to be uniform with new curvature
ni-lon98 Mar 26, 2022
60ffff9
Update curvature.f90
ni-lon98 Mar 26, 2022
d178be7
Bug fixes
ni-lon98 Mar 26, 2022
169326f
add stright function to test
ni-lon98 Mar 26, 2022
09e0291
Update deriv.input
ni-lon98 Mar 26, 2022
1717a4f
Update deriv.input
ni-lon98 Mar 26, 2022
3a65ad9
comment out straight part
Apr 6, 2022
3360558
allocate straight array
Apr 6, 2022
a6f6e75
update version number
Apr 6, 2022
c758104
change folder name
Apr 6, 2022
721e40b
Merge branch 'develop' of github.com:PrincetonUniversity/FOCUS into S…
zhucaoxiang May 6, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add Spline example
  • Loading branch information
ni-lon98 committed Jul 23, 2020
commit c68d02f55e4971aed47ffea39a42549c862509e3
84 changes: 84 additions & 0 deletions examples/Spline_ellipse/ellipse.input
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
&focusin
IsQuiet = -1 ! -2 verbose and including unconstrained cost functions; -1: verbose; 0: normal; 1: concise
IsSymmetric = 2 ! 0: no stellarator symmetry enforced; 1: plasma periodicity enforced; 2: coil periodicity enforced

input_surf = '../rotating_ellipse/plasma.boundary'
case_surface = 0 ! 0: general VMEC-like format (Rbc, Rbs, Zbc, Zbs); 1: read axis for knots
knotsurf = 0.200D-00 ! minor plasma radius for knototrans, only valid for case surface = 1
ellipticity = 0.000D+00 ! ellipticity of plasma for knototrans, only valid for case surface = 1
Nteta = 64 ! poloidal number for discretizing the surface
Nzeta = 64 ! toroidal number for discretizing the surface

case_init = 0 ! -1: read coils.ext file; 0: read ext.focus file; 1: initialize with circular coils; 2: initialize with dipoles
input_coils = 'ellipse.focus'
case_coils = 1 ! 0: using piecewise linear representation; (not ready); 1: using Fourier series representation
Ncoils = 4 ! number of coils; only valid when case_init = 1
init_current = 1.000D+06 ! initial coil currents (Amper); only valid when case_init = 1
init_radius = 0.500D+00 ! initial coil radius (meter); only valid when case_init = 1
IsVaryCurrent = 0 ! 0: all the currents fixed; 1: currents can be changed; overwritten by ext.focus
IsVaryGeometry = 1 ! 0: all the geometries fixed; 1: geometries can be changed; overwritten by ext.focus
NFcoil = 4 ! number of Fourier harmonics representing the coils; overwritten by ext.focus
Nseg = 128 ! number of coil segments for discretizing; overwritten by ext.focus

IsNormalize = 1 ! 0: do not normalize coil parameters; 1: normalize; I = I/I0, x = x/R0; I0 & R0 are quadrtic mean values.
IsNormWeight = 1 ! 0: do not normalize the weights; 1: normalize the weights
case_bnormal = 0 ! 0: keep raw Bn error; 1: Bn residue normalized to local |B|
case_length = 1 ! 1: quadratic format, converging the target length; 2: exponential format, as short as possible
weight_bnorm = 1.000D+02 ! weight for real space Bn errors
weight_bharm = 0.000D+00 ! weight for Bnm harmonic errors
weight_tflux = 0.000D+00 ! weight for toroidal flux error
target_tflux = 0.000D+00 ! target for the toroidal flux
weight_ttlen = 1.000D+01 ! weight for coil length error
target_length = 7.000D+00 ! target value (or for normalization) of the coils length, if zero, automatically set to initial actual length
weight_specw = 0.000D+00 ! weight for spectral condensation error
weight_cssep = 1.000D+00 ! weight for coil-surface separation constraint
weight_inorm = 1.000D+00 ! weight for normalization of current. Larger weight makes the derivatives more important.
weight_gnorm = 1.000D+00 ! weight for normalization of geometric coefficients. Larger weight makes the derivatives more important.

case_optimize = 1 ! -2: check the 2nd derivatives (not ready); -1: check the 1st derivatives; 0: no optimizations performed; 1: optimizing using the gradient (DF and/or CG);
exit_tol = 1.000D-04 ! Exit the optimizer if the percent change in the cost function over the last 5 steps is below this threshold

DF_maxiter = 0 ! maximum iterations allowed for using Differential Flow (DF)
DF_xtol = 1.000D-08 ! relative error for ODE solver
DF_tausta = 0.000D+00 ! starting value of τ. Usually 0.0 is a good idea
DF_tauend = 1.000D-00 ! ending value of τ. The larger value of τend − τsta, the more optimized

CG_maxiter = 50 ! maximum iterations allowed for using Conjugate Gradient (CG)
CG_xtol = 1.000D-08 ! the stopping criteria of finding minimum; if |dχ2/dX| < CG xtol, exit the optimization
CG_wolfe_c1 = 0.1 ! c1 value in the strong wolfe condition for line search, (0.0, 0.5)
CG_wolfe_c2 = 0.9 ! c2 value in the strong wolfe condition for line search; 0 < c1 < c2 < 1

LM_maxiter = 0 ! maximum iterations allowed for using Levenberg-Marquard (LM)
LM_xtol = 1.000D-08 ! if the relative error between two consecutivec iterates is at most xtol, the optimization terminates
LM_ftol = 1.000D-08 ! if both the actual and predicted relative reductions in the sum of squares are at most ftol, the optimization terminates;
LM_factor = 100.0 ! the initial step bound, which is set to the product of factor and the euclidean norm of diag*x if nonzero

case_postproc = 3 ! 0: no extra post-processing; 1: evaluate the current coils; 2: write SPEC file; 3: perform Poincare plots; 4: calculates |B| Fourier harmonics in Boozer coordinates
save_freq = 1 ! frequency for writing output files; should be positive
save_coils = 1 ! flag for indicating whether write example.focus and example.coils
save_harmonics = 0 ! flag for indicating whether write example.harmonics
save_filaments = 0 ! flag for indicating whether write .example.filaments.xxxxxx

update_plasma = 0 ! if == 1, write new example.plasma file with updated Bn harmonics.
pp_phi = 0.000D+00 ! toroidal plane for poincare plots, cylindrical angle phi = pp_phi*Pi
pp_raxis = 3.000D+00 ! pp_raxis, pp_zaxis are initial guesses for magnetic axis at the specified toroidal angle
pp_zaxis = 0.000D+00 ! If both zero, FOCUS will take the geometric center as initial guess
pp_rmax = 0.000D+00 ! pp_rmax, pp_zmax are the upper bounds for performing fieldline tracing
pp_zmax = 0.000D+00 ! FOCUS will start follow fieldlines at interpolation between (pp_raxis, pp_zaxis) and (pp_rmax, pp_zmax)
pp_ns = 10 ! number of following fieldlines
pp_maxiter = 1000 ! number of periods for each fieldline following
pp_xtol = 1.000D-06 ! tolarence of ODE solver during fieldline fowllowing
/
&mgrid
! mgrid file dimensions
Rmin = 0.0
Rmax = 0.0
Zmin = 0.0
Zmax = 0.0
Pmin = 0.0
Pmax = 6.283
! resolutions
NR = 101
NZ = 101
NP = 72
/