4#include <dg/file/json_utilities.h>
51 std::vector<double>
c;
63 A = js.get(
"A", 0).asDouble();
64 pp = js.get(
"PP", 1).asDouble();
65 pi = js.get(
"PI", 1).asDouble();
67 for (
unsigned i=0;i<12;i++)
68 c[i] = js[
"c"].get(i,0.).asDouble();
70 R_0 = js.get(
"R_0", 0.).asDouble();
71 a =
R_0* js.get(
"inverseaspectratio", 0.).asDouble();
72 elongation= js.get(
"elongation", 1.).asDouble();
75 description = js.get(
"description",
"standardX").asString();
76 }
catch ( std::exception& err)
91 dg::file::JsonType
dump( )
const
93 dg::file::JsonType js;
97 for (
unsigned i=0;i<12;i++) js[
"c"][i] =
c[i];
99 js[
"inverseaspectratio"] =
a/
R_0;
102 js[
"equilibrium"] =
"solovev";
117 for(
int i=7; i<12; i++)
118 if( fabs(
c[i]) >= 1e-10)
133 void display( std::ostream& os = std::cout )
const
135 dg::file::WrappedJsonValue js =
dump();
136 os <<
"Solovev Geometrical parameters are: \n"
137 <<js.toStyledString();
description
How flux function looks like. Decider on whether and what flux aligned grid to construct.
Definition magnetic_field.h:50
@ solovev
dg::geo::solovev::Psip
Constructs and display geometric parameters for the solovev and taylor fields.
Definition solovev_parameters.h:43
double pp
prefactor for Psi_p
Definition solovev_parameters.h:46
double R_0
major tokamak radius
Definition solovev_parameters.h:45
double a
little tokamak radius
Definition solovev_parameters.h:48
dg::file::JsonType dump() const
Put values into a json string.
Definition solovev_parameters.h:91
double A
A coefficient.
Definition solovev_parameters.h:44
bool isToroidal() const
True if pp==0.
Definition solovev_parameters.h:127
Parameters(const dg::file::WrappedJsonValue &js)
Construct from Json dataset.
Definition solovev_parameters.h:62
std::string description
Definition solovev_parameters.h:52
std::vector< double > c
12 coefficients for the solovev equilibrium;
Definition solovev_parameters.h:51
double pi
prefactor for current I
Definition solovev_parameters.h:47
double elongation
elongation of the magnetic surfaces
Definition solovev_parameters.h:49
bool hasXpoint() const
True if any coefficient c_i!=0 with 7<=i<12.
Definition solovev_parameters.h:115
double triangularity
triangularity of the magnetic surfaces
Definition solovev_parameters.h:50
void display(std::ostream &os=std::cout) const
Write variables as a formatted string.
Definition solovev_parameters.h:133