Stellarator-Tools
Loading...
Searching...
No Matches
v3fit_context::v3fit_context_class Type Reference

Base class representing a v3fit context. This contains all memory needed to operate v3fit. More...

Public Member Functions

FINAL v3fit_context_destruct (this)
 Deconstruct a v3fit_context_class object.
 
procedure resize (this)
 Resize the arrays.
 
procedure create_files (this)
 Create output files.
 
procedure close_files (this)
 Close output files.
 
procedure write (this)
 Write the v3fit_context_class out to disk.
 
procedure write_param_header (this, params, prefix, type_name)
 Write the param_class::correlation header out to disk.
 
procedure init_data (this, eq_steps)
 Initialize the dimensions and variables of the result file.
 
procedure write_step_data (this, first_step, eq_steps)
 Write step data to the defined variables.
 
procedure restart (this, current_step)
 Restart the reconstruction.
 
procedure get_eq_comm (this)
 Get the mpi comm for the equilibrium.
 
procedure get_eq_rank (this)
 Get the mpi rank for the equilibrium.
 
procedure get_recon_comm (this)
 Get the mpi comm for the reconstruction.
 
procedure get_recon_rank (this)
 Get the mpi rank for the reconstruction.
 

Public Attributes

real(rprec) recon_stop
 Stopping criteria for change in g^2.
 
integer runlog_iou
 File input output unit for the runlog file. This file is a human readable output history of a v3fit run.
 
integer recout_iou
 File input output unit for the recout file. This file is a human readable output of the final result.
 
class(commandline_parser_class), pointer cl_parser => null()
 The parsed command line options.
 
class(model_class), pointer model => null()
 The equilibrium model.
 
type(gaussp_class_pointer), dimension(:), pointer gp => null()
 Guassian process models.
 
type(signal_pointer), dimension(:), pointer signals => null()
 Array of signals.
 
type(param_pointer), dimension(:), pointer derived_params => null()
 Array of derived parameters.
 
type(param_pointer), dimension(:), pointer params => null()
 Arrays of reconstruction parameters.
 
type(param_pointer), dimension(:), pointer locks => null()
 Array of locking parameters.
 
class(reconstruction_class), pointer recon => null()
 The reconstruction algorithm object.
 
integer magnetic_index = -1
 Index of the first instance of a magnetic signal. The default -1 represents no magnetic signal created.
 
integer sxrem_index = -1
 Index of the first instance of a sxrem signal. The default -1 represents no sxrem signal created.
 
integer intpol_index = -1
 Index of the first instance of a intpol signal. The default -1 represents no intpol signal created.
 
integer thomson_index = -1
 Index of the first instance of a thomson signal. The default -1 represents no thomson signal created.
 
integer extcurz_index = -1
 Index of the first instance of a extcurz signal. The default -1 represents no extcurz signal created.
 
integer mse_index = -1
 Index of the first instance of a mse signal. The default -1 represents no mse signal created.
 
integer ece_index = -1
 Index of the first instance of a ece signal. The default -1 represents no ece signal created.
 
integer limiter_index = -1
 Index of the first instance of a limiter signal. The default -1 represents no limiter signal created.
 
integer prior_gaussian_index = -1
 Index of the first instance of a prior_gaussian signal. The default -1 represents no prior_gaussian signal created.
 
integer sxrem_ratio_index = -1
 Index of the first instance of a prior_gaussian signal. The default -1 represents no prior_gaussian signal created.
 
integer combination_index = -1
 Index of the first instance of a combination_class signal. The default -1 represents no combination_class signal created.
 
integer result_ncid
 NetCDF result file to write out the results in machine readable form.
 
integer global_comm = MPI_COMM_NULL
 MPI communicator reference for full domain.
 
integer equilibrium_comm = MPI_COMM_NULL
 MPI communicator reference for the equilibrium domain.
 
integer reconstruction_comm = MPI_COMM_NULL
 MPI communicator reference for the reconstruction domain.
 

Detailed Description

Base class representing a v3fit context. This contains all memory needed to operate v3fit.

Member Function/Subroutine Documentation

◆ close_files()

procedure v3fit_context::v3fit_context_class::close_files ( class (v3fit_context_class), intent(inout)  this)

Close output files.

Closes output files that reconstructed results are written to.

Parameters
[in,out]thisA v3fit_context_class instance.

◆ create_files()

procedure v3fit_context::v3fit_context_class::create_files ( class (v3fit_context_class), intent(inout)  this)

Create output files.

Creates output files that reconstructed results are written to.

Parameters
[in,out]thisA v3fit_context_class instance.

◆ get_eq_comm()

procedure v3fit_context::v3fit_context_class::get_eq_comm ( class (v3fit_context_class), intent(inout)  this)

Get the mpi comm for the equilibrium.

Parameters
[in,out]thisA v3fit_context_class instance.
Returns
The equilibrium comm.

◆ get_eq_rank()

