4#ifdef JSONCPP_VERSION_STRING
5#include <dg/file/json_utilities.h>
55 std::vector<double>
c;
57#ifdef JSONCPP_VERSION_STRING
67 pp = js.get(
"PP", 1).asDouble();
68 pi = js.get(
"PI", 1).asDouble();
69 M = js.get(
"M", 1).asUInt();
70 N = js.get(
"N", 1).asUInt();
72 for (
unsigned i=0;i<
M*
N;i++)
73 c[i] = js[
"c"].get(i,0.).asDouble();
75 R_0 = js.get(
"R_0", 0.).asDouble();
76 a =
R_0*js.get(
"inverseaspectratio", 0.).asDouble();
77 elongation=js.get(
"elongation", 1.).asDouble();
79 description = js.get(
"description",
"standardX").asString();
94 for (
unsigned i=0;i<
N*
N;i++) js[
"c"][i] =
c[i];
96 js[
"inverseaspectratio"] =
a/
R_0;
99 js[
"equilibrium"] =
"polynomial";
109 bool isToroidal() const{
115 void display( std::ostream& os = std::cout )
const
117 os <<
"Polynomial Geometrical parameters are: \n"
118 <<
" Prefactor Psi = "<<pp<<
"\n"
119 <<
" Prefactor I = "<<pi<<
"\n"
120 <<
" number in R = "<<M<<
"\n"
121 <<
" number in Z = "<<N<<
"\n";
122 for(
unsigned i=0; i<M*N; i++)
123 os<<
" c"<<i+1<<
"\t\t = "<<c[i]<<
"\n";
125 os <<
" R0 = "<<R_0<<
"\n"
127 <<
" epsilon_a = "<<a/R_0<<
"\n"
129 <<
" elongation = "<<elongation<<
"\n"
130 <<
" triangularity = "<<triangularity<<
"\n";
description
How flux function looks like. Decider on whether and what flux aligned grid to construct.
Definition: magnetic_field.h:48
@ polynomial
dg::geo::polynomial::Psip
Constructs and display geometric parameters for the polynomial fields.
Definition: polynomial_parameters.h:46
Parameters(const dg::file::WrappedJsonValue &js)
Construct from Json dataset.
Definition: polynomial_parameters.h:66
std::string description
Definition: polynomial_parameters.h:56
void display(std::ostream &os=std::cout) const
Write variables as a formatted string.
Definition: polynomial_parameters.h:115
double triangularity
triangularity of the magnetic surfaces
Definition: polynomial_parameters.h:52
double pp
prefactor for Psi_p
Definition: polynomial_parameters.h:48
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:55
double R_0
major tokamak radius
Definition: polynomial_parameters.h:47
double a
little tokamak radius
Definition: polynomial_parameters.h:50
unsigned N
number of coefficients in Z
Definition: polynomial_parameters.h:54
double elongation
elongation of the magnetic surfaces
Definition: polynomial_parameters.h:51
unsigned M
number of coefficients in R
Definition: polynomial_parameters.h:53
Json::Value dump() const
Put values into a json string.
Definition: polynomial_parameters.h:87
double pi
prefactor for current I
Definition: polynomial_parameters.h:49