Stellarator-Tools
vacuum_equilibrium Module Reference

Defines the base class of the type vacuum_class. This module contains all the code necessary to interface V3FIT with a vacuum equilibrium. More...

Data Types

interface  vacuum_class
 Base class representing a vacuum_equilibrium. More...
 

Functions/Subroutines

type(vacuum_class) function, pointer vacuum_construct (file_name, iou, force_solve)
 Construct a vacuum_class object. More...
 
subroutine vacuum_destruct (this)
 Deconstruct a vacuum_class object. More...
 
subroutine vacuum_set_param (this, id, i_index, j_index, value, eq_comm, state_flags)
 Sets the value of a reconstruction equilibrium parameter. More...
 
character(len=data_name_length) function vacuum_get_type (this)
 Gets a discription of the equilibrium type. More...
 
integer function vacuum_get_param_id (this, param_name)
 Get the id for a reconstruction parameter. More...
 
real(rprec) function vacuum_get_param_value (this, id, i_index, j_index)
 Get the value of a reconstruction vacuum parameter. More...
 
character(len=data_name_length) function vacuum_get_param_name (this, id)
 Get the name of a reconstruction vacuum parameter. More...
 
real(rprec) function, dimension(3) vacuum_get_b_vec (this, x_cart, cyl)
 Gets the magnetic field vector at a position. More...
 
real(rprec) function vacuum_get_int_b_dphi (this, s, theta)
 Gets the loop integrated magnetic field at a position. More...
 
real(rprec) function, dimension(:), pointer vacuum_get_ext_currents (this, num_currents, scale_currents)
 Get external current. More...
 
logical function vacuum_is_1d_array (this, id)
 Checks if a parameter id is a 1d array. More...
 
logical function vacuum_is_recon_param (this, id)
 Checks if a parameter id is a reconstruction parameter. More...
 
subroutine vacuum_write (this, iou)
 Write out the equilibrium to an output file. More...
 
subroutine vacuum_write_input (this, current_step)
 Write the current valid input. More...
 

Variables

integer, parameter vacuum_extcur_id = 14
 1D Array of external currents.
 

Detailed Description

Defines the base class of the type vacuum_class. This module contains all the code necessary to interface V3FIT with a vacuum equilibrium.

Super Class:
equilibrium

Function/Subroutine Documentation

◆ vacuum_construct()

type (vacuum_class) function, pointer vacuum_equilibrium::vacuum_construct ( character (len=*), intent(in)  file_name,
integer, intent(in)  iou,
logical, intent(in)  force_solve 
)

Construct a vacuum_class object.

Allocates memory and initializes a vacuum_class object.

Parameters
[in]file_nameFilename of the vacuum namelist input file.
[in]iouInput/output unit to log messages to.
[in]force_solveIf true, forces the equilbirum to resolve every time.
Returns
A pointer to a constructed vacuum_class object.

◆ vacuum_destruct()

subroutine vacuum_equilibrium::vacuum_destruct ( type (vacuum_class), intent(inout)  this)

Deconstruct a vacuum_class object.

Deallocates memory and uninitializes a vacuum_class object.

Parameters
[in,out]thisA vacuum_class instance.

◆ vacuum_get_b_vec()

real (rprec) function, dimension(3) vacuum_equilibrium::vacuum_get_b_vec ( class (vacuum_class), intent(in)  this,
real (rprec), dimension(3), intent(in)  x_cart,
logical, intent(in)  cyl 
)

Gets the magnetic field vector at a position.

This method overrides equilibrium::equilibrium_get_B_vec.

Parameters
[in]thisA vacuum_class instance.
[in]x_cartCartesian position to get the magnetic field vector at.
[in]cylFlag that specifies if the bfield should be returned in cartesian or cylindical coordinates.
Returns
The magnetic field vector at x_cart.

◆ vacuum_get_ext_currents()

real (rprec) function, dimension(:), pointer vacuum_equilibrium::vacuum_get_ext_currents ( class (vacuum_class), intent(in)  this,
integer, intent(in)  num_currents,
logical, intent(out)  scale_currents 
)

Get external current.

This method overrides equilibrium::equilibrium_get_ext_currents. The array memory containing the external currents is owned by the vacuum_class. Return a pointer to it.

Parameters
[in]thisA vacuum_class instance.
[in]num_currentsForces the number of currents to return if greater than zero.
[out]scale_currentsInforms the caller that currents need to be scaled.
Returns
The external currents.

◆ vacuum_get_int_b_dphi()

real (rprec) function vacuum_equilibrium::vacuum_get_int_b_dphi ( class (vacuum_class), intent(in)  this,
real (rprec), intent(in)  s,
real (rprec), intent(in)  theta 
)

Gets the loop integrated magnetic field at a position.