procedure v3fit_context::v3fit_context_class::get_eq_rank ( class (v3fit_context_class), intent(inout)  this)

Get the mpi rank for the equilibrium.

Parameters
[in,out]thisA v3fit_context_class instance.
Returns
The rank of the equilibrium comm.

◆ get_recon_comm()

procedure v3fit_context::v3fit_context_class::get_recon_comm ( class (v3fit_context_class), intent(inout)  this)

Get the mpi comm for the reconstruction.

Parameters
[in,out]thisA v3fit_context_class instance.
Returns
The equilibrium comm.

◆ get_recon_rank()

procedure v3fit_context::v3fit_context_class::get_recon_rank ( class (v3fit_context_class), intent(inout)  this)

Get the mpi rank for the reconstruction.

Parameters
[in,out]thisA v3fit_context_class instance.
Returns
The rank of the equilibrium comm.

◆ init_data()

procedure v3fit_context::v3fit_context_class::init_data ( class (v3fit_context_class), intent(inout)  this,
integer, intent(in)  eq_steps 
)

Initialize the dimensions and variables of the result file.

Defines dimensions, variables and writes out the initial step of v3fit to result netcdf file. Multi dimensional arrays need to be transposed so arrays appear in the correct order in non fortran languages.

Parameters
[in,out]thisA v3fit_context_class instance.
[in]eq_stepsNumber of steps taken by the equilibrium.

◆ resize()

procedure v3fit_context::v3fit_context_class::resize ( class (v3fit_context_class), intent(inout)  this)

Resize the arrays.

Resizes the signal arrays to contain only the minimun necessary to hold all signals. If no signals were constructed, the signal array is not allocated.

Parameters
[in,out]thisA v3fit_context_class instance.

◆ restart()

procedure v3fit_context::v3fit_context_class::restart ( class (v3fit_context_class), intent(inout)  this,
integer, intent(inout)  current_step 
)

Restart the reconstruction.

Reloads a reconstruction from the result file.

Parameters
[in,out]thisA v3fit_context_class instance.
[in,out]current_stepReconstruction step left off from.
Returns
The current step.

◆ v3fit_context_destruct()

FINAL v3fit_context::v3fit_context_class::v3fit_context_destruct ( type (v3fit_context_class), intent(inout)  this)
final

Deconstruct a v3fit_context_class object.

Deallocates memory and uninitializes a v3fit_context_class object. This all the v3fit constructed objects are destroyed here.

Parameters
[in,out]thisA v3fit_context_class instance.

◆ write()

procedure v3fit_context::v3fit_context_class::write ( class (v3fit_context_class), intent(inout)  this)

Write the v3fit_context_class out to disk.

Writes out the results of v3fit to the recout file.

Parameters
[in,out]thisA v3fit_context_class instance.
Note
The 'this' parameter is intent(inout) because signal::signal_write calls signal::signal_get_g2 which needs to be intent(inout).

◆ write_param_header()

procedure v3fit_context::v3fit_context_class::write_param_header ( class (v3fit_context_class), intent(inout)  this,
type (param_pointer), dimension(:)  params,
character (len=*)  prefix,
character (len=*)  type_name 
)

Write the param_class::correlation header out to disk.

Writes out the results of header for a correlation matric. This header is formatted by a an inital col left blank followed by eack parameter name spaced 14 spaced apart from each other.

Parameters
[in,out]thisA v3fit_context_class instance.
[in]paramsArray of parameter objects.
[in]prefixPrefix string to format the header.
[in]type_nameType name of the parameters.
Note
The 'this' parameter is intent(inout) because signal::signal_write calls signal::signal_get_g2 which needs to be intent(inout). @node The 'prefix' parameter must be an exact length string with all white space predefined.

◆ write_step_data()

procedure v3fit_context::v3fit_context_class::write_step_data ( class (v3fit_context_class), intent(inout)  this,
logical, intent(in)  first_step,
integer, intent(in)  eq_steps 
)

Write step data to the defined variables.

Writes out the data for a reconstruction step to the result file. If this is being called for the first time. Do not read the number of steps.

Parameters
[in,out]thisA v3fit_context_class instance.
[in]first_stepFlags to determine if this is the first instance this has been called.
[in]eq_stepsNumber of steps the equilibrium took.
Note
The only caller of this subrotine that should set first_step to true should be v3fit_context_init_data. All others should callers should set first_step to false.

Member Data Documentation

◆ derived_params

type (param_pointer), dimension(:), pointer v3fit_context::v3fit_context_class::derived_params => null()

Array of derived parameters.

See also
param

◆ params

type (param_pointer), dimension(:), pointer v3fit_context::v3fit_context_class::params => null()

Arrays of reconstruction parameters.

See also
param

◆ signals

type (signal_pointer), dimension(:), pointer v3fit_context::v3fit_context_class::signals => null()

Array of signals.

See also
signal

The documentation for this type was generated from the following file: