V3FIT
Data Types | Functions/Subroutines | Variables
magnetic Module Reference

Defines the base class of the type magnetic_class. More...

Data Types

interface  magnetic_class
 Base class representing a magnetic signal. More...
 

Functions/Subroutines

class(magnetic_class) function, pointer magnetic_construct_netcdf (mdsig_iou, use_coil_response, force_coil_reponse, use_3D_only, svd_cut_off)
 Construct a magnetic_class object containing a magnetic_response::magnetic_response_class object. More...
 
subroutine magnetic_destruct (this)
 Deconstruct a magnetic_class object. More...
 
real(rprec) function, dimension(4) magnetic_get_modeled_signal (this, a_model, sigma, last_value)
 Calculates the modeled signal. More...
 
real(rprec) function, dimension(4) magnetic_get_modeled_signal_point (this, a_model, sigma)
 Calculates the point modeled signal. More...
 
real(rprec) function, dimension(4) magnetic_get_modeled_signal_coil (this, a_model, sigma)
 Calculates the coil modeled signal. More...
 
real(rprec) function magnetic_get_modeled_signal_coil_pickup (this, a_model)
 Gets the model signal contribution from the external coils. More...
 
character(len=data_name_length) function magnetic_get_type (this)
 Gets a discription of the magnetic type. More...
 
subroutine magnetic_get_header (this, header)
 Gets a discription of the model and model sigma array indices. More...
 

Variables

integer, parameter magnetic_force_coil_flag = 1
 Bit position for the use coil response flag.
 
integer, parameter magnetic_3d_flag = 2
 Bit position for the force coil response flag.
 

Detailed Description

Defines the base class of the type magnetic_class.

Super Class:
diagnostic

Function/Subroutine Documentation

◆ magnetic_construct_netcdf()

class (magnetic_class) function, pointer magnetic::magnetic_construct_netcdf ( integer, intent(in)  mdsig_iou,
logical, intent(in)  use_coil_response,
logical, intent(in)  force_coil_reponse,
logical, intent(in)  use_3D_only,
real (rprec), intent(in)  svd_cut_off 
)

Construct a magnetic_class object containing a magnetic_response::magnetic_response_class object.

Allocates memory and initializes a magnetic_class object.

Parameters
[in]mdsig_iouAn instance of a the netcdf id of the open mdsig file.
[in]use_coil_responseToggle if the total signal contains the induced signal in addition to the plasma only signal.
[in]force_coil_reponseForce the coil response to be computed.
[in]use_3D_onlySubtract of the axisymmtric porition of the signal.
[in]svd_cut_offCutoff value for the number of singular values to retain when compressing the response function arrays.
Returns
A pointer to a constructed magnetic_class object.

Definition at line 91 of file magnetic.f.

◆ magnetic_destruct()

subroutine magnetic::magnetic_destruct ( type (magnetic_class), intent(inout)  this)

Deconstruct a magnetic_class object.

Deallocates memory and uninitializes a magnetic_class object.

Parameters
[in,out]thisA magnetic_class instance.

Definition at line 158 of file magnetic.f.

◆ magnetic_get_header()

subroutine magnetic::magnetic_get_header ( class (magnetic_class), intent(in)  this,
character (len=data_name_length), dimension(7), intent(inout)  header 
)

Gets a discription of the model and model sigma array indices.

Returns a description of the array indices for use when writting output files.

Parameters
[in]thisA magnetic_class instance.
[in,out]headerBuffer arrays to write header strings to.
Returns
A string describing the model and model sigma array indices.

Definition at line 698 of file magnetic.f.

◆ magnetic_get_modeled_signal()

real (rprec) function, dimension(4) magnetic::magnetic_get_modeled_signal ( class (magnetic_class), intent(inout)  this,
type (model_class), pointer  a_model,
real (rprec), dimension(4), intent(out)  sigma,
real (rprec), dimension(4), intent(in)  last_value 
)

Calculates the modeled signal.

The modeled signal can be computed in one of two ways. Modeled as a full coil or as a point measurement.

Parameters
[in,out]thisA magnetic_class instance.
[in]a_modelA model instance.
[out]sigmaThe modeled sigma.
[in]last_valueLast good value in case the signal did not change.
Returns
The model value.

Definition at line 189 of file magnetic.f.

◆ magnetic_get_modeled_signal_coil()

real (rprec) function, dimension(4) magnetic::magnetic_get_modeled_signal_coil ( type (magnetic_class), intent(in)  this,
type (model_class), intent(in)  a_model,
real (rprec), dimension(4), intent(out)  sigma 
)

Calculates the coil modeled signal.

The plasma signal is the volume integral of the current denisty dotted with the diagnostic response function vector. The response_function contains a rz grid of reponce function vectors. These grid points are then interpolated into the equilibrium grid positions for a single toroidal plane. Hishman et. al. Phys. Plasmas 11, 595 (2004); doi: 10.1063/1.1637347

phi = Int[dV J_plasma * A_diag]

J_plasma and dV are obtained from the equilibrium. A_diag is obtained from the magnetic_response External current contribrutions are included by the dot product of the external currents with mutual inductance values. These currents are obtained from equilibrium if they exist. The plasma only signal is stored in the 2nd index. The external current signal is stored in the 3rd index. Total signal is the sum of plasma signal and external signal.

Parameters
[in]thisA magnetic_class instance.
[in,out]a_modelA model instance.
[out]sigmaThe modeled sigma.
Returns
The model value.
Todo:
FIXME: For a single diagnostic these never change. Allocate these once and cache these in the magnetic_class object.

Definition at line 348 of file magnetic.f.

◆ magnetic_get_modeled_signal_coil_pickup()

real (rprec) function magnetic::magnetic_get_modeled_signal_coil_pickup ( type (magnetic_class), intent(in)  this,
type (model_class), intent(in)  a_model 
)

Gets the model signal contribution from the external coils.

Return the protion of the modeled signal for the induced pickup of the external coils. If no external coils exist or the induced current is not used this returns zero.

Parameters
[in]thisA magnetic_class instance.
[in,out]a_modelA model instance.
Returns
The modeled signal from the induced coils.

Definition at line 597 of file magnetic.f.

◆ magnetic_get_modeled_signal_point()

real (rprec) function, dimension(4) magnetic::magnetic_get_modeled_signal_point ( type (magnetic_class), intent(in)  this,
type (model_class), intent(in)  a_model,
real (rprec), dimension(4), intent(out)  sigma 
)

Calculates the point modeled signal.

The plasma signal is the surface integral of the virtual current denisty. This is computed using the virtual casing routines in LIBSTELL. External current contribrutions are included by the dot product of the external currents with a linear combination of the external fields. The plasma only signal is stored in the 2nd index. The external current signal is stored in the 3rd index. Total signal is the sum of plasma signal and external signal.

Parameters
[in]thisA magnetic_class instance.
[in,out]a_modelA model instance.
[out]sigmaThe modeled sigma.
Returns
The model value.

Definition at line 253 of file magnetic.f.

◆ magnetic_get_type()

character (len=data_name_length) function magnetic::magnetic_get_type ( class (magnetic_class), intent(in)  this)

Gets a discription of the magnetic type.

Returns a description of the magnetic type for use when writting output files.

Parameters
[in]thisA magnetic_class instance.
Returns
A string describing the magnetic type.

Definition at line 667 of file magnetic.f.