diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 9154336..206a20b 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-07-17T01:10:38","documenter_version":"1.5.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-07-22T13:55:58","documenter_version":"1.5.0"}} \ No newline at end of file diff --git a/dev/index.html b/dev/index.html index 069fb17..fdf62f3 100644 --- a/dev/index.html +++ b/dev/index.html @@ -11,18 +11,18 @@ fort_tol::Float64=1e-6, b2_parameters::Tuple{String, String, String, String,}=("", "", "", ""), load_bb::Bool=false, -)::IMASDD.dd

Main function of the module. Takes in a geometry file and an (optional) output file (either b2time or b2fstate) and a grid_ggd description in the form of a Dict or filename to equivalent YAML file. Additionally, EIRENE fort files can be provided as tuple of 3 filenames consisting fort.33, fort.34, and fort.35 files. The grids in these files are matched with SOLPS grid with a tolerance of fort_tol (defaults to 1e-6). Further settings can be loaded from b2.*.parameters files and equilibrium files.

source

The main solps2imas feature can be called to load everything. However, some special cases may demand only subsets of the data. In these cases, it is possible to call subcomponents of the SOLPS to IMAS data transfer feature by using these functions:

SOLPS2IMAS.load_summary_data!Function
load_summary_data!(
+)::IMASDD.dd

Main function of the module. Takes in a geometry file and an (optional) output file (either b2time or b2fstate) and a grid_ggd description in the form of a Dict or filename to equivalent YAML file. Additionally, EIRENE fort files can be provided as tuple of 3 filenames consisting fort.33, fort.34, and fort.35 files. The grids in these files are matched with SOLPS grid with a tolerance of fort_tol (defaults to 1e-6). Further settings can be loaded from b2.*.parameters files and equilibrium files.

source

The main solps2imas feature can be called to load everything. However, some special cases may demand only subsets of the data. In these cases, it is possible to call subcomponents of the SOLPS to IMAS data transfer feature by using these functions:

SOLPS2IMAS.load_summary_data!Function
load_summary_data!(
     ids::IMASDD.dd,
     b2_parameters::Tuple{String, String, String, String}=("", "", "", "");
-)

Loads high level shot summary data into the summary IDS after reading and interpreting SOLPS input files, such as b2.*.parameters.

source

Parsing tools

This module uses some parsing functions which can be used standalone as well

SOLPS2IMAS.read_b2_outputFunction
read_b2_output(filename::String)::Dict{String, Dict{String, Any}}

Read final state b2 output file (b2fstate or b2time.nc) or b2fgmtry file and return a dictionary with structure: Dict("dim" => Dict{String, Any}, "data" => Dict{String, Any}) where "dim" contains the dimensions of the data and "data" contains the data itself, with keys corresponding to the field names.

Supported SOLPS files as input via filename:

  • b2fstate
  • b2fstati
  • b2time.nc
  • b2fgmtry
source
SOLPS2IMAS.read_b2mn_outputFunction
read_b2mn_output(filename::String)::Dict{String, Any}

Read b2mn output file and store the quantities in a dictionary.

Supported SOLPS files as input via filename:

  • b2mn.dat
source
SOLPS2IMAS.read_b2time_outputFunction
read_b2time_output(filename::String)::Dict{String, Dict{String, Any}}

Read time dependent b2 output file and return a dictionary with structure: Dict("dim" => Dict{String, Any}, "data" => Dict{String, Any}) where "dim" contains the dimensions of the data and "data" contains the data itself, with keys corresponding to the field names.

Supported SOLPS files as input via filename:

  • b2time.nc
source
SOLPS2IMAS.read_b2_boundary_parametersFunction
read_b2_boundary_parameters(filename::String)::Dict{String, Any}

Reads and interprets the b2.boundary.parameters file from the SOLPS input deck. This file has boundary conditions like power crossing into the mesh from the core as well as particle fluxes. Returns a dictionary of interpreted results.

source

SOLPS Mesh Tools

SOLPS2IMAS.xytocFunction
xytoc(ix::Int, iy::Int; nx::Int)::Int

Converts SOLPS indices for crx, cry (ix, iy) that go from 1:nx, 1:ny into the linear index ic used in IMAS for corresponding cells.

source
SOLPS2IMAS.ctoxyFunction
ctoxy(ic::Int; nx::Int)::Tuple{Int, Int}

Inverse of xytoc.

source
SOLPS2IMAS.data_xytocFunction
data_xytoc(data::Matrix{Float64}; nx::Int)::Vector{Float64}

Flattens 2d data given on cell indices ix, iy into 1d data on linear index ic. ic is calculated using xytoc function. Data is assumed to have dimensions (ny, nx) where ny is not required in this conversion.

source
SOLPS2IMAS.search_pointFunction
search_point(
+)

Loads high level shot summary data into the summary IDS after reading and interpreting SOLPS input files, such as b2.*.parameters.

source

Parsing tools

This module uses some parsing functions which can be used standalone as well

SOLPS2IMAS.read_b2_outputFunction
read_b2_output(filename::String)::Dict{String, Dict{String, Any}}

Read final state b2 output file (b2fstate or b2time.nc) or b2fgmtry file and return a dictionary with structure: Dict("dim" => Dict{String, Any}, "data" => Dict{String, Any}) where "dim" contains the dimensions of the data and "data" contains the data itself, with keys corresponding to the field names.

Supported SOLPS files as input via filename:

  • b2fstate
  • b2fstati
  • b2time.nc
  • b2fgmtry
source
SOLPS2IMAS.read_b2mn_outputFunction
read_b2mn_output(filename::String)::Dict{String, Any}

Read b2mn output file and store the quantities in a dictionary.

Supported SOLPS files as input via filename:

  • b2mn.dat
source
SOLPS2IMAS.read_b2time_outputFunction
read_b2time_output(filename::String)::Dict{String, Dict{String, Any}}

Read time dependent b2 output file and return a dictionary with structure: Dict("dim" => Dict{String, Any}, "data" => Dict{String, Any}) where "dim" contains the dimensions of the data and "data" contains the data itself, with keys corresponding to the field names.

Supported SOLPS files as input via filename:

  • b2time.nc
source
SOLPS2IMAS.read_b2_boundary_parametersFunction
read_b2_boundary_parameters(filename::String)::Dict{String, Any}

Reads and interprets the b2.boundary.parameters file from the SOLPS input deck. This file has boundary conditions like power crossing into the mesh from the core as well as particle fluxes. Returns a dictionary of interpreted results.

source

SOLPS Mesh Tools

SOLPS2IMAS.xytocFunction
xytoc(ix::Int, iy::Int; nx::Int)::Int

Converts SOLPS indices for crx, cry (ix, iy) that go from 1:nx, 1:ny into the linear index ic used in IMAS for corresponding cells.

source
SOLPS2IMAS.ctoxyFunction
ctoxy(ic::Int; nx::Int)::Tuple{Int, Int}

Inverse of xytoc.

source
SOLPS2IMAS.data_xytocFunction
data_xytoc(data::Matrix{Float64}; nx::Int)::Vector{Float64}

Flattens 2d data given on cell indices ix, iy into 1d data on linear index ic. ic is calculated using xytoc function. Data is assumed to have dimensions (ny, nx) where ny is not required in this conversion.

source
SOLPS2IMAS.search_pointFunction
search_point(
     nodes::IMASDD.IDSvector{IMASDD.edge_profiles__grid_ggd___space___objects_per_dimension___object{T}},
     r::Real,
     z::Real;
     tol::Float64=0.0,
-)::Int where {T}

Search if a point (r, z) is present in the nodes array. Here nodes is generally available in ids.edge_profiles.grid_ggd[:].space[:].objects_per_dimension[1].object

If the point is not found, the function returns 0.

source
SOLPS2IMAS.search_edgesFunction
search_edges(
+)::Int where {T}

