Stellarator-Tools
surface_context Module Reference

Defines the base class of the type surface_context_class. This module contains all the code necessary define a surface for cariddi to read a virtual surface from. More...

Data Types

interface  surface_context_class
 Base class representing a surface context. This contains all memory needed to operate surface. More...
 

Functions/Subroutines

class(surface_context_class) function, pointer surface_context_construct (wout_file_name, surface_file_name, parallel, io_unit)
 Construct a surface_context_class object. More...
 
subroutine surface_context_destruct (this)
 Deconstruct a bmw_context_class object. More...
 
subroutine surface_context_set_vector_potential (this, io_unit, parallel)
 Set the vector potential on the surface. More...
 
subroutine surface_context_write (this, output_file, io_unit, parallel)
 

Detailed Description

Defines the base class of the type surface_context_class. This module contains all the code necessary define a surface for cariddi to read a virtual surface from.

Function/Subroutine Documentation

◆ surface_context_construct()

class (surface_context_class) function, pointer surface_context::surface_context_construct ( character (len=*), intent(in)  wout_file_name,
character (len=*), intent(in)  surface_file_name,
class (bmw_parallel_context_class), intent(in)  parallel,
integer, intent(in)  io_unit 
)

Construct a surface_context_class object.

Allocates memory and initializes a surface_context_class object.

Parameters
[in]wout_file_namePath and name of the wout file.
[in]surface_file_namePath defining the surface to compute fields to.
[in]parallelbmw_parallel_context_class object instance.
[in]io_unitUnit number to write messages to.
Returns
A pointer to a constructed bmw_context_class object.

◆ surface_context_destruct()

subroutine surface_context::surface_context_destruct ( type (surface_context_class), intent(inout)  this)

Deconstruct a bmw_context_class object.

Deallocates memory and uninitializes a bmw_context_class object.

Parameters
[in,out]thisA bmw_context_class instance.

◆ surface_context_set_vector_potential()

subroutine surface_context::surface_context_set_vector_potential ( class (surface_context_class), intent(inout)  this,
integer, intent(in)  io_unit,
class (bmw_parallel_context_class), intent(in)  parallel 
)

Set the vector potential on the surface.

This uses the biot-savart to set a vector potential on an arbitrary surface. At each point in the surface, the plasma current in volume integrated.

b = mu0/4pi Int Int Int (Jsupu*esubu + Jsupv*esubv) / |x - xp|*signJ*J*da*du*dv (1)

Where the primed (p) variables are the values on the last closed flux surface grid.

Parameters
[in,out]thisA surface_context_class instance.
[in]io_unitUnit number to write messages to.
[in]parallelbmw_parallel_context_class object instance.
Returns
A pointer to a constructed bmw_context_class object.