Simsopt C++ API
Biot Savart
Typedefs
-
typedef xt::pyarray<double> Array
Functions
Defines
-
MYIF(c)
Functions
-
template<class T, int derivs>
void biot_savart_kernel(AlignedPaddedVec &pointsx, AlignedPaddedVec &pointsy, AlignedPaddedVec &pointsz, T &gamma, T &dgamma_by_dphi, T &B, T &dB_by_dX, T &d2B_by_dXdX)
-
template<class T, int derivs>
void biot_savart_kernel_A(AlignedPaddedVec &pointsx, AlignedPaddedVec &pointsy, AlignedPaddedVec &pointsz, T &gamma, T &dgamma_by_dphi, T &A, T &dA_by_dX, T &d2A_by_dXdX)
-
namespace std
Functions
-
template<class T, int derivs>
void biot_savart_vjp_kernel(AlignedPaddedVec &pointsx, AlignedPaddedVec &pointsy, AlignedPaddedVec &pointsz, T &gamma, T &dgamma_by_dphi, T &v, T &res_gamma, T &res_dgamma_by_dphi, T &vgrad, T &res_grad_gamma, T &res_grad_dgamma_by_dphi)
Typedefs
-
typedef xt::pyarray<double> Array
Functions
-
void biot_savart_vjp(Array &points, vector<Array> &gammas, vector<Array> &dgamma_by_dphis, vector<double> ¤ts, Array &v, Array &vgrad, vector<Array> &dgamma_by_dcoeffs, vector<Array> &d2gamma_by_dphidcoeffs, vector<Array> &res_B, vector<Array> &res_dB)
Defines
-
MYIF(c)
Functions
-
template<class T, int derivs>
void biot_savart_vjp_kernel(AlignedPaddedVec &pointsx, AlignedPaddedVec &pointsy, AlignedPaddedVec &pointsz, T &gamma, T &dgamma_by_dphi, T &v, T &res_gamma, T &res_dgamma_by_dphi, T &vgrad, T &res_grad_gamma, T &res_grad_dgamma_by_dphi)
-
template<class T, int derivs>
void biot_savart_vector_potential_vjp_kernel(AlignedPaddedVec &pointsx, AlignedPaddedVec &pointsy, AlignedPaddedVec &pointsz, T &gamma, T &dgamma_by_dphi, T &v, T &res_gamma, T &res_dgamma_by_dphi, T &vgrad, T &res_grad_gamma, T &res_grad_dgamma_by_dphi)
Boozer classes
-
template<template<class, std::size_t, xt::layout_type> class T>
class BoozerMagneticField Subclassed by InterpolatedBoozerField< T >, PyBoozerMagneticFieldTrampoline< BoozerMagneticFieldBase >
Public Types
Public Functions
-
inline BoozerMagneticField(double psi0)
-
inline virtual void invalidate_cache()
-
inline BoozerMagneticField &set_points(Tensor2 &p)
Public Members
-
double psi0
Protected Attributes
-
CachedTensor<T, 2> points
-
CachedTensor<T, 2> data_modB
-
CachedTensor<T, 2> data_dmodBdtheta
-
CachedTensor<T, 2> data_dmodBdzeta
-
CachedTensor<T, 2> data_dmodBds
-
CachedTensor<T, 2> data_modB_derivs
-
CachedTensor<T, 2> data_G
-
CachedTensor<T, 2> data_iota
-
CachedTensor<T, 2> data_dGds
-
CachedTensor<T, 2> data_diotads
-
CachedTensor<T, 2> data_psip
-
CachedTensor<T, 2> data_I
-
CachedTensor<T, 2> data_dIds
-
CachedTensor<T, 2> data_R
-
CachedTensor<T, 2> data_Z
-
CachedTensor<T, 2> data_nu
-
CachedTensor<T, 2> data_K
-
CachedTensor<T, 2> data_dRdtheta
-
CachedTensor<T, 2> data_dRdzeta
-
CachedTensor<T, 2> data_dRds
-
CachedTensor<T, 2> data_R_derivs
-
CachedTensor<T, 2> data_dZdtheta
-
CachedTensor<T, 2> data_dZdzeta
-
CachedTensor<T, 2> data_dZds
-
CachedTensor<T, 2> data_Z_derivs
-
CachedTensor<T, 2> data_dnudtheta
-
CachedTensor<T, 2> data_dnudzeta
-
CachedTensor<T, 2> data_dnuds
-
CachedTensor<T, 2> data_nu_derivs
-
CachedTensor<T, 2> data_dKdtheta
-
CachedTensor<T, 2> data_dKdzeta
-
CachedTensor<T, 2> data_K_derivs
-
CachedTensor<T, 2> data_d2modBdtheta2
-
CachedTensor<T, 2> data_d2modBdzeta2
-
CachedTensor<T, 2> data_d2modBdthetadzeta
-
int npoints
-
inline BoozerMagneticField(double psi0)
-
template<template<class, std::size_t, xt::layout_type> class T>
class InterpolatedBoozerField : public BoozerMagneticField<T> Public Functions
Public Members
-
const shared_ptr<BoozerMagneticField<T>> field
-
const RangeTriplet s_range
-
const RangeTriplet theta_range
-
const RangeTriplet zeta_range
-
const RangeTriplet angle0_range = {0., M_PI, 1}
-
const InterpolationRule rule
Protected Functions
-
inline virtual void _psip_impl(Tensor2 &psip) override
-
inline virtual void _G_impl(Tensor2 &G) override
-
inline virtual void _I_impl(Tensor2 &I) override
-
inline virtual void _iota_impl(Tensor2 &iota) override
-
inline virtual void _dGds_impl(Tensor2 &dGds) override
-
inline virtual void _dIds_impl(Tensor2 &dIds) override
-
inline virtual void _diotads_impl(Tensor2 &diotads) override
-
inline virtual void _K_impl(Tensor2 &K) override
-
inline virtual void _dKdtheta_impl(Tensor2 &dKdtheta) override
-
inline virtual void _dKdzeta_impl(Tensor2 &dKdzeta) override
-
inline virtual void _K_derivs_impl(Tensor2 &K_derivs) override
-
inline virtual void _nu_impl(Tensor2 &nu) override
-
inline virtual void _dnudtheta_impl(Tensor2 &dnudtheta) override
-
inline virtual void _dnudzeta_impl(Tensor2 &dnudzeta) override
-
inline virtual void _dnuds_impl(Tensor2 &dnuds) override
-
inline virtual void _nu_derivs_impl(Tensor2 &nu_derivs) override
-
inline virtual void _R_impl(Tensor2 &R) override
-
inline virtual void _dRdtheta_impl(Tensor2 &dRdtheta) override
-
inline virtual void _dRdzeta_impl(Tensor2 &dRdzeta) override
-
inline virtual void _dRds_impl(Tensor2 &dRds) override
-
inline virtual void _R_derivs_impl(Tensor2 &R_derivs) override
-
inline virtual void _Z_impl(Tensor2 &Z) override
-
inline virtual void _dZdtheta_impl(Tensor2 &dZdtheta) override
-
inline virtual void _dZdzeta_impl(Tensor2 &dZdzeta) override
-
inline virtual void _dZds_impl(Tensor2 &dZds) override
-
inline virtual void _Z_derivs_impl(Tensor2 &Z_derivs) override
-
inline virtual void _modB_impl(Tensor2 &modB) override
-
inline virtual void _dmodBdtheta_impl(Tensor2 &dmodBdtheta) override
-
inline virtual void _dmodBdzeta_impl(Tensor2 &dmodBdzeta) override
-
inline virtual void _dmodBds_impl(Tensor2 &dmodBds) override
-
inline virtual void _modB_derivs_impl(Tensor2 &modB_derivs) override
-
inline virtual void _d2modBdtheta2_impl(Tensor2 &d2modBdtheta2) override
-
inline virtual void _d2modBdthetadzeta_impl(Tensor2 &d2modBdthetadzeta) override
-
inline virtual void _d2modBdzeta2_impl(Tensor2 &d2modBdzeta2) override
-
inline void exploit_fluxfunction_points(Tensor2 &stz, Tensor2 &stz0)
-
inline void exploit_symmetries_points(Tensor2 &stz, Tensor2 &stz_sym)
-
inline void apply_odd_symmetry(Tensor2 &field)
-
inline void apply_even_symmetry(Tensor2 &field)
Private Members
-
CachedTensor<T, 2> points_cyl_sym
-
shared_ptr<RegularGridInterpolant3D<Tensor2>> interp_modB
-
shared_ptr<RegularGridInterpolant3D<Tensor2>> interp_dmodBdtheta
-
shared_ptr<RegularGridInterpolant3D<Tensor2>> interp_dmodBdzeta
-
shared_ptr<RegularGridInterpolant3D<Tensor2>> interp_dmodBds
-
shared_ptr<RegularGridInterpolant3D<Tensor2>> interp_G
-
shared_ptr<RegularGridInterpolant3D<Tensor2>> interp_iota
-
shared_ptr<RegularGridInterpolant3D<Tensor2>> interp_dGds
-
shared_ptr<RegularGridInterpolant3D<Tensor2>> interp_I
-
shared_ptr<RegularGridInterpolant3D<Tensor2>> interp_dIds
-
shared_ptr<RegularGridInterpolant3D<Tensor2>> interp_diotads
-
shared_ptr<RegularGridInterpolant3D<Tensor2>> interp_psip
-
shared_ptr<RegularGridInterpolant3D<Tensor2>> interp_R
-
shared_ptr<RegularGridInterpolant3D<Tensor2>> interp_Z
-
shared_ptr<RegularGridInterpolant3D<Tensor2>> interp_nu
-
shared_ptr<RegularGridInterpolant3D<Tensor2>> interp_K
-
shared_ptr<RegularGridInterpolant3D<Tensor2>> interp_dRdtheta
-
shared_ptr<RegularGridInterpolant3D<Tensor2>> interp_dRdzeta
-
shared_ptr<RegularGridInterpolant3D<Tensor2>> interp_dRds
-
shared_ptr<RegularGridInterpolant3D<Tensor2>> interp_dZdtheta
-
shared_ptr<RegularGridInterpolant3D<Tensor2>> interp_dZdzeta
-
shared_ptr<RegularGridInterpolant3D<Tensor2>> interp_dZds
-
shared_ptr<RegularGridInterpolant3D<Tensor2>> interp_dnudtheta
-
shared_ptr<RegularGridInterpolant3D<Tensor2>> interp_dnudzeta
-
shared_ptr<RegularGridInterpolant3D<Tensor2>> interp_dnuds
-
shared_ptr<RegularGridInterpolant3D<Tensor2>> interp_dKdtheta
-
shared_ptr<RegularGridInterpolant3D<Tensor2>> interp_dKdzeta
-
shared_ptr<RegularGridInterpolant3D<Tensor2>> interp_K_derivs
-
shared_ptr<RegularGridInterpolant3D<Tensor2>> interp_nu_derivs
-
shared_ptr<RegularGridInterpolant3D<Tensor2>> interp_R_derivs
-
shared_ptr<RegularGridInterpolant3D<Tensor2>> interp_Z_derivs
-
shared_ptr<RegularGridInterpolant3D<Tensor2>> interp_modB_derivs
-
shared_ptr<RegularGridInterpolant3D<Tensor2>> interp_d2modBdtheta2
-
shared_ptr<RegularGridInterpolant3D<Tensor2>> interp_d2modBdzeta2
-
shared_ptr<RegularGridInterpolant3D<Tensor2>> interp_d2modBdthetadzeta
-
bool status_modB = false
-
bool status_dmodBdtheta = false
-
bool status_dmodBdzeta = false
-
bool status_dmodBds = false
-
bool status_G = false
-
bool status_I = false
-
bool status_iota = false
-
bool status_dGds = false
-
bool status_dIds = false
-
bool status_diotads = false
-
bool status_psip = false
-
bool status_R = false
-
bool status_Z = false
-
bool status_nu = false
-
bool status_K = false
-
bool status_dRdtheta = false
-
bool status_dRdzeta = false
-
bool status_dRds = false
-
bool status_dZdtheta = false
-
bool status_dZdzeta = false
-
bool status_dZds = false
-
bool status_dnudtheta = false
-
bool status_dnudzeta = false
-
bool status_dnuds = false
-
bool status_dKdtheta = false
-
bool status_dKdzeta = false
-
bool status_K_derivs = false
-
bool status_R_derivs = false
-
bool status_Z_derivs = false
-
bool status_nu_derivs = false
-
bool status_modB_derivs = false
-
bool status_d2modBdtheta2 = false
-
bool status_d2modBdthetadzeta = false
-
bool status_d2modBdzeta2 = false
-
const bool extrapolate
-
const bool stellsym = false
-
const int nfp = 1
-
vector<bool> symmetries = vector<bool>(1, false)
-
const shared_ptr<BoozerMagneticField<T>> field
Typedefs
-
typedef xt::pyarray<double> Array
Functions
-
void inverse_fourier_transform_odd(Array &K, Array &kmns, Array &xm, Array &xn, Array &thetas, Array &zetas)
-
void inverse_fourier_transform_even(Array &K, Array &kmns, Array &xm, Array &xn, Array &thetas, Array &zetas)
-
Array compute_kmns(Array &rmnc, Array &drmncds, Array &zmns, Array &dzmnsds, Array &numns, Array &dnumnsds, Array &bmnc, Array &iota, Array &G, Array &I, Array &xm, Array &xn, Array &thetas, Array &zetas)
-
Array compute_kmnc_kmns(Array &rmnc, Array &drmncds, Array &zmns, Array &dzmnsds, Array &numns, Array &dnumnsds, Array &bmnc, Array &rmns, Array &drmnsds, Array &zmnc, Array &dzmncds, Array &numnc, Array &dnumncds, Array &bmns, Array &iota, Array &G, Array &I, Array &xm, Array &xn, Array &thetas, Array &zetas)
Typedefs
-
typedef xt::pyarray<double> Array
Functions
-
double boozer_residual(double G, double iota, Array &xphi, Array &xtheta, Array &B, bool weight_inv_modB)
Defines
-
MYIF(c)
Simsopt++ Caching Mechanism
-
template<class Array>
class Cache Public Functions
-
inline bool get_status(string key) const
-
inline Array &get_or_create_and_fill(string key, vector<int> dims, std::function<void(Array&)> impl)
-
inline void invalidate_cache()
Private Members
-
std::map<string, CachedArray<Array>> cache
-
inline bool get_status(string key) const
-
template<class Array>
struct CachedArray
Curves and Coils
-
template<class Array>
class Coil Public Functions
-
template<class Array>
class CurrentBase Subclassed by Current< Array >, PyCurrentBaseTrampoline
-
template<class Array>
class Current : public CurrentBase<Array> -
Private Members
-
double value
-
double value
-
template<class Array>
class Curve Subclassed by CurvePlanarFourier< Array >, CurveRZFourier< Array >, CurveXYZFourier< Array >, PyCurveTrampoline< CurveBase >
Public Functions
-
inline Curve(int _numquadpoints)
-
inline Curve(vector<double> _quadpoints)
-
inline void invalidate_cache()
-
inline virtual void set_dofs(const vector<double> &_dofs)
-
virtual int num_dofs() = 0
-
virtual void set_dofs_impl(const vector<double> &_dofs) = 0
-
virtual vector<double> get_dofs() = 0
-
virtual ~Curve() = default
Protected Functions
Private Members
-
map<string, CachedArray<Array>> cache
-
map<string, CachedArray<Array>> cache_persistent
-
inline Curve(int _numquadpoints)
-
template<class Array>
class CurvePlanarFourier : public Curve<Array> Public Functions
-
inline CurvePlanarFourier(int _numquadpoints, int _order)
-
inline CurvePlanarFourier(vector<double> _quadpoints, int _order)
-
inline virtual int num_dofs() override
-
inline virtual void set_dofs_impl(const vector<double> &dofs) override
-
inline virtual vector<double> get_dofs() override
Private Functions
-
double inv_magnitude()
-
inline CurvePlanarFourier(int _numquadpoints, int _order)
Warning
doxygenfile: Cannot find file “curveprzfourier.h
-
template<class Array>
class CurveXYZFourier : public Curve<Array> Public Functions
-
inline CurveXYZFourier(int _numquadpoints, int _order)
-
inline CurveXYZFourier(vector<double> _quadpoints, int _order)
-
inline virtual int num_dofs() override
-
inline virtual void set_dofs_impl(const vector<double> &_dofs) override
-
inline virtual vector<double> get_dofs() override
-
inline CurveXYZFourier(int _numquadpoints, int _order)
Fields
Typedefs
-
typedef xt::pyarray<double> Array
Functions
Typedefs
-
typedef xt::pyarray<double> Array
Functions
Typedefs
-
typedef xt::pyarray<double> PyArray
Functions
-
template<template<class, std::size_t, xt::layout_type> class T>
class MagneticField Subclassed by BiotSavart< T, Array >, InterpolatedField< T >, PyMagneticFieldTrampoline< MagneticFieldBase >, WireframeField< T, Array, IntArray >
Public Types
Public Functions
-
inline MagneticField()
-
inline virtual void invalidate_cache()
-
inline MagneticField &set_points_cyl(Tensor2 &p)
-
inline MagneticField &set_points_cart(Tensor2 &p)
-
inline MagneticField &set_points(Tensor2 &p)
Protected Functions
-
inline virtual void _set_points_cb()
Protected Attributes
-
CachedTensor<T, 2> points_cart
-
CachedTensor<T, 2> points_cyl
-
CachedTensor<T, 2> data_B
-
CachedTensor<T, 2> data_A
-
CachedTensor<T, 2> data_GradAbsB
-
CachedTensor<T, 2> data_AbsB
-
CachedTensor<T, 2> data_Bcyl
-
CachedTensor<T, 2> data_Acyl
-
CachedTensor<T, 2> data_GradAbsBcyl
-
CachedTensor<T, 3> data_dB
-
CachedTensor<T, 3> data_dA
-
CachedTensor<T, 4> data_ddB
-
CachedTensor<T, 4> data_ddA
-
int npoints
-
inline MagneticField()
-
template<template<class, std::size_t, xt::layout_type> class T, class Array>
class BiotSavart : public MagneticField<T> Public Functions
-
void compute(int derivatives)
-
void compute_A(int derivatives)
-
inline virtual void invalidate_cache() override
-
inline bool fieldcache_get_status(string key)
Protected Functions
-
inline virtual void _B_impl(Tensor2 &B) override
-
inline virtual void _dB_by_dX_impl(Tensor3 &dB_by_dX) override
-
inline virtual void _d2B_by_dXdX_impl(Tensor4 &d2B_by_dXdX) override
-
inline virtual void _A_impl(Tensor2 &A) override
-
inline virtual void _dA_by_dX_impl(Tensor3 &dA_by_dX) override
-
inline virtual void _d2A_by_dXdX_impl(Tensor4 &d2A_by_dXdX) override
Private Functions
-
inline void fill_points(const Tensor2 &points)
-
void compute(int derivatives)
-
template<template<class, std::size_t, xt::layout_type> class T>
class InterpolatedField : public MagneticField<T> Public Functions
Public Members
-
const shared_ptr<MagneticField<T>> field
-
const RangeTriplet r_range
-
const RangeTriplet phi_range
-
const RangeTriplet z_range
-
const InterpolationRule rule
Protected Functions
-
inline virtual void _B_cyl_impl(Tensor2 &B_cyl) override
-
inline virtual void _GradAbsB_cyl_impl(Tensor2 &GradAbsB_cyl) override
-
inline virtual void _B_impl(Tensor2 &B) override
-
inline virtual void _GradAbsB_impl(Tensor2 &GradAbsB) override
-
inline void exploit_symmetries_points(Tensor2 &rphiz, Tensor2 &rphiz_sym)
-
inline void apply_symmetries_to_B_cyl(Tensor2 &field)
-
inline void apply_symmetries_to_GradAbsB_cyl(Tensor2 &field)
Private Members
-
CachedTensor<T, 2> points_cyl_sym
- std::function< std::vector< bool >Vec, Vec, Vec)> skip
-
shared_ptr<RegularGridInterpolant3D<Tensor2>> interp_B
-
shared_ptr<RegularGridInterpolant3D<Tensor2>> interp_GradAbsB
-
bool status_B = false
-
bool status_GradAbsB = false
-
const bool extrapolate
-
const bool stellsym = false
-
const int nfp = 1
-
vector<bool> symmetries = vector<bool>(1, false)
-
const shared_ptr<MagneticField<T>> field
-
template<template<class, std::size_t, xt::layout_type> class T, class Array, class IntArray>
class WireframeField : public MagneticField<T> Public Functions
-
inline WireframeField(vector<Array> _nodes, IntArray _segments, vector<double> _seg_signs, Array _currents)
-
void compute(int derivatives)
-
inline virtual void invalidate_cache() override
-
inline bool fieldcache_get_status(string key)
Protected Functions
-
inline virtual void _B_impl(Tensor2 &B) override
-
inline virtual void _dB_by_dX_impl(Tensor3 &dB_by_dX) override
Private Functions
-
inline void fill_points(const Tensor2 &points)
-
inline WireframeField(vector<Array> _nodes, IntArray _segments, vector<double> _seg_signs, Array _currents)
Typedefs
-
typedef xt::pyarray<double> PyArray
Functions
Typedefs
-
typedef xt::pyarray<double> PyArray
Functions
Defines
-
MYIF(c)
Functions
-
template<class T, int derivs>
void wireframe_field_kernel(AlignedPaddedVec &pointsx, AlignedPaddedVec &pointsy, AlignedPaddedVec &pointsz, std::vector<double> &node0, std::vector<double> &node1, T &B, T &dB_by_dX, T &d2B_by_dXdX)
Surfaces
-
template<class Array>
class Surface Subclassed by PySurfaceTrampoline< SurfaceBase >, SurfaceRZFourier< Array >, SurfaceXYZFourier< Array >, SurfaceXYZTensorFourier< Array >
Public Functions
-
inline Surface(vector<double> _quadpoints_phi, vector<double> _quadpoints_theta)
-
void scale(double scale)
-
void _extend_via_normal_for_nonuniform_phi(double distance)
-
void extend_via_projected_normal(double distance)
-
inline void invalidate_cache()
-
inline virtual void set_dofs(const vector<double> &_dofs)
-
virtual int num_dofs() = 0
-
virtual void set_dofs_impl(const vector<double> &_dofs) = 0
-
virtual vector<double> get_dofs() = 0
-
double area()
-
double volume()
-
virtual ~Surface() = default
Private Functions
Private Members
-
map<string, CachedArray<Array>> cache
-
map<string, CachedArray<Array>> cache_persistent
-
inline Surface(vector<double> _quadpoints_phi, vector<double> _quadpoints_theta)
-
template<class Array>
class SurfaceRZFourier : public Surface<Array> Public Functions
-
inline SurfaceRZFourier(int _mpol, int _ntor, int _nfp, bool _stellsym, vector<double> _quadpoints_phi, vector<double> _quadpoints_theta)
-
inline void allocate()
-
inline virtual int num_dofs() override
-
inline virtual void set_dofs_impl(const vector<double> &dofs) override
-
inline virtual vector<double> get_dofs() override
-
inline SurfaceRZFourier(int _mpol, int _ntor, int _nfp, bool _stellsym, vector<double> _quadpoints_phi, vector<double> _quadpoints_theta)
-
template<class Array>
class SurfaceXYZFourier : public Surface<Array> Public Functions
-
inline SurfaceXYZFourier(int _mpol, int _ntor, int _nfp, bool _stellsym, vector<double> _quadpoints_phi, vector<double> _quadpoints_theta)
-
inline virtual int num_dofs() override
-
inline virtual void set_dofs_impl(const vector<double> &dofs) override
-
inline virtual vector<double> get_dofs() override
-
inline double get_coeff(int dim, bool cos, int m, int i)
-
inline SurfaceXYZFourier(int _mpol, int _ntor, int _nfp, bool _stellsym, vector<double> _quadpoints_phi, vector<double> _quadpoints_theta)
-
template<class Array>
class SurfaceXYZTensorFourier : public Surface<Array> Public Functions
-
inline SurfaceXYZTensorFourier(int _mpol, int _ntor, int _nfp, bool _stellsym, std::vector<bool> _clamped_dims, vector<double> _quadpoints_phi, vector<double> _quadpoints_theta)
-
inline virtual int num_dofs() override
-
inline virtual void set_dofs_impl(const vector<double> &dofs) override
-
inline virtual vector<double> get_dofs() override
-
inline virtual void gamma_impl(Array &data, Array &quadpoints_phi, Array &quadpoints_theta) override
Private Functions
-
inline void build_cache()
-
inline bool apply_bc_enforcer(int dim, int n, int m)
-
inline double bc_enforcer_fun(int dim, int n, double phi, int m, double theta)
-
inline double bc_enforcer_dphi_fun(int dim, int n, double phi, int m, double theta)
-
inline double bc_enforcer_dphidphi_fun(int dim, int n, double phi, int m, double theta)
-
inline double bc_enforcer_dtheta_fun(int dim, int n, double phi, int m, double theta)
-
inline double bc_enforcer_dthetadtheta_fun(int dim, int n, double phi, int m, double theta)
-
inline double basis_fun(int dim, int n, int phiidx, int m, int thetaidx)
-
inline double basis_fun_dphi(int dim, int n, int phiidx, int m, int thetaidx)
-
inline double basis_fun_dphidphi(int dim, int n, int phiidx, int m, int thetaidx)
-
inline double basis_fun_dtheta(int dim, int n, int phiidx, int m, int thetaidx)
-
inline double basis_fun_dthetadphi(int dim, int n, int phiidx, int m, int thetaidx)
-
inline double basis_fun_dthetadtheta(int dim, int n, int phiidx, int m, int thetaidx)
-
inline double basis_fun(int dim, int n, double phi, int m, double theta)
-
inline double basis_fun_dphi(int dim, int n, double phi, int m, double theta)
-
inline double basis_fun_dtheta(int dim, int n, double phi, int m, double theta)
-
inline double basis_fun_dthetadtheta(int dim, int n, double phi, int m, double theta)
-
inline double basis_fun_dphidphi(int dim, int n, double phi, int m, double theta)
-
inline double basis_fun_dthetadphi(int dim, int n, double phi, int m, double theta)
-
inline double basis_fun_phi(int n, double phi)
-
inline double basis_fun_phi_dash(int n, double phi)
-
inline double basis_fun_phi_dashdash(int n, double phi)
-
inline double basis_fun_theta(int m, double theta)
-
inline double basis_fun_theta_dash(int m, double theta)
-
inline double basis_fun_theta_dashdash(int m, double theta)
-
inline bool skip(int dim, int m, int n)
-
inline double get_coeff(int dim, int m, int n)
-
inline SurfaceXYZTensorFourier(int _mpol, int _ntor, int _nfp, bool _stellsym, std::vector<bool> _clamped_dims, vector<double> _quadpoints_phi, vector<double> _quadpoints_theta)
Typedefs
-
typedef xt::pyarray<double> Array
Optimization
Typedefs
-
typedef xt::pyarray<double> Array
Functions
-
std::tuple<double, double, double> projection_L2_balls(double x1, double x2, double x3, double m_maxima)
-
std::tuple<double, double, double> phi_MwPGP(double x1, double x2, double x3, double g1, double g2, double g3, double m_maxima)
-
std::tuple<double, double, double> beta_tilde(double x1, double x2, double x3, double g1, double g2, double g3, double alpha, double m_maxima)
-
std::tuple<double, double, double> g_reduced_gradient(double x1, double x2, double x3, double g1, double g2, double g3, double alpha, double m_maxima)
-
std::tuple<double, double, double> g_reduced_projected_gradient(double x1, double x2, double x3, double g1, double g2, double g3, double alpha, double m_maxima)
-
double find_max_alphaf(double x1, double x2, double x3, double p1, double p2, double p3, double m_maxima)
-
void print_MwPGP(Array &A_obj, Array &b_obj, Array &x_k1, Array &m_proxy, Array &m_maxima, Array &m_history, Array &objective_history, Array &R2_history, int print_iter, int k, double nu, double reg_l0, double reg_l1, double reg_l2)
-
std::tuple<Array, Array, Array, Array> MwPGP_algorithm(Array &A_obj, Array &b_obj, Array &ATb, Array &m_proxy, Array &m0, Array &m_maxima, double alpha, double nu = 1.0e100, double epsilon = 1.0e-4, double reg_l0 = 0.0, double reg_l1 = 0.0, double reg_l2 = 0.0, int max_iter = 500, double min_fb = 1.0e-20, bool verbose = false)
-
std::tuple<Array, Array, Array, Array, Array> GPMO_backtracking(Array &A_obj, Array &b_obj, Array &mmax, Array &normal_norms, int K, bool verbose, int nhistory, int backtracking, Array &dipole_grid_xyz, int single_direction, int Nadjacent, int max_nMagnets)
-
std::tuple<Array, Array, Array, Array> GPMO_multi(Array &A_obj, Array &b_obj, Array &mmax, Array &normal_norms, int K, bool verbose, int nhistory, Array &dipole_grid_xyz, int single_direction, int Nadjacent)
-
std::tuple<Array, Array, Array, Array> GPMO_ArbVec(Array &A_obj, Array &b_obj, Array &mmax, Array &normal_norms, Array &pol_vectors, int K, bool verbose, int nhistory)
-
std::tuple<Array, Array, Array, Array, Array> GPMO_ArbVec_backtracking(Array &A_obj, Array &b_obj, Array &mmax, Array &normal_norms, Array &pol_vectors, int K, bool verbose, int nhistory, int backtracking, Array &dipole_grid_xyz, int Nadjacent, double thresh_angle, int max_nMagnets, Array &x_init)
-
std::tuple<Array, Array, Array, Array> GPMO_baseline(Array &A_obj, Array &b_obj, Array &mmax, Array &normal_norms, int K, bool verbose, int nhistory, int single_direction)
Functions
-
std::tuple<Array, IntArray, IntArray, Array, IntArray, Array, Array, Array> GSCO(bool no_crossing, bool no_new_coils, bool match_current, Array &A_obj, Array &b_obj, double default_current, double max_current, int max_loop_count, IntArray &loops, IntArray &free_loops, IntArray &segments, IntArray &connections, double lambda_P, int max_iter, Array &x_init, IntArray &loop_count_init, int print_interval)
-
void record_iter(int iter, double curr, int loop_ind, double f_B, double f_S, double f, int *iter_hist_ptr, double *curr_hist_ptr, int *loop_hist_ptr, double *f_B_hist_ptr, double *f_S_hist_ptr, double *f_hist_ptr)
-
void print_iter(int iter, double f_B, double f_S, double f)
-
void check_eligibility(int nLoops, double default_current, double max_current, int max_loop_count, bool no_crossing, bool no_new_coils, bool match_current, double tol, int *loops_rep, int *freeLoops, int *loop_count, int *segments, int *connections, double *x, double *current)
Utilities
-
class InterpolationRule
Subclassed by ChebyshevInterpolationRule, UniformInterpolationRule
Public Functions
-
inline InterpolationRule(int degree)
-
inline double basis_fun(int idx, double x) const
Protected Functions
-
inline void build_scalings()
-
inline InterpolationRule(int degree)
-
template<class Array>
class RegularGridInterpolant3D Public Functions
-
inline RegularGridInterpolant3D(InterpolationRule rule, RangeTriplet xrange, RangeTriplet yrange, RangeTriplet zrange, int value_size, bool out_of_bounds_ok, std::function<std::vector<bool>(Vec, Vec, Vec)> skip)
-
inline RegularGridInterpolant3D(InterpolationRule rule, RangeTriplet xrange, RangeTriplet yrange, RangeTriplet zrange, int value_size, bool out_of_bounds_ok)
Private Functions
-
inline int idx_dof(int i, int j, int k)
-
inline int idx_cell(int i, int j, int k)
-
inline int idx_mesh(int i, int j, int k)
-
inline int idx_dof_local(int i, int j, int k)
-
int locate_unsafe(double x, double y, double z)
-
void evaluate_inplace(double x, double y, double z, double *res)
-
void evaluate_local(double x, double y, double z, int cell_idx, double *res)
Private Members
-
const int nx
-
const int ny
-
const int nz
-
double hx
-
double hy
-
double hz
-
const double xmin
-
const double ymin
-
const double zmin
-
const double xmax
-
const double ymax
-
const double zmax
-
const int value_size
-
const InterpolationRule rule
-
const bool out_of_bounds_ok
-
std::unordered_map<int, AlignedPaddedVec> all_local_vals_map
-
uint32_t cells_to_skip
-
uint32_t cells_to_keep
-
uint32_t dofs_to_skip
-
uint32_t dofs_to_keep
-
int local_vals_size
-
int padded_value_size
Private Static Attributes
-
static const int simdcount = 1
-
inline RegularGridInterpolant3D(InterpolationRule rule, RangeTriplet xrange, RangeTriplet yrange, RangeTriplet zrange, int value_size, bool out_of_bounds_ok, std::function<std::vector<bool>(Vec, Vec, Vec)> skip)
-
class UniformInterpolationRule : public InterpolationRule
Public Functions
-
inline UniformInterpolationRule(int degree)
Protected Functions
-
inline void build_scalings()
-
inline UniformInterpolationRule(int degree)
-
class ChebyshevInterpolationRule : public InterpolationRule
Public Functions
-
inline ChebyshevInterpolationRule(int degree)
Protected Functions
-
inline void build_scalings()
-
inline ChebyshevInterpolationRule(int degree)
Functions
-
Vec linspace(double min, double max, int n, bool endpoint)
Typedefs
-
using AlignedPaddedVec = std::vector<double, AlignedPaddedAllocator<double>>
Functions
-
inline double rsqrt(const double &r2)
-
template<typename T, std::size_t ALIGNMENT_IN_BYTES = 32>
class AlignedPaddedAllocator - #include <simdhelpers.h>
Returns aligned pointers when allocations are requested. Default alignment is 64B = 512b, sufficient for AVX-512 and most cache line sizes.
- Template Parameters:
ALIGNMENT_IN_BYTES – Must be a positive power of 2.
Public Functions
-
constexpr AlignedPaddedAllocator() noexcept = default
-
constexpr AlignedPaddedAllocator(const AlignedPaddedAllocator&) noexcept = default
-
template<typename U>
inline constexpr AlignedPaddedAllocator(AlignedPaddedAllocator<U, ALIGNMENT_IN_BYTES> const&) noexcept
Public Static Attributes
-
static constexpr std::align_val_t ALIGNMENT = {ALIGNMENT_IN_BYTES}
-
template<class U>
struct rebind - #include <simdhelpers.h>
This is only necessary because AlignedAllocator has a second template argument for the alignment that will make the default std::allocator_traits implementation fail during compilation.
Public Types
-
using other = AlignedPaddedAllocator<U, ALIGNMENT_IN_BYTES>
-
using other = AlignedPaddedAllocator<U, ALIGNMENT_IN_BYTES>
Typedefs
-
typedef Eigen::Vector3d Vec3d
Functions
Variables
-
constexpr size_t ALIGN_BYTES = 32
-
struct Vec3dStd
Public Functions
-
inline Vec3dStd()
-
inline Vec3dStd(double x_, double y_, double z_)
-
inline Vec3dStd(double *xptr, double *yptr, double *zptr)
-
inline void store_aligned(double *xptr, double *yptr, double *zptr)
-
inline double &operator[](int i)
Friends
-
inline Vec3dStd()
-
class StoppingCriterion
Subclassed by IterationStoppingCriterion, LevelsetStoppingCriterion< Array >, MaxRStoppingCriterion, MaxToroidalFluxStoppingCriterion, MaxZStoppingCriterion, MinRStoppingCriterion, MinToroidalFluxStoppingCriterion, MinZStoppingCriterion, ToroidalTransitStoppingCriterion
-
class ToroidalTransitStoppingCriterion : public StoppingCriterion
-
class MaxToroidalFluxStoppingCriterion : public StoppingCriterion
Public Functions
-
inline MaxToroidalFluxStoppingCriterion(double max_s)
-
inline virtual bool operator()(int iter, double t, double s, double theta, double zeta) override
Private Members
-
double max_s
-
inline MaxToroidalFluxStoppingCriterion(double max_s)
-
class MinToroidalFluxStoppingCriterion : public StoppingCriterion
Public Functions
-
inline MinToroidalFluxStoppingCriterion(double min_s)
-
inline virtual bool operator()(int iter, double t, double s, double theta, double zeta) override
Private Members
-
double min_s
-
inline MinToroidalFluxStoppingCriterion(double min_s)
-
class MinZStoppingCriterion : public StoppingCriterion
Public Functions
-
inline MinZStoppingCriterion(double crit_z)
-
inline virtual bool operator()(int iter, double t, double x, double y, double z) override
Private Members
-
double crit_z
-
inline MinZStoppingCriterion(double crit_z)
-
class MaxZStoppingCriterion : public StoppingCriterion
Public Functions
-
inline MaxZStoppingCriterion(double crit_z)
-
inline virtual bool operator()(int iter, double t, double x, double y, double z) override
Private Members
-
double crit_z
-
inline MaxZStoppingCriterion(double crit_z)
-
class MinRStoppingCriterion : public StoppingCriterion
Public Functions
-
inline MinRStoppingCriterion(double crit_r)
-
inline virtual bool operator()(int iter, double t, double x, double y, double z) override
Private Members
-
double crit_r
-
inline MinRStoppingCriterion(double crit_r)
-
class MaxRStoppingCriterion : public StoppingCriterion
Public Functions
-
inline MaxRStoppingCriterion(double crit_r)
-
inline virtual bool operator()(int iter, double t, double x, double y, double z) override
Private Members
-
double crit_r
-
inline MaxRStoppingCriterion(double crit_r)
-
class IterationStoppingCriterion : public StoppingCriterion
Public Functions
-
inline IterationStoppingCriterion(int max_iter)
-
inline virtual bool operator()(int iter, double t, double x, double y, double z) override
Private Members
-
int max_iter
-
inline IterationStoppingCriterion(int max_iter)
-
template<class Array>
class LevelsetStoppingCriterion : public StoppingCriterion Public Functions
-
inline virtual bool operator()(int iter, double t, double x, double y, double z) override
Private Members
-
shared_ptr<RegularGridInterpolant3D<Array>> levelset
-
inline virtual bool operator()(int iter, double t, double x, double y, double z) override