ORB5  v4.9.4
part_fields Module Reference

Particle-to-fields and fields-to-particle operations. More...

Data Types

interface  deposition
 

Functions/Subroutines

subroutine, public init_module (nidbas_, ns_, nchi_, nphi_, iz_offset_, ds_, dchi_, dphi_, xmin_, nl_gradgyr_, nsel_depos_, nsel_get_field_, nbin_x_, nbin_y_, nbin_z_, color_nbin_x_, color_nbin_y_)
 Initialize module variables. More...
 
subroutine init_deposition_by_part
 Initialization routine for deposition by particle. More...
 
subroutine init_deposition_by_cell
 Initialization routine for deposition by cell. More...
 
subroutine init_deposition_by_color
 Initialization routine for deposition using the color scheme algorithm. More...
 
subroutine init_deposition_by_color_buf
 Initialization routine for deposition using the buffered color scheme algorithm. More...
 
subroutine deposition_r8 (np, x, y, z, w, rhs, nl_depos, displs, first)
 Deposit some marker attribute to field with the proper splines order. More...
 
subroutine deposition_r4 (np, x, y, z, w, rhs, nl_depos, displs, first)
 Deposit some marker attribute to field with the proper splines order (r4) More...
 
subroutine nullify_rhs_omp (ithread)
 Set rhs_omp to 0. More...
 
subroutine nullify_rhs (rhs)
 Set rhs to 0. More...
 
subroutine reduction_threads (rhs)
 Sum up OpenMP threads rhs replications. More...
 
subroutine, public get_field (pot_coef, np, x, y, z, displs, pot, dpot_dx, dpot_dy, dpot_dz)
 Compute field and/or its gradient at marker positions with the proper spline order. More...
 
pure real function, dimension(0:1) splines_bas1 (x)
 Evaluate linear B-splines at point x in interval [0, 1]. More...
 
pure real function, dimension(0:2) splines_bas2 (x)
 Evaluate quadratic B-splines at point x in interval [0, 1]. More...
 
pure real function, dimension(0:3) splines_bas3 (x)
 Evaluate cubic B-splines at point x in interval [0, 1]. More...
 
pure real function, dimension(0:1) grad_splines_bas1 (x)
 Evaluate linear B-spline gradients at point x in interval [0, 1]. More...
 
pure real function, dimension(0:2) grad_splines_bas2 (x)
 Evaluate quadratic B-spline gradients at point x in interval [0, 1]. More...
 
pure real function, dimension(0:3) grad_splines_bas3 (x)
 Evaluate cubic B-spline gradients at point x in interval [0, 1]. More...
 

Variables

integer, save nidbas
 Spline order. More...
 
integer, save nx
 Number of radial intervals. More...
 
integer, save ny
 Number of poloidal intervals. More...
 
integer, save nz
 Number of local toroidal intervals. More...
 
integer, save iz_offset
 Starting toroidal interval. More...
 
real, save dx_inv
 Inverse radial mesh size. More...
 
real, save dy_inv
 Inverse poloidal mesh size. More...
 
real, save dz_inv
 Inverse toroidal mesh size. More...
 
real, save xmin
 Inner boundary position. More...
 
logical, save nl_gradgyr
 Take gradient of gyroaverage potential instead of gyroaverage gradient of potential. More...
 
integer, save nsel_depos
 Deposition method. More...
 
integer, save nsel_get_field
 Get field method. More...
 
integer, save nbin_x
 Number of radial bins. More...
 
integer, save nbin_y
 Number of poloidal bins. More...
 
integer, save nbin_z
 Number of local toroidal bins. More...
 
integer, save color_nbin_x
 Number of radial bins for color scheme. More...
 
integer, save color_nbin_y
 Number of poloidal bins for color scheme. More...
 
real, dimension(:,:,:,:), allocatable, save rhs_omp
 Working array for deposition (field replicated among OpenMP threads) More...
 
integer, dimension(:,:), allocatable, save bin_array
 Array containing the index of the particles in a bucket. More...
 
real, dimension(:,:,:), allocatable, save color_buffer
 Buffer used for the buffered version of color scheme. More...
 
integer, save number_of_bins_per_bucket
 
integer, save number_of_buckets
 Number of bins per bucket and total # of buckets. More...
 
integer, save nbin_x_avg
 
integer, save nbin_y_avg
 Number of sorting bins in each color bucket. More...
 
logical, save use_vectorized = .false.
 Flag to use the vectorized version. More...
 
integer, save grid_cells_in_x_color_bucket
 Number of grid cell per bucket in s. More...
 
integer, save grid_cells_in_y_color_bucket
 Number of grid cell per bucket in chi. More...
 
integer, save k_start
 
integer, save k_end
 Indexes of the local subdomain. More...
 

Detailed Description

Particle-to-fields and fields-to-particle operations.

In this module,

  • x denotes the radial direction,
  • y denotes the poloidal direction (periodic), and
  • z denotes the toroidal direction (periodic and partitionned).
