Stellarator-Tools
m_grid Module Reference

Defines the base class of the type m_grid_class. This contains the state variables to define the vacuum vector potential. More...

Data Types

interface  m_grid_class
 Base class representing a m grid. This is grid contains information about the vacuum fields. More...
 

Functions/Subroutines

class(m_grid_class) function, pointer m_grid_construct (mgrid_file_name, parallel, io_unit, vmec)
 Construct a m_grid_class object. More...
 
class(m_grid_class) function, pointer m_grid_construct_plasma (num_r, num_p, num_z, rmax, rmin, zmax, zmin, parallel, io_unit, vmec)
 Construct a m_grid_class object. More...
 
subroutine m_grid_destruct (this)
 Deconstruct a m_grid_class object. More...
 
pure subroutine m_grid_interpolate (this, r, phi, z, ar, ap, az)
 Interpolate the vector potential at a point. More...
 
pure real(rprec) function m_grid_intf (w1, w2, x)
 Interpolate the vector potential at a point. More...
 

Detailed Description

Defines the base class of the type m_grid_class. This contains the state variables to define the vacuum vector potential.

Function/Subroutine Documentation

◆ m_grid_construct()

class (m_grid_class) function, pointer m_grid::m_grid_construct ( character (len=*), intent(in)  mgrid_file_name,
class (bmw_parallel_context_class), intent(in)  parallel,
integer, intent(in)  io_unit,
class (vmec_file_class), intent(in), pointer  vmec 
)

Construct a m_grid_class object.

Allocates memory and initializes a m_grid_class object with an mgrid file.

Parameters
[in]mgrid_file_nameFile name for vacuum fields.
[in]parallelbmw_parallel_context_class object instance.
[in]io_unitUnit number to write messages to.
[in]vmecThe vmec file object.
Returns
A pointer to a constructed m_grid_class object.

◆ m_grid_construct_plasma()

class (m_grid_class) function, pointer m_grid::m_grid_construct_plasma ( integer, intent(in)  num_r,
integer, intent(in)  num_p,
integer, intent(in)  num_z,
real (rprec), intent(in)  rmax,
real (rprec), intent(in)  rmin,
real (rprec), intent(in)  zmax,
real (rprec), intent(in)  zmin,
class (bmw_parallel_context_class), intent(in)  parallel,
integer, intent(in)  io_unit,
class (vmec_file_class), intent(in), pointer  vmec 
)

Construct a m_grid_class object.

Allocates memory and initializes a m_grid_class for plasma only responce on a manual grid.

Parameters
[in]num_rNumber of radial points.
[in]num_pNumber of toroidal points.
[in]num_zNumber of vertical points.
[in]rmaxMaximum radial position.
[in]rminMinimum radial position.
[in]zmaxMaximum vertical position.
[in]zminMinimum vertical position.
[in]parallelbmw_parallel_context_class object instance.
[in]io_unitUnit number to write messages to.
[in]vmecThe vmec file object.
Returns
A pointer to a constructed m_grid_class object.

◆ m_grid_destruct()

subroutine m_grid::m_grid_destruct ( type (m_grid_class), intent(inout)  this)

Deconstruct a m_grid_class object.

Deallocates memory and uninitializes a m_grid_class object.

Parameters
[in,out]thisA m_grid_class instance.

◆ m_grid_interpolate()

pure subroutine m_grid::m_grid_interpolate ( class (m_grid_class), intent(in)  this,
real (rprec), intent(in)  r,
real (rprec), intent(in)  phi,
real (rprec), intent(in)  z,
real (rprec), intent(out)  ar,
real (rprec), intent(out)  ap,
real (rprec), intent(out)  az 
)

Interpolate the vector potential at a point.

This interpolates the vector potential to from the mgrid grid to an arbitrary point. This performs a trilinear interpolation.

Parameters
[in]thisA m_grid_class instance.
[in]rRadial position to interpolate to.
[in]phiPhi position to interpolate to.
[in]zVertical position to interpolate to.
[out]arInterpolated radial component of the vector potential.
[out]apInterpolated phi component of the vector potential.
[out]azInterpolated vertial component of the vector potential.

◆ m_grid_intf()

pure real (rprec) function m_grid::m_grid_intf ( real (rprec), intent(in)  w1,
real (rprec), intent(in)  w2,
real (rprec), intent(in)  x 
)

Interpolate the vector potential at a point.

This interpolates the vector potential to from the mgrid grid to an arbitrary point. This performs a trilinear interpolation.

Parameters
[in]thisA m_grid_class instance.
[in]rRadial position to interpolate to.
[in]phiPhi position to interpolate to.
[in]zVertical position to interpolate to.
[out]arInterpolated radial component of the vector potential.
[out]apInterpolated phi component of the vector potential.
[out]azInterpolated vertial component of the vector potential.