Datatype for computing and storing points which map into the penalisation volume. NOTE: Indices are stored with respect to the INNER mesh since we require their dirindfun data for computation
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public, | allocatable, dimension(:) | :: | inds_fwd |
Indices of points on inner mesh which map into pen volume in fwd plane |
||
| real(kind=GP), | public, | allocatable, dimension(:) | :: | weights_fwd |
Penalisation values of points mapped into pen volume in fwd plane |
||
| integer, | public | :: | n_inds_fwd | = | 0 |
Number of fwd points to store |
|
| integer, | public, | allocatable, dimension(:) | :: | inds_bwd |
Indices of points on inner mesh which map into pen volume in bwd plane |
||
| real(kind=GP), | public, | allocatable, dimension(:) | :: | weights_bwd |
Penalisation values of points mapped into pen volume in bwd plane |
||
| integer, | public | :: | n_inds_bwd | = | 0 |
Number of bwd points to store |
|
| logical, | public | :: | is_staggered |
Whether stored points are from the canonical or staggered grid |
Find target points and construct storage
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(parallel_target_flux_t), | intent(inout) | :: | self |
Instance of class |
||
| type(comm_handler_t), | intent(in) | :: | comm_handler |
Communicator |
||
| type(mesh_cart_t), | intent(in) | :: | mesh |
Mesh |
||
| type(parallel_map_t), | intent(in) | :: | map |
Parallel map |
||
| type(penalisation_t), | intent(in) | :: | penalisation |
Penalisation |
||
| logical, | intent(in) | :: | staggered |
Whether to construct target points on staggered or canonical grid Acts on canonical grid if set to .false. Choice must be consistent with input mesh! |
||
| real(kind=GP), | intent(in) | :: | pen_threshold |
Threshold for interpolated penalisation value on mapped point Only points with values above the threshold are stored as target points |
||
| integer, | intent(in), | optional | :: | dbgout |
Debug output level |
Writes stored indices and weights to netcdf file
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(parallel_target_flux_t), | intent(in) | :: | self |
Instance of class |
||
| integer, | intent(in) | :: | fgid |
File or group id |
Reads stored indices and weights from netcdf file
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(parallel_target_flux_t), | intent(inout) | :: | self |
Instance of class |
||
| integer, | intent(in) | :: | fgid |
File or group id |
Compute parallel fluxes into penalisation region flux_fwd is defined as [g * dS] integrated over the set of points which map into the penalisation region in the forward plane. flux_bwd is defined analogously for penalisation in the backward plane. g is a parallel flux, e.g. ne * upar_cano, B the magnetic field, dS the boundary surface Note that input parameters must be consistent with the grid choice when building the marked points, e.g. only staggered or only canonical
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(parallel_target_flux_t), | intent(in) | :: | self |
Instance of class |
||
| type(comm_handler_t), | intent(in) | :: | comm_handler |
Communicator |
||
| type(mesh_cart_t), | intent(in) | :: | mesh |
Mesh |
||
| type(penalisation_t), | intent(in) | :: | penalisation |
Penalisation |
||
| type(equilibrium_storage_t), | intent(in) | :: | equi_storage |
Equilibrium storage |
||
| real(kind=GP), | intent(in), | dimension(mesh%get_n_points()) | :: | g |
Parallel flux in plane |
|
| real(kind=GP), | intent(out) | :: | flux_fwd |
Resulting flux into forward plane penalisation |
||
| real(kind=GP), | intent(out) | :: | flux_bwd |
Resulting flux into backward plane penalisation |
||
| character(len=*), | intent(in), | optional | :: | mode |
Mode of flux computation, may select between: 'DEFAULT' : Fluxes are NOT weighted by local penalisation value 'WEIGHTED' : Fluxes are weighted by local penalisation value |
Compute parallel fluxes into penalisation region for a single flux point
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(parallel_target_flux_t), | intent(in) | :: | self |
Instance of class |
||
| type(mesh_cart_t), | intent(in) | :: | mesh |
Mesh |
||
| type(penalisation_t), | intent(in) | :: | penalisation |
Penalisation |
||
| type(equilibrium_storage_t), | intent(in) | :: | equi_storage |
Equilibrium storage |
||
| integer, | intent(in) | :: | i_marker |
Index of point in fwd/bwd marker array |
||
| real(kind=GP), | intent(in), | dimension(mesh%get_n_points()) | :: | g |
Parallel flux in plane |
|
| character(len=*), | intent(in) | :: | dirind |
Field direction indication, either: 'fwd' : Compute forward flux into penalisation 'bwd' : Compute backward flux into penalisation |
||
| character(len=*), | intent(in), | optional | :: | mode |
Mode of flux computation, may select between: 'DEFAULT' : Fluxes are NOT weighted by local penalisation value 'WEIGHTED' : Fluxes are weighted by local penalisation value |
Resulting flux into into penalisation