Search if a point (r, z) is present in the nodes array. Here nodes is generally available in ids.edge_profiles.grid_ggd[:].space[:].objects_per_dimension[1].object

If the point is not found, the function returns 0.

source
SOLPS2IMAS.search_edgesFunction
search_edges(
     edges::IMASDD.IDSvector{IMASDD.edge_profiles__grid_ggd___space___objects_per_dimension___object{T}},
     edge_nodes::Array{Int, 1}
-)::Int where {T}

Search if an edge with nodes as edge_nodes already exists in the edges array. edges is generally available in ids.edge_profiles.grid_ggd[:].space[:].objects_per_dimension[2].object

If the edge is not found, the function returns 0.

source
SOLPS2IMAS.distance_between_nodesFunction
distance_between_nodes(nodes::edges_nodes_type, node_inds::Array{Int, 1})

Return distance between two nodes with indices node_inds in nodes array. nodes is generally available in ids.edge_profiles.grid_ggd[:].space[:].objects_per_dimension[1].object.

source
SOLPS2IMAS.neighbour_indsFunction
neighbour_inds(
+)::Int where {T}

Search if an edge with nodes as edge_nodes already exists in the edges array. edges is generally available in ids.edge_profiles.grid_ggd[:].space[:].objects_per_dimension[2].object

If the edge is not found, the function returns 0.

source
SOLPS2IMAS.distance_between_nodesFunction
distance_between_nodes(nodes::edges_nodes_type, node_inds::Array{Int, 1})

Return distance between two nodes with indices node_inds in nodes array. nodes is generally available in ids.edge_profiles.grid_ggd[:].space[:].objects_per_dimension[1].object.

source
SOLPS2IMAS.neighbour_indsFunction
neighbour_inds(
     ic::Int;
     nx::Int,
     ny::Int,
@@ -30,16 +30,16 @@
     rightcut::Int,
     topcut::Int,
     bottomcut::Int,
-)::Vector{Int}

(deprecated function)

Returns indices of neighbours of cell with linear index ic. This function uses the SOLPS grid generation algorithm to determine the neighbours. However, SOLPS geometry file actually provides the neighbor indices directly. Thus, this function is not used in the code anywhere but is kept here for reference.

source
SOLPS2IMAS.get_neighbour_indsFunction
get_neighbour_inds(
+)::Vector{Int}

(deprecated function)

Returns indices of neighbours of cell with linear index ic. This function uses the SOLPS grid generation algorithm to determine the neighbours. However, SOLPS geometry file actually provides the neighbor indices directly. Thus, this function is not used in the code anywhere but is kept here for reference.

source
SOLPS2IMAS.get_neighbour_indsFunction
get_neighbour_inds(
     ic::Int,
     gmtry::Dict{String, Dict{String, Any}},
     it::Int,
-)::Vector{Int}

Returns indices of neighbours of cell with linear index ic. This function uses the parsed SOLPS geometry file to determine the neighbours by using matrices named as leftix, rightix, topix, bottomix, leftiy, rightiy, topiy, and bottomiy.

source
SOLPS2IMAS.attach_neightbours!Function
attach_neightbours!(
+)::Vector{Int}

Returns indices of neighbours of cell with linear index ic. This function uses the parsed SOLPS geometry file to determine the neighbours by using matrices named as leftix, rightix, topix, bottomix, leftiy, rightiy, topiy, and bottomiy.

source
SOLPS2IMAS.attach_neightbours!Function
attach_neightbours!(
     cells::IMASDD.IDSvector{IMASDD.edge_profiles__grid_ggd___space___objects_per_dimension___object{T}},
     edges::IMASDD.IDSvector{IMASDD.edge_profiles__grid_ggd___space___objects_per_dimension___object{T}},
     gmtry::Dict{String, Dict{String, Any}},
     it::Int,
-) where {T}

This function attaches neighbours to each boundary of each cell and each boundary of each edge using the parsed SOLPS geometry file.

source

Subset Identification Tools