Date
02/2018
Author
N. Ohana

Function/Subroutine Documentation

◆ deposition_r4()

subroutine part_fields::deposition_r4 ( integer, intent(in)  np,
real, dimension(np), intent(in)  x,
real, dimension(np), intent(in)  y,
real, dimension(np), intent(in)  z,
real(kind=r4), dimension(np), intent(in)  w,
real, dimension(0:nx+nidbas-1, 0:ny+nidbas-1, 0:nz+nidbas-1), intent(out)  rhs,
logical, dimension(np), intent(in), optional  nl_depos,
integer, dimension(:), intent(in), optional  displs,
logical, intent(in), optional  first 
)
private

Deposit some marker attribute to field with the proper splines order (r4)

Parameters
[in]npNumber of markers
[in]xMarker radial positions
[in]yMarker poloidal positions
[in]zMarker toroidal positions
[in]wMarker attribute to be deposited
[out]rhsResulting field
[in]nl_deposFlags to deposit markers or not
[in]firstFlags to deposit markers or not
[in]displsDisplacements to access markers in specific bin

◆ deposition_r8()

subroutine part_fields::deposition_r8 ( integer, intent(in)  np,
real, dimension(np), intent(in)  x,
real, dimension(np), intent(in)  y,
real, dimension(np), intent(in)  z,
real, dimension(np), intent(in)  w,
real, dimension(0:nx+nidbas-1, 0:ny+nidbas-1, 0:nz+nidbas-1), intent(out)  rhs,
logical, dimension(np), intent(in), optional  nl_depos,
integer, dimension(:), intent(in), optional  displs,
logical, intent(in), optional  first 
)
private

Deposit some marker attribute to field with the proper splines order.

Parameters
[in]npNumber of markers
[in]xMarker radial positions
[in]yMarker poloidal positions
[in]zMarker toroidal positions
[in]wMarker attribute to be deposited
[out]rhsResulting field
[in]nl_deposFlags to deposit markers or not
[in]displsDisplacements to access markers in specific bin
[in]firstFlag to indicate first deposition iteration

◆ get_field()

subroutine, public part_fields::get_field ( real, dimension(0:nx+nidbas-1, 0:ny+nidbas-1, 0:nz+nidbas-1), intent(in)  pot_coef,
integer, intent(in)  np,
real, dimension(np), intent(in)  x,
real, dimension(np), intent(in)  y,
real, dimension(np), intent(in)  z,
integer, dimension(:), intent(in), optional  displs,
real, dimension(np), intent(out), optional  pot,
real, dimension(np), intent(out), optional  dpot_dx,
real, dimension(np), intent(out), optional  dpot_dy,
real, dimension(np), intent(out), optional  dpot_dz 
)

Compute field and/or its gradient at marker positions with the proper spline order.

Parameters
[in]pot_coefField B-spline coefficients
[in]npNumber of markers
[in]xMarker radial positions
[in]yMarker poloidal positions
[in]zMarker toroidal positions
[in]displsDisplacements to access markers in specific bin
[out]potPotential at marker positions
[out]dpot_dxRadial derivative of potential
[out]dpot_dyPoloidal derivative of potential
[out]dpot_dzToroidal derivative of potential
+ Here is the caller graph for this function:

◆ grad_splines_bas1()

pure real function, dimension(0:1) part_fields::grad_splines_bas1 ( real, intent(in)  x)
private

Evaluate linear B-spline gradients at point x in interval [0, 1].

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ grad_splines_bas2()

pure real function, dimension(0:2) part_fields::grad_splines_bas2 ( real, intent(in)  x)
private

Evaluate quadratic B-spline gradients at point x in interval [0, 1].

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ grad_splines_bas3()

pure real function, dimension(0:3) part_fields::grad_splines_bas3 ( real, intent(in)  x)
private

Evaluate cubic B-spline gradients at point x in interval [0, 1].

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init_deposition_by_cell()

subroutine part_fields::init_deposition_by_cell
private

Initialization routine for deposition by cell.

Date
08/2017
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init_deposition_by_color()

subroutine part_fields::init_deposition_by_color
private

Initialization routine for deposition using the color scheme algorithm.

Author
Emmanuel Lanti
Date
05/2017
+ Here is the caller graph for this function:

◆ init_deposition_by_color_buf()

subroutine part_fields::init_deposition_by_color_buf
private

Initialization routine for deposition using the buffered color scheme algorithm.

Author
Emmanuel Lanti
Date
06/2017
+ Here is the caller graph for this function:

◆ init_deposition_by_part()

subroutine part_fields::init_deposition_by_part
private

Initialization routine for deposition by particle.

Date
08/2017
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init_module()

