4#ifdef JSONCPP_VERSION_STRING
5#include <dg/file/json_utilities.h>
54 std::vector<double>
c;
56#ifdef JSONCPP_VERSION_STRING
67 A = js.get(
"A", 0).asDouble();
68 pp = js.get(
"PP", 1).asDouble();
69 pi = js.get(
"PI", 1).asDouble();
71 for (
unsigned i=0;i<12;i++)
72 c[i] = js[
"c"].get(i,0.).asDouble();
74 R_0 = js.get(
"R_0", 0.).asDouble();
75 a =
R_0* js.get(
"inverseaspectratio", 0.).asDouble();
76 elongation= js.get(
"elongation", 1.).asDouble();
79 description = js.get(
"description",
"standardX").asString();
80 }
catch ( std::exception& err)
105 for (
unsigned i=0;i<12;i++) js[
"c"][i] =
c[i];
107 js[
"inverseaspectratio"] =
a/
R_0;
110 js[
"equilibrium"] =
"solovev";
124 bool hasXpoint( ) const{
126 for(
int i=7; i<12; i++)
127 if( fabs(
c[i]) >= 1e-10)
142 void display( std::ostream& os = std::cout )
const
144 os <<
"Solovev Geometrical parameters are: \n"
146 <<
" Prefactor Psi = "<<pp<<
"\n"
147 <<
" Prefactor I = "<<pi<<
"\n";
148 for(
unsigned i=0; i<12; i++)
149 os<<
" c"<<i+1<<
"\t\t = "<<c[i]<<
"\n";
151 os <<
" R0 = "<<R_0<<
"\n"
153 <<
" epsilon_a = "<<a/R_0<<
"\n"
155 <<
" elongation = "<<elongation<<
"\n"
156 <<
" triangularity = "<<triangularity<<
"\n";
description
How flux function looks like. Decider on whether and what flux aligned grid to construct.
Definition: magnetic_field.h:48
@ solovev
dg::geo::solovev::Psip
Constructs and display geometric parameters for the solovev and taylor fields.
Definition: solovev_parameters.h:46
double pp
prefactor for Psi_p
Definition: solovev_parameters.h:49
double R_0
major tokamak radius
Definition: solovev_parameters.h:48
double a
little tokamak radius
Definition: solovev_parameters.h:51
double A
A coefficient.
Definition: solovev_parameters.h:47
bool isToroidal() const
True if pp==0.
Definition: solovev_parameters.h:136
Parameters(const dg::file::WrappedJsonValue &js)
Construct from Json dataset.
Definition: solovev_parameters.h:66
std::string description
Definition: solovev_parameters.h:55
std::vector< double > c
12 coefficients for the solovev equilibrium;
Definition: solovev_parameters.h:54
double pi
prefactor for current I
Definition: solovev_parameters.h:50
double elongation
elongation of the magnetic surfaces
Definition: solovev_parameters.h:52
bool hasXpoint() const
True if any coefficient c_i!=0 with 7<=i<12.
Definition: solovev_parameters.h:124
Json::Value dump() const
Put values into a json string.
Definition: solovev_parameters.h:96
double triangularity
triangularity of the magnetic surfaces
Definition: solovev_parameters.h:53
void display(std::ostream &os=std::cout) const
Write variables as a formatted string.
Definition: solovev_parameters.h:142