These functions provide a way to identify if a linear cell index in SOLPS notation belongs to a grid subset.

SOLPS2IMAS.in_coreFunction

in_core(; ix, iy, topcut, bottomcut, leftcut, rightcut)::Bool

Returns true if cell indexed ix, iy lie inside the core.

source
SOLPS2IMAS.in_solFunction
in_sol(; iy, topcut, kwargs...)::Bool

Returns true if cell indexed ix, iy lie inside the SOL.

source
SOLPS2IMAS.in_idrFunction
in_idr(; ix, iy, topcut, bottomcut, leftcut, kwargs...)::Bool

Returns true if cell indexed ix, iy lie inside the inner divertor region.

source
SOLPS2IMAS.in_odrFunction
in_odr(; ix, iy, topcut, bottomcut, rightcut, kwargs...)::Bool

Returns true if cell indexed ix, iy lie inside the outer divertor region.

source
SOLPS2IMAS.is_x_alignedFunction
is_x_aligned(;boundary_ind)::Bool

x_aligned edges will have odd boundary_ind based on chosen order of numbering them.

source
SOLPS2IMAS.is_y_alignedFunction
is_y_aligned(; boundary_ind)::Bool

y_aligned edges will have even boundary_ind based on chosen order of numbering them.

source
SOLPS2IMAS.is_core_cutFunction
is_core_cut(;
+) where {T}

This function attaches neighbours to each boundary of each cell and each boundary of each edge using the parsed SOLPS geometry file.

source

Subset Identification Tools

These functions provide a way to identify if a linear cell index in SOLPS notation belongs to a grid subset.

SOLPS2IMAS.in_coreFunction

in_core(; ix, iy, topcut, bottomcut, leftcut, rightcut)::Bool

Returns true if cell indexed ix, iy lie inside the core.

source
SOLPS2IMAS.in_solFunction
in_sol(; iy, topcut, kwargs...)::Bool

Returns true if cell indexed ix, iy lie inside the SOL.

source
SOLPS2IMAS.in_idrFunction
in_idr(; ix, iy, topcut, bottomcut, leftcut, kwargs...)::Bool

Returns true if cell indexed ix, iy lie inside the inner divertor region.

source
SOLPS2IMAS.in_odrFunction
in_odr(; ix, iy, topcut, bottomcut, rightcut, kwargs...)::Bool

Returns true if cell indexed ix, iy lie inside the outer divertor region.

source
SOLPS2IMAS.is_x_alignedFunction
is_x_aligned(;boundary_ind)::Bool

x_aligned edges will have odd boundary_ind based on chosen order of numbering them.

source
SOLPS2IMAS.is_y_alignedFunction
is_y_aligned(; boundary_ind)::Bool

y_aligned edges will have even boundary_ind based on chosen order of numbering them.

source
SOLPS2IMAS.is_core_cutFunction
is_core_cut(;
     ix,
     iy,
     cells,
@@ -49,7 +49,7 @@
     bottomcut,
     leftcut,
     rightcut,
-)::Bool

Returns true if boundary_ind of a cell at ix, iy is on core_cut (Y-aliged edge).

source
SOLPS2IMAS.is_pfr_cutFunction
is_pfr_cut(;
+)::Bool

Returns true if boundary_ind of a cell at ix, iy is on core_cut (Y-aliged edge).

source
SOLPS2IMAS.is_pfr_cutFunction
is_pfr_cut(;
     ix,
     iy,
     cells,
@@ -59,13 +59,13 @@
     bottomcut,
     leftcut,
     rightcut,
-)::Bool

Returns true if boundary_ind of a cell at ix, iy is on core_cut (y-aliged edge).

source
SOLPS2IMAS.is_outer_throatFunction
is_outer_throat(; ix, iy, boundary_ind, topcut, rightcut, kwargs...)::Bool

Returns true if boundary_ind of a cell at ix, iy is on outer throat.

source
SOLPS2IMAS.is_inner_throatFunction
is_inner_throat(; ix, iy, boundary_ind, topcut, leftcut, kwargs...)::Bool

Returns true if boundary_ind of a cell at ix, iy is on outer throat.

source
SOLPS2IMAS.is_outer_midplaneFunction
is_outer_midplane(; ix, jxa, boundary_ind)

Returns true if boundary_ind of a cell at ix, iy is on outer midplane.

source
SOLPS2IMAS.is_inner_midplaneFunction
is_inner_midplane(; ix, jxa, boundary_ind)

Returns true if boundary_ind of a cell at ix, iy is on outer midplane.

source
SOLPS2IMAS.is_outer_targetFunction
is_outer_target(; ix, nx, boundary_ind)

Returns true if boundary_ind of a cell at ix, iy is on outer target.

source
SOLPS2IMAS.is_inner_targetFunction
is_inner_target(; ix, boundary_ind, kwargs...)::Bool

Returns true if boundary_ind of a cell at ix, iy is on inner target.

source
SOLPS2IMAS.is_core_boundaryFunction
is_core_boundary(;
+)::Bool

Returns true if boundary_ind of a cell at ix, iy is on core_cut (y-aliged edge).

source
SOLPS2IMAS.is_outer_throatFunction
is_outer_throat(; ix, iy, boundary_ind, topcut, rightcut, kwargs...)::Bool

Returns true if boundary_ind of a cell at ix, iy is on outer throat.

source
SOLPS2IMAS.is_inner_throatFunction
is_inner_throat(; ix, iy, boundary_ind, topcut, leftcut, kwargs...)::Bool

Returns true if boundary_ind of a cell at ix, iy is on outer throat.

source
SOLPS2IMAS.is_outer_midplaneFunction
is_outer_midplane(; ix, jxa, boundary_ind)

Returns true if boundary_ind of a cell at ix, iy is on outer midplane.

source
SOLPS2IMAS.is_inner_midplaneFunction
is_inner_midplane(; ix, jxa, boundary_ind)

Returns true if boundary_ind of a cell at ix, iy is on outer midplane.

source
SOLPS2IMAS.is_outer_targetFunction
is_outer_target(; ix, nx, boundary_ind)

Returns true if boundary_ind of a cell at ix, iy is on outer target.

source
SOLPS2IMAS.is_inner_targetFunction
is_inner_target(; ix, boundary_ind, kwargs...)::Bool

Returns true if boundary_ind of a cell at ix, iy is on inner target.

source
SOLPS2IMAS.is_core_boundaryFunction
is_core_boundary(;
 ix,
 iy,
 boundary_ind,
 bottomcut,
 leftcut,
 rightcut,
-kwargs...,

)

Returns true if boundary_ind of a cell at ix, iy is on core boundary (central blank spot boundary).

source
SOLPS2IMAS.is_separatrixFunction
is_separatrix(; iy, boundary_ind, topcut, kwargs...)::Bool

Returns true if boundary_ind of a cell at ix, iy is on separatrix.

source
SOLPS2IMAS.get_xpoint_nodesFunction
get_xpoint_nodes(
+kwargs...,

)

Returns true if boundary_ind of a cell at ix, iy is on core boundary (central blank spot boundary).

source
SOLPS2IMAS.is_separatrixFunction
is_separatrix(; iy, boundary_ind, topcut, kwargs...)::Bool

Returns true if boundary_ind of a cell at ix, iy is on separatrix.

source
SOLPS2IMAS.get_xpoint_nodesFunction
get_xpoint_nodes(
     gmtry::Dict{String, Dict{String, Any}},
-)::Vector{Vector{Vector{Float64}}}

Limited to finding first x-point for now. Returns x-point (r, z) for each time index of grid_ggd for the first x-point only. Thus second index correspond to the rank of x-point which is always 1 from output of this function for now.

source
+)::Vector{Vector{Vector{Float64}}}

Limited to finding first x-point for now. Returns x-point (r, z) for each time index of grid_ggd for the first x-point only. Thus second index correspond to the rank of x-point which is always 1 from output of this function for now.

source