4#include <dg/file/json_utilities.h>
52 std::vector<double>
c;
63 pp = js.get(
"PP", 1).asDouble();
64 pi = js.get(
"PI", 1).asDouble();
65 M = js.get(
"M", 1).asUInt();
66 N = js.get(
"N", 1).asUInt();
68 for (
unsigned i=0;i<
M*
N;i++)
69 c[i] = js[
"c"].get(i,0.).asDouble();
71 R_0 = js.get(
"R_0", 0.).asDouble();
72 a =
R_0*js.get(
"inverseaspectratio", 0.).asDouble();
73 elongation=js.get(
"elongation", 1.).asDouble();
75 description = js.get(
"description",
"standardX").asString();
82 dg::file::JsonType
dump( )
const
84 dg::file::JsonType js;
89 for (
unsigned i=0;i<
M*
N;i++) js[
"c"][i] =
c[i];
91 js[
"inverseaspectratio"] =
a/
R_0;
94 js[
"equilibrium"] =
"polynomial";
109 void display( std::ostream& os = std::cout )
const
111 dg::file::WrappedJsonValue js =
dump();
112 os <<
"Polynomial Geometrical parameters are: \n"
113 <<js.toStyledString();
description
How flux function looks like. Decider on whether and what flux aligned grid to construct.
Definition magnetic_field.h:50
@ polynomial
dg::geo::polynomial::Psip
Constructs and display geometric parameters for the polynomial fields.
Definition polynomial_parameters.h:43
Parameters(const dg::file::WrappedJsonValue &js)
Construct from Json dataset.
Definition polynomial_parameters.h:62
std::string description
Definition polynomial_parameters.h:53
void display(std::ostream &os=std::cout) const
Write variables as a formatted string.
Definition polynomial_parameters.h:109
double triangularity
triangularity of the magnetic surfaces
Definition polynomial_parameters.h:49
dg::file::JsonType dump() const
Put values into a json string.
Definition polynomial_parameters.h:82
double pp
prefactor for Psi_p
Definition polynomial_parameters.h:45
bool isToroidal() const
True if pp==0.
Definition polynomial_parameters.h:103
std::vector< double > c
M*N coefficients for the polynomial equilibrium, c[i*N+j] corresponds to R^i Z^j;.
Definition polynomial_parameters.h:52
double R_0
major tokamak radius
Definition polynomial_parameters.h:44
double a
little tokamak radius
Definition polynomial_parameters.h:47
unsigned N
number of coefficients in Z
Definition polynomial_parameters.h:51
double elongation
elongation of the magnetic surfaces
Definition polynomial_parameters.h:48
unsigned M
number of coefficients in R
Definition polynomial_parameters.h:50
double pi
prefactor for current I
Definition polynomial_parameters.h:46