This method overrides equilibrium::equilibrium_get_Int_B_dphi. In this function, r and theta are spherical coordinates. The r is transformed into a cylindical radius at some z position. The magnetic field is integrated about a loop at that r-z position. This computes Int[B*dl]

Parameters
[in]thisA vacuum_class instance.
[in]sRadial position to integrate about.
[in]thetaTheta angle to integrate about.
Returns
The loop integrated magnetic field at x_cart.

◆ vacuum_get_param_id()

integer function vacuum_equilibrium::vacuum_get_param_id ( class (vacuum_class), intent(in)  this,
character (len=*), intent(in)  param_name 
)

Get the id for a reconstruction parameter.

This method overrides equilibrium::equilibrium_get_param_id.

Parameters
[in]thisA vacuum_class instance.
[in]param_nameName of a reconstruction parameter.
Returns
The id for a reconstruction parameter.

◆ vacuum_get_param_name()

character(len=data_name_length) function vacuum_equilibrium::vacuum_get_param_name ( class (vacuum_class), intent(in)  this,
integer, intent(in)  id 
)

Get the name of a reconstruction vacuum parameter.

This method overrides equilibrium::equilibrium_get_param_name.

Parameters
[in]thisA vacuum_class instance.
[in]idID of the parameter.
Returns
The name of the parameter.

◆ vacuum_get_param_value()

real (rprec) function vacuum_equilibrium::vacuum_get_param_value ( class (vacuum_class), intent(in)  this,
integer, intent(in)  id,
integer, intent(in)  i_index,
integer, intent(in)  j_index 
)

Get the value of a reconstruction vacuum parameter.

This method overrides equilibrium::equilibrium_get_param_value.

Parameters
[in]thisA vacuum_class instance.
[in]idID of the parameter.
[in]i_indexThe ith index of the parameter.
[in]j_indexThe jth index of the parameter.
Returns
The value of the parameter.

◆ vacuum_get_type()

character (len=data_name_length) function vacuum_equilibrium::vacuum_get_type ( class (vacuum_class), intent(in)  this)

Gets a discription of the equilibrium type.

Parameters
[in]thisA vacuum_class instance.
Returns
A string describing the signal type.

◆ vacuum_is_1d_array()

logical function vacuum_equilibrium::vacuum_is_1d_array ( class (vacuum_class), intent(in)  this,
integer, intent(in)  id 
)

Checks if a parameter id is a 1d array.

This method overrides equilibrium::equilibrium_is_1d_array.

Parameters
[in]thisA vacuum_class instance.
[in]idID of the parameter.
Returns
True if the parameter is a 1d array and false if otherwise.

◆ vacuum_is_recon_param()

logical function vacuum_equilibrium::vacuum_is_recon_param ( class (vacuum_class), intent(in)  this,
integer, intent(in)  id 
)

Checks if a parameter id is a reconstruction parameter.

This method overrides equilibrium::equilibrium_is_recon_param.

Parameters
[in]thisA vacuum_class instance.
[in]idID of the parameter.
Returns
True if the parameter is a reconstruction parameter and false if otherwise.

◆ vacuum_set_param()

subroutine vacuum_equilibrium::vacuum_set_param ( class (vacuum_class), intent(inout)  this,
integer, intent(in)  id,
integer, intent(in)  i_index,
integer, intent(in)  j_index,
real (rprec), intent(in)  value,
integer, intent(in)  eq_comm,
integer, intent(inout)  state_flags 
)

Sets the value of a reconstruction equilibrium parameter.

This method overrides equilibrium::equilibrium_set_param. This function always returns false because a vacuum equilibrium never needs to be reconverged.

Parameters
[in,out]thisA vaccum_class instance.
[in]idID of the parameter.
[in]i_indexThe ith index of the parameter.
[in]j_indexThe jth index of the parameter.
[in]valueThe value of the parameter.
[in]eq_commMPI communicator for the child equilibrium processes.
[in,out]state_flagsBitwise flags to indicate which parts of the model changed.

◆ vacuum_write()

subroutine vacuum_equilibrium::vacuum_write ( class (vacuum_class), intent(in)  this,
integer, intent(in)  iou 
)

Write out the equilibrium to an output file.

This method overrides equilibrium::equilibrium_write.

Parameters
[in]thisA vacuum_class instance.
[in]iouInput/output unit of the output file.

◆ vacuum_write_input()

subroutine vacuum_equilibrium::vacuum_write_input ( class (vacuum_class), intent(in)  this,
integer, intent(in)  current_step 
)

Write the current valid input.

This method overrides equilibrium::equilibrium_write_input. The boundary and other fixed parameters do not get updated as the reconstruction progresses. Need to update them manually if in free boundary mode.

Parameters
[in]thisA vacuum_class instance.
[in]current_stepStep number to append to input filename.