Extension: Geometries
#include "dg/geometries/geometries.h"

\(\psi_p(R,Z)\) dg::geo::createMagneticField More...

Collaboration diagram for 3.1 Creating a flux function:

Modules

 The solovev expansion
 
 The polynomial expansion
 
 The Taylor state expansion
 
 The Guenter expansion
 
 The Purely Toroidal expansion
 
 The Circular expansion
 
 Modification of any expansion
 \( H(\psi_p(R,Z))\), dg::geo::createModifiedField
 
 Wall and Sheath
 

Functions

static TokamakMagneticField dg::geo::createMagneticField (dg::file::WrappedJsonValue gs)
 Create a Magnetic field based on the given parameters. More...
 

Detailed Description

\(\psi_p(R,Z)\) dg::geo::createMagneticField

Function Documentation

◆ createMagneticField()

static TokamakMagneticField dg::geo::createMagneticField ( dg::file::WrappedJsonValue  gs)
inlinestatic

Create a Magnetic field based on the given parameters.

This function abstracts the Magnetic field generation. It reads an input Json file that tells this function via the "equilibrium" parameter which field to generate and which parameters to expect in the file. See a list of possible combinations in the following

// Solovev (and Taylor) geometry parameters
{
"equilibrium": "solovev",
// Note that for the taylor field you need to include boost before the geometries header!
// "equilibrium" : "taylor",
"A": 0,
"R_0": 213.36,
"PP": 1,
"PI": 1,
"c":[
0.072597888572520090,
-0.14926096478076946,
// ... 12 coefficients in total
],
"description" : "standardX",
"inverseaspectratio": 0.3211009174311926,
"triangularity": 0.3,
"elongation": 1.44
}
// Polynomial geometry parameters
{
"equilibrium" : "polynomial",
"M" : 8,
"N" : 8,
"PI" : -1.0,
"PP" : -1.0,
"R_0" : 906.38,
"c" :
[
-0.96689843290517163,
3.0863312163153722,
// ... M*N coefficients in total
],
"description" : "standardX",
"elongation" : 1.5,
"inverseaspectratio" : 0.27593818984547458,
"triangularity" : 0.40000000000000002
}
// Purely toroidal magnetic field
{
"equilibrium" : "toroidal",
"R_0" : 10
}
// Automatically chosen:
// description : "none",
// a : 1.0,
// elongation : 1.0,
// triangularity : 0.0
// Circular/ellipsoid flux surfaces
{
"equilibrium" : "circular",
"I_0" : 10,
"R_0" : 3,
"a" : 1.0,
"b" : 1.0
}
// Automatically chosen:
// description : "standardO",
// elongation : 1.0,
// triangularity : 0.0
// The guenter magnetic field
{
"equilibrium" : "guenter",
"I_0" : 10,
"R_0" : 3
}
// Automatically chosen:
// description : "square",
// a : 1.0,
// elongation : 1.0,
// triangularity : 0.0
See also
dg::geo::description to see valid values for the description field
Parameters
gsHas to contain "equilibrium" which is converted dg::geo::equilibrium, i.e. "solovev", "polynomial", .... After that the respective parameters are created, for example if "solovev", then the dg::geo::solovev::Parameters( gs) is called and forwarded to dg::geo::createSolovevField(gp); similar for the rest
Returns
A magnetic field object
Attention
This function is only defined if json/json.h is included before dg/geometries/geometries.h