Stellarator and Tokamak Modeling and Meshing Software (STOMMS)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
GridFieldData Class Reference

Public Member Functions

 GridFieldData ()
 
 GridFieldData (const std::vector< double > &pointsR, const std::vector< double > &pointsZ)
 
void setDoubleFieldOnGrid (const std::vector< double > &field, const FieldType &fieldType)
 
void setPsiArray (const std::vector< double > &psi)
 
void setPoloidalCurrentArray (const std::vector< double > &poloidalCurrent)
 
void setLimiter (const std::vector< double > &rLim, const std::vector< double > &zLim)
 
void setPlasmaBoundary (const std::vector< double > &rBdry, const std::vector< double > &zBdry)
 
void setDomainBox (const std::vector< double > &box)
 
void setPsiSpline (std::vector< double > &coefficeints, std::vector< int > &shape)
 
void setCurrentSpline (std::vector< double > &coefficeints, std::vector< int > &shape)
 
const std::vector< double > & getRPoints () const
 
const std::vector< double > & getZPoints () const
 
const std::vector< double > & getDoubleFieldData (const FieldType &fieldType) const
 
const std::vector< double > & getPsiArray () const
 
const std::vector< double > & getPoloidalCurrentArray () const
 
const std::vector< double > & getLimiterPointsR () const
 
const std::vector< double > & getLimiterPointsZ () const
 
const std::vector< double > & getBdryPointsR () const
 
const std::vector< double > & getBdryPointsZ () const
 
const std::vector< double > & getDomainBox () const
 
const std::vector< double > & getPsiSplineCoefficients () const
 
const std::vector< int > & getPsiSplineShape () const
 
const std::vector< double > & getCurrentSplineCoefficients () const
 
const std::vector< int > & getCurrentSplineShape () const
 

Detailed Description

A class to save data on a grid. We can add different fields to the same Grid. Currently supports reading grid data from eqdsk/eqd files.

Constructor & Destructor Documentation

◆ GridFieldData() [1/2]

GridFieldData::GridFieldData ( )
inline

Default constructor.

◆ GridFieldData() [2/2]

GridFieldData::GridFieldData ( const std::vector< double > &  pointsR,
const std::vector< double > &  pointsZ 
)

Constructor to create a physical grid. It adds no field data to grid.

Parameters
pointsRCoordinates of the points in the R direction.
pointsZCoordinates of the points in the Z direction.

Member Function Documentation

◆ getBdryPointsR()

const std::vector< double > & GridFieldData::getBdryPointsR ( ) const

Function to return r coordinate of physical boundary.

◆ getBdryPointsZ()

const std::vector< double > & GridFieldData::getBdryPointsZ ( ) const

Function to return z coordinate of physical boundary.

◆ getCurrentSplineCoefficients()

const std::vector< double > & GridFieldData::getCurrentSplineCoefficients ( ) const

Function to return a vector of poloidal current spline coefficients.

◆ getCurrentSplineShape()

const std::vector< int > & GridFieldData::getCurrentSplineShape ( ) const

Function to return a vector of size 2 for the shape of coefficients array. The original array is 2D which is flattened in a vector.

◆ getDomainBox()

const std::vector< double > & GridFieldData::getDomainBox ( ) const

Function to return a vector of size 4 for the rectangular domain box. rMin = box[0], zMin = box[1], rMax = box[2], zMax = box[3]

◆ getDoubleFieldData()

const std::vector< double > & GridFieldData::getDoubleFieldData ( const FieldType fieldType) const

Function to return a field of type double.

Parameters
fieldTypedesired output field.
Returns
a vector of the desired field.

◆ getLimiterPointsR()

const std::vector< double > & GridFieldData::getLimiterPointsR ( ) const

Function to return r coordinate of limiter points.

◆ getLimiterPointsZ()

const std::vector< double > & GridFieldData::getLimiterPointsZ ( ) const

Function to return z coordinate of limiter points.

◆ getPoloidalCurrentArray()

const std::vector< double > & GridFieldData::getPoloidalCurrentArray ( ) const

Function to return poloidal current field vector.

◆ getPsiArray()

const std::vector< double > & GridFieldData::getPsiArray ( ) const

Function to return psi field array.

◆ getPsiSplineCoefficients()

const std::vector< double > & GridFieldData::getPsiSplineCoefficients ( ) const

Function to return a vector of psi spline coefficients.

◆ getPsiSplineShape()

const std::vector< int > & GridFieldData::getPsiSplineShape ( ) const

Function to return a vector of size 3 for the shape of coefficients array. The original array is 3D which is flattened in a vector.

◆ getRPoints()

const std::vector< double > & GridFieldData::getRPoints ( ) const

Function to return r grid points.

◆ getZPoints()

const std::vector< double > & GridFieldData::getZPoints ( ) const

Function to return z grid points.

◆ setCurrentSpline()

void GridFieldData::setCurrentSpline ( std::vector< double > &  coefficeints,
std::vector< int > &  shape 
)

Function to set poloidal current spline coefficients to the grid data.

Parameters
coefficientsa vector containing the coefficients.
shapea vector of size 2 defining the shape of coefficients array. coefficients.size() == shape[0]*shape[1]

◆ setDomainBox()

void GridFieldData::setDomainBox ( const std::vector< double > &  box)

Function to set the domain box to grid data.

Parameters
boxA vector of size = 4 containing rMin, yMin, rMax, yMax.

◆ setDoubleFieldOnGrid()

void GridFieldData::setDoubleFieldOnGrid ( const std::vector< double > &  field,
const FieldType fieldType 
)

Function to set a field of type double on the grid.

Parameters
fielda vector of the field values on the grid.
fieldTypefield type. See class FieldType for details.

◆ setLimiter()

void GridFieldData::setLimiter ( const std::vector< double > &  rLim,
const std::vector< double > &  zLim 
)

Function to set raw limiter data (wall curve) to the grid data.

Parameters
rLimR coordinates of the limiter points.
zLimZ coordinates of the limiter points.

◆ setPlasmaBoundary()

void GridFieldData::setPlasmaBoundary ( const std::vector< double > &  rBdry,
const std::vector< double > &  zBdry 
)

Function to set plasma boundary (separatrix) data to the grid data.

Parameters
rBdryR coordinates of the poloidal boundary.
zBdryZ coordinates of the poloidal boundary.

◆ setPoloidalCurrentArray()

void GridFieldData::setPoloidalCurrentArray ( const std::vector< double > &  poloidalCurrent)

Function to set an array of poloidal current values from the magnetic field source file.

Parameters
poloidalCurrenta vector of poloidal current values.

◆ setPsiArray()

void GridFieldData::setPsiArray ( const std::vector< double > &  psi)

Function to set array of psi values from the magnetic field source file.

Parameters
psia vector of psi values.

◆ setPsiSpline()

void GridFieldData::setPsiSpline ( std::vector< double > &  coefficeints,
std::vector< int > &  shape 
)

Function to set psi spline coefficients to the grid data.

Parameters
coefficientsa vector containing the coefficients.
shapea vector of size 3 defining the shape of coefficients array. coefficients.size() == shape[0]*shape[1]*shape[2]