subroutine, public part_fields::init_module ( integer, intent(in)  nidbas_,
integer, intent(in)  ns_,
integer, intent(in)  nchi_,
integer, intent(in)  nphi_,
integer, intent(in)  iz_offset_,
real, intent(in)  ds_,
real, intent(in)  dchi_,
real, intent(in)  dphi_,
real, intent(in)  xmin_,
logical, intent(in)  nl_gradgyr_,
integer, intent(in)  nsel_depos_,
integer, intent(in)  nsel_get_field_,
integer, intent(in)  nbin_x_,
integer, intent(in)  nbin_y_,
integer, intent(in)  nbin_z_,
integer, intent(in)  color_nbin_x_,
integer, intent(in)  color_nbin_y_ 
)

Initialize module variables.

+ Here is the call graph for this function:

◆ nullify_rhs()

subroutine part_fields::nullify_rhs ( real, dimension(0:nx+nidbas-1, 0:ny+nidbas-1, iz_offset:iz_offset+nz+nidbas-1), intent(out)  rhs)
private

Set rhs to 0.

◆ nullify_rhs_omp()

subroutine part_fields::nullify_rhs_omp ( integer, intent(in)  ithread)
private

Set rhs_omp to 0.

Note
Must be called inside parallel region. Each thread takes care of his own grid replication.
Parameters
[in]ithreadOpenMP thread ID

◆ reduction_threads()

subroutine part_fields::reduction_threads ( real, dimension(0:nx+nidbas-1, 0:ny+nidbas-1, iz_offset:iz_offset+nz+nidbas-1), intent(out)  rhs)
private

Sum up OpenMP threads rhs replications.

Note
Must be called inside parallel region.
Parameters
[out]rhsResulting field

◆ splines_bas1()

pure real function, dimension(0:1) part_fields::splines_bas1 ( real, intent(in)  x)
private

Evaluate linear B-splines at point x in interval [0, 1].

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ splines_bas2()

pure real function, dimension(0:2) part_fields::splines_bas2 ( real, intent(in)  x)
private

Evaluate quadratic B-splines at point x in interval [0, 1].

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ splines_bas3()

pure real function, dimension(0:3) part_fields::splines_bas3 ( real, intent(in)  x)
private

Evaluate cubic B-splines at point x in interval [0, 1].

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ bin_array

integer, dimension(:,:), allocatable, save part_fields::bin_array
private

Array containing the index of the particles in a bucket.

◆ color_buffer

real, dimension(:,:,:), allocatable, save part_fields::color_buffer
private

Buffer used for the buffered version of color scheme.

◆ color_nbin_x

integer, save part_fields::color_nbin_x
private

Number of radial bins for color scheme.

◆ color_nbin_y

integer, save part_fields::color_nbin_y
private

Number of poloidal bins for color scheme.

◆ dx_inv

real, save part_fields::dx_inv
private

Inverse radial mesh size.

◆ dy_inv

real, save part_fields::dy_inv
private

Inverse poloidal mesh size.

◆ dz_inv

real, save part_fields::dz_inv
private

Inverse toroidal mesh size.

◆ grid_cells_in_x_color_bucket

integer, save part_fields::grid_cells_in_x_color_bucket
private

Number of grid cell per bucket in s.

◆ grid_cells_in_y_color_bucket

integer, save part_fields::grid_cells_in_y_color_bucket
private

Number of grid cell per bucket in chi.

◆ iz_offset

integer, save part_fields::iz_offset
private

Starting toroidal interval.

◆ k_end

integer, save part_fields::k_end
private

Indexes of the local subdomain.

◆ k_start

integer, save part_fields::k_start
private

◆ nbin_x

integer, save part_fields::nbin_x
private

Number of radial bins.

◆ nbin_x_avg

integer, save part_fields::nbin_x_avg
private

◆ nbin_y

integer, save part_fields::nbin_y
private

Number of poloidal bins.

◆ nbin_y_avg

integer, save part_fields::nbin_y_avg
private

Number of sorting bins in each color bucket.

◆ nbin_z

integer, save part_fields::nbin_z
private

Number of local toroidal bins.

◆ nidbas

integer, save part_fields::nidbas
private

Spline order.

◆ nl_gradgyr

logical, save part_fields::nl_gradgyr
private

Take gradient of gyroaverage potential instead of gyroaverage gradient of potential.

◆ nsel_depos

integer, save part_fields::nsel_depos
private

Deposition method.

◆ nsel_get_field

integer, save part_fields::nsel_get_field
private

Get field method.

◆ number_of_bins_per_bucket

integer, save part_fields::number_of_bins_per_bucket
private

◆ number_of_buckets

integer, save part_fields::number_of_buckets
private

Number of bins per bucket and total # of buckets.

◆ nx

integer, save part_fields::nx
private

Number of radial intervals.

◆ ny

integer, save part_fields::ny
private

Number of poloidal intervals.

◆ nz

integer, save part_fields::nz
private

Number of local toroidal intervals.

◆ rhs_omp

real, dimension(:,:,:,:), allocatable, save part_fields::rhs_omp
private

Working array for deposition (field replicated among OpenMP threads)

◆ use_vectorized

logical, save part_fields::use_vectorized = .false.
private

Flag to use the vectorized version.

◆ xmin

real, save part_fields::xmin
private

Inner boundary position.