From 371a4672d0d601e111deb723419da35eb79eb19d Mon Sep 17 00:00:00 2001 From: Elizabeth Date: Thu, 29 Aug 2024 18:14:25 -0400 Subject: [PATCH] Now builds and runs. --- examples/tracing_boozer.py | 6 +++--- src/simsoptpp/python_tracing.cpp | 5 ++--- src/simsoptpp/tracing.cpp | 16 ++++++---------- src/simsoptpp/tracing.h | 5 ++--- 4 files changed, 13 insertions(+), 19 deletions(-) diff --git a/examples/tracing_boozer.py b/examples/tracing_boozer.py index c44cb63b0..97d8d6cc4 100755 --- a/examples/tracing_boozer.py +++ b/examples/tracing_boozer.py @@ -70,7 +70,7 @@ gc_tys, gc_zeta_hits = trace_particles_boozer( field, stz_inits, vpar_inits, tmax=1e-2, mass=mass, charge=ELEMENTARY_CHARGE, - Ekin=Ekin, tol=1e-8, mode='gc_vac', stopping_criteria=[MaxToroidalFluxStoppingCriterion(0.99), MinToroidalFluxStoppingCriterion(0.01), ToroidalTransitStoppingCriterion(100, True)], + Ekin=Ekin, tol=1e-8, mode='gc_vac', stopping_criteria=[MaxToroidalFluxStoppingCriterion(0.99), MinToroidalFluxStoppingCriterion(0.01), ToroidalTransitStoppingCriterion(100)], forget_exact_path=False) Nparticles = len(gc_tys) @@ -107,7 +107,7 @@ gc_tys, gc_zeta_hits = trace_particles_boozer( field, stz_inits, vpar_inits, tmax=1e-2, mass=mass, charge=ELEMENTARY_CHARGE, - Ekin=Ekin, zetas=[0], tol=1e-8, stopping_criteria=[MinToroidalFluxStoppingCriterion(0.01), MaxToroidalFluxStoppingCriterion(0.99), ToroidalTransitStoppingCriterion(30, True)], + Ekin=Ekin, zetas=[0], tol=1e-8, stopping_criteria=[MinToroidalFluxStoppingCriterion(0.01), MaxToroidalFluxStoppingCriterion(0.99), ToroidalTransitStoppingCriterion(30)], forget_exact_path=False) resonances = compute_resonances(gc_tys, gc_zeta_hits, ma=None, delta=0.01) @@ -129,7 +129,7 @@ gc_tys, gc_zeta_hits = trace_particles_boozer( field, stz_res, vpar_res, tmax=1e-2, mass=mass, charge=ELEMENTARY_CHARGE, - Ekin=Ekin, zetas=[0], tol=1e-8, stopping_criteria=[MinToroidalFluxStoppingCriterion(0.01), MaxToroidalFluxStoppingCriterion(0.99), ToroidalTransitStoppingCriterion(30, True)], + Ekin=Ekin, zetas=[0], tol=1e-8, stopping_criteria=[MinToroidalFluxStoppingCriterion(0.01), MaxToroidalFluxStoppingCriterion(0.99), ToroidalTransitStoppingCriterion(30)], forget_exact_path=False) plt.figure() diff --git a/src/simsoptpp/python_tracing.cpp b/src/simsoptpp/python_tracing.cpp index 429a886d0..f9e947b09 100644 --- a/src/simsoptpp/python_tracing.cpp +++ b/src/simsoptpp/python_tracing.cpp @@ -42,15 +42,14 @@ void init_tracing(py::module_ &m){ py::arg("vacuum"), py::arg("noK"), py::arg("solveSympl")=false, - py::arg("GPU")=false, py::arg("zetas")=vector{}, py::arg("omegas")=vector{}, py::arg("stopping_criteria")=vector>{}, - py::arg("zetas_stop")=false, - py::arg("vpars_stop")=false, py::arg("forget_exact_path")=false, py::arg("axis")=0, py::arg("predictor_step")=true, + py::arg("zetas_stop")=false, + py::arg("vpars_stop")=false, py::arg("vpars")=vector{} ); diff --git a/src/simsoptpp/tracing.cpp b/src/simsoptpp/tracing.cpp index b89b76061..9c931f045 100644 --- a/src/simsoptpp/tracing.cpp +++ b/src/simsoptpp/tracing.cpp @@ -1180,8 +1180,8 @@ particle_guiding_center_boozer_tracing( shared_ptr> field, array stz_init, double m, double q, double vtotal, double vtang, double tmax, double dt, double abstol, double reltol, double roottol, bool vacuum, bool noK, bool solveSympl, vector zetas, vector omegas, - vector> stopping_criteria, - bool zetas_stop, bool vpars_stop, bool forget_exact_path, int axis, bool predictor_step, vector vpars) + vector> stopping_criteria, bool forget_exact_path, int axis, bool predictor_step, + bool zetas_stop, bool vpars_stop, vector vpars) { typename BoozerMagneticField::Tensor2 stz({{stz_init[0], stz_init[1], stz_init[2]}}); field->set_points(stz); @@ -1241,7 +1241,7 @@ particle_guiding_center_boozer_tracing( } } -template class T> +template tuple>, vector>> particle_guiding_center_boozer_perturbed_tracing( shared_ptr> field, array stz_init, @@ -1249,13 +1249,9 @@ particle_guiding_center_boozer_perturbed_tracing( bool vacuum, bool noK, vector zetas, vector omegas, vector> stopping_criteria, bool zetas_stop, bool vpars_stop, double Phihat, - double omega, int Phim, int Phin, double phase, bool forget_exact_path, int axis, vector vpars={}); + double omega, int Phim, int Phin, double phase, bool forget_exact_path, int axis, vector vpars); -template class T> +template tuple>, vector>> particle_guiding_center_boozer_tracing( - shared_ptr> field, array stz_init, - double m, double q, double vtotal, double vtang, double tmax, double dt, double abstol, double reltol, double roottol, - bool vacuum, bool noK, bool GPU, bool solveSympl, vector zetas, vector omegas, - vector> stopping_criteria, - bool zetas_stop, bool vpars_stop, bool forget_exact_path, int axis, bool predictor_step, vector vpars={}); \ No newline at end of file + shared_ptr> field, array stz_init, double m, double q, double vtotal, double vtang, double tmax, double dt, double abstol, double reltol, double roottol, bool vacuum, bool noK, bool solveSympl, vector zetas, vector omegas, vector> stopping_criteria, bool forget_exact_path, int axis, bool predictor_step, bool zetas_stop, bool vpars_stop, vector vpars); \ No newline at end of file diff --git a/src/simsoptpp/tracing.h b/src/simsoptpp/tracing.h index 3c0169c47..2efef0c24 100644 --- a/src/simsoptpp/tracing.h +++ b/src/simsoptpp/tracing.h @@ -112,15 +112,14 @@ particle_guiding_center_boozer_perturbed_tracing( vector> stopping_criteria, bool zetas_stop=false, bool vpars_stop=false, double alphahat=0, double omega=0, int alpham=0, int alphan=0, double phase=0, - bool forget_exact_path=false, int axis=0, vector vpars); + bool forget_exact_path=false, int axis=0, vector vpars={}); template class T> tuple>, vector>> particle_guiding_center_boozer_tracing( shared_ptr> field, array stz_init, double m, double q, double vtotal, double vtang, double tmax, double dt, double abstol, double reltol, double roottol, - bool vacuum, bool noK, bool solveSympl, vector zetas, vector omegas, - vector> stopping_criteria, + bool vacuum, bool noK, bool solveSympl, vector zetas, vector omegas, vector> stopping_criteria, bool forget_exact_path=false, int axis=0, bool predictor_step=true, bool zetas_stop=false, bool vpars_stop=false, vector vpars={});