6 #ifndef grid_quantity_hpp
7 #define grid_quantity_hpp
38 virtual double get(
const double s)
const=0;
64 double get(
const double s)
const final;
95 double get(
const double s)
const final;
137 double get(
const double s)
const {
175 double get(
const double s)
const {
176 return grid.get(sqrt(s));
183 template<
class GRID_CLASS>
using vmec_quantity = std::vector<vmec_grid<GRID_CLASS> >;
191 const std::vector<double>
m;
193 const std::vector<double>
n;
205 const std::vector<double> &
m,
206 const std::vector<double> &
n) :
219 double get(
const double s,
221 const double v)
const {
224 for (
size_t i = 0, e =
m.size(); i < e; i++) {
243 const double v)
const {
246 for (
size_t i = 0, e =
m.size(); i < e; i++) {
265 const double v)
const {
268 for (
size_t i = 0, e =
m.size(); i < e; i++) {
283 template<
class GRID_CLASS>
using siesta_quantity = std::vector<siesta_quantity_1d<GRID_CLASS> >;
329 double get(
const double s,
331 const double v)
const {
334 for (
size_t m = 0, em =
mpol; m <= em; m++) {
335 for (
long n = -
ntor, en =
ntor; n <= en; n++) {
336 const size_t ni = n +
ntor;
356 const double v)
const {
359 for (
size_t m = 0, em =
mpol; m <= em; m++) {
360 for (
long n = -
ntor, en =
ntor; n <= en; n++) {
361 const size_t ni = n +
ntor;
381 const double v)
const {
384 for (
size_t m = 0, em =
mpol; m <= em; m++) {
385 for (
long n = -
ntor, en =
ntor; n <= en; n++) {
386 const size_t ni = n +
ntor;
A full grid quantity.
Definition: grid_quantity.hpp:49
half_grid get_prime() const
Get a radial derivative at a s position.
Definition: grid_quantity.cpp:59
full_grid(const std::vector< double > &buffer)
Construct a full grid quantity.
Definition: grid_quantity.cpp:27
double get(const double s) const final
Get a value at a radial s position.
Definition: grid_quantity.cpp:36
A half grid quantity.
Definition: grid_quantity.hpp:80
full_grid get_prime(const double m) const
Get a radial derivative at a s position.
Definition: grid_quantity.cpp:111
double get(const double s) const final
Get a value at a radial s position.
Definition: grid_quantity.cpp:86
half_grid(const std::vector< double > &buffer)
Construct a half grid quantity.
Definition: grid_quantity.cpp:77
A radial quantity.
Definition: grid_quantity.hpp:18
const double ds
Grid spacing in s.
Definition: grid_quantity.hpp:23
radial_quantity(const std::vector< double > &buffer)
Construct a radial quantity.
Definition: grid_quantity.cpp:16
virtual double get(const double s) const =0
vitual interface to get a value at a radial s position.
const std::vector< double > buffer
Buffer containing radial quantity.
Definition: grid_quantity.hpp:21
A cosine parity vmec quantity.
Definition: grid_quantity.hpp:288
const size_t nfp
Number of field periods.
Definition: grid_quantity.hpp:297
const size_t mpol
M modes.
Definition: grid_quantity.hpp:291
siesta_fourier(const siesta_quantity< GRID_CLASS > &buffer, const size_t mpol, const size_t ntor, const std::vector< int > &tor_modes, const size_t nfp)
Siesta radial quantity.
Definition: grid_quantity.hpp:312
double get(const double s, const double u, const double v) const
Get a value at a radial s position.
Definition: grid_quantity.hpp:329
double get_du(const double s, const double u, const double v) const
Get a poloidal derivative at a radial s position.
Definition: grid_quantity.hpp:354
const size_t ntor
N modes.
Definition: grid_quantity.hpp:293
const PARITY func
Parity function.
Definition: grid_quantity.hpp:301
double get_dv(const double s, const double u, const double v) const
Get a toroidal derivative at a radial s position.
Definition: grid_quantity.hpp:379
const siesta_quantity< GRID_CLASS > quantity
Mode amplitudes.
Definition: grid_quantity.hpp:299
const std::vector< int > tor_modes
Toroidal modes.
Definition: grid_quantity.hpp:295
A radial siesta quantity.
Definition: grid_quantity.hpp:148
const GRID_CLASS grid
Radial grid buffer.
Definition: grid_quantity.hpp:151
siesta_grid(const std::vector< double > &buffer)
Siesta radial quantity.
Definition: grid_quantity.hpp:158
double get(const double s) const
Get a value at a radial s position.
Definition: grid_quantity.hpp:175
siesta_grid(const GRID_CLASS &grid)
Siesta radial quantity.
Definition: grid_quantity.hpp:165
A cosine parity vmec quantity.
Definition: grid_quantity.hpp:188
const PARITY func
Parity function.
Definition: grid_quantity.hpp:197
const std::vector< double > m
M modes.
Definition: grid_quantity.hpp:191
const vmec_quantity< GRID_CLASS > quantity
Mode amplitudes.
Definition: grid_quantity.hpp:195
double get_du(const double s, const double u, const double v) const
Get a poloidal derivative at a radial s position.
Definition: grid_quantity.hpp:241
double get(const double s, const double u, const double v) const
Get a value at a radial s position.
Definition: grid_quantity.hpp:219
vmec_fourier(const vmec_quantity< GRID_CLASS > &buffer, const std::vector< double > &m, const std::vector< double > &n)
Siesta radial quantity.
Definition: grid_quantity.hpp:204
const std::vector< double > n
N modes.
Definition: grid_quantity.hpp:193
double get_dv(const double s, const double u, const double v) const
Get a toroidal derivative at a radial s position.
Definition: grid_quantity.hpp:263
A radial vmec quantity.
Definition: grid_quantity.hpp:112
const GRID_CLASS grid
Radial grid buffer.
Definition: grid_quantity.hpp:115
vmec_grid(const GRID_CLASS &grid)
Vmec radial quantity.
Definition: grid_quantity.hpp:129
double get(const double s) const
Get a value at a radial s position.
Definition: grid_quantity.hpp:137
vmec_grid(const std::vector< double > &buffer)
Vmec radial quantity.
Definition: grid_quantity.hpp:122
std::vector< vmec_grid< GRID_CLASS > > vmec_quantity
Type for vmec fourier quantities.
Definition: grid_quantity.hpp:183
std::vector< siesta_grid< GRID_CLASS > > siesta_quantity_1d
Type for siesta fourier quantities for a single dimension.
Definition: grid_quantity.hpp:279
std::vector< siesta_quantity_1d< GRID_CLASS > > siesta_quantity
Type for siesta fourier quantities.
Definition: grid_quantity.hpp:283
Contains classes to control sine and cosine parity of fourier quantites.