Finite grids in real space: the box module

Quick access

Types:box_iterator, cell, subbox
Routines:box_iter(), box_iter_closest_r(), box_iter_distance(), box_iter_expand_nbox(), box_iter_inside(), box_iter_merge(), box_iter_rewind(), box_iter_set_nbox(), box_iter_split(), box_iter_square_gd(), box_iter_validate(), box_nbox_from_cutoff(), box_next_point(), box_next_x(), box_next_y(), box_next_z(), cell_new(), cell_null(), cell_r(), nullify_box_iterator(), operator(.or.)(), subbox_null()

Needed modules

Types

  • type box/cell
    Type fields:
    • % dom [domain] :: < data type for the simulation domain
    • % habc (3,3) [real] :: <primitive volume elements in the translation vectors direction
    • % hgrids (3) [real] :: < real space grid on each direction
    • % ndim [integer] :: < product of the dimension, long integer to avoid overflow
    • % ndims (3) [integer] :: < number of grid points on each direction
    • % volume_element [real] :: < volume element of the primitive cell
  • type box/subbox

    ! start and end points for each direction

    Type fields:
    • % nbox (2,3) [integer, optional/default=-1]
  • type box/box_iterator
    Type fields:
    • % i [integer]
    • % i23 [integer, optional/default=-1] :: <collapsed index in 23 dimension (in relative conventions)
    • % i3e [integer, optional/default=-1] :: <ending point in the dimension z
    • % i3s [integer, optional/default=-1] :: <starting point in the dimension z
    • % ind [integer, optional/default=-1] :: <one-dimensional index for arrays (in relative conventions)
    • % inext (3) [integer, optional/default=0]
    • % j [integer]
    • % k [integer] :: better as scalars
    • % mesh [cell, pointer/optional/default=>null()]
    • % nbox (2,3) [integer, optional/default=-1]
    • % oxyz (3) [real, optional/default=-1.0_gp] :: <origin of the coordinate system
    • % rxyz (3) [real, optional/default=-1.0_gp] :: <coordinates of the grid point which is internal at the box
    • % rxyz_nbox (3) [real, optional/default=-1.0_gp] :: <coordinates of the grid point which is internal at the box
    • % subbox (2,3) [integer, optional/default=-1] :: <box of the local task
    • % tmp (3) [real, optional/default=0.0_gp] :: < size 3 array buffer to avoid the creation of temporary arrays
    • % whole [logical, optional/default=.false.] :: <to assess if we run over the entire box or not (no check over the internal point)

Subroutines and functions

interface box/operator(.or.)(sb1, sb2)
Parameters:
interface box/operator(==)(sb1, sb2)
Parameters:
interface box/operator(/=)(sb1, sb2)
Parameters:
function box/cell_null()
Return:me [cell]
Called from:bind_cell_null()
subroutine box/nullify_box_iterator(boxit)
Parameters:boxit [box_iterator, out]
Called from:box_iter(), bind_nullify_box_iterator()
function box/box_iter(mesh[, nbox, origin, i3s, n3p, centered, cutoff])
Parameters:

mesh [cell, in,target]

Options:
  • nbox (2,3) [integer, in,]
  • origin (3) [real, in,]
  • i3s [integer, in,]
  • n3p [integer, in,]
  • centered [logical, in,]
  • cutoff [real, in,] :: < determine the box around the origin
Return:

boxit [box_iterator]

Use :

f_utils (f_zero())

Called from:

dump_field(), bind_box_iter()

Call to:

nullify_box_iterator(), box_iter_set_nbox()

subroutine box/box_iter_set_nbox(bit[, nbox, oxyz, cutoff])
Parameters:

bit [box_iterator, inout]

Options:
  • nbox (2,3) [integer, in,]
  • oxyz (3) [real, in,]
  • cutoff [real, in,]
Called from:

box_iter(), bind_box_iter_set_nbox(), multipole_centers_to_gaussian_density()

function box/box_nbox_from_cutoff(mesh, oxyz, cutoff[, inner])
Parameters:
  • mesh [cell, in]
  • oxyz (3) [real, in]
  • cutoff [real, in]
Options:

inner [logical, in,]

Return:

nbox (2,3) [integer]

Called from:

bind_box_nbox_from_cutoff()

subroutine box/box_iter_expand_nbox(bit)
Parameters:bit [box_iterator, inout]
Called from:bind_box_iter_expand_nbox(), multipole_centers_to_gaussian_density()
subroutine box/box_iter_validate(bit)
Parameters:bit [box_iterator, inout]
Use :f_precisions, yaml_strings, dictionaries, dynamic_memory, f_arrays, f_utils (f_assert())
Call to:box_next_z(), box_next_y(), box_next_x(), box_next_point()
subroutine box/box_iter_rewind(bit)
Parameters:bit [box_iterator, inout]
Called from:box_next_z(), bind_box_iter_rewind()
function box/box_next_z(bit)
Parameters:bit [box_iterator, inout] :: to be removed
Return:ok [logical]
Called from:box_iter_validate(), box_next_point(), bind_box_next_z(), separable_3d_function(), separable_3d_laplacian(), mp_gaussian_density()
Call to:box_iter_rewind()
function box/box_next_y(bit)
Parameters:bit [box_iterator, inout]
Return:ok [logical]
Called from:box_iter_validate(), box_next_point(), bind_box_next_y(), separable_3d_function(), separable_3d_laplacian(), mp_gaussian_density()
function box/box_next_x(bit)
Parameters:bit [box_iterator, inout]
Return:ok [logical]
Called from:box_iter_validate(), box_next_point(), bind_box_next_x(), separable_3d_function(), separable_3d_laplacian(), mp_gaussian_density()
function box/box_next_point(boxit)
Parameters:boxit [box_iterator, inout]
Return:box_next_point [logical]
Called from:box_iter_validate(), bind_box_next_point(), radial_3d_function(), field_multipoles(), multipole_centers_to_gaussian_density()
Call to:box_next_z(), box_next_y(), box_next_x()
subroutine box/box_iter_split(boxit, ntasks, itask)
Parameters:
  • boxit [box_iterator, inout]
  • ntasks [integer, in]
  • itask [integer, in]
Called from:

bind_box_iter_split(), multipole_centers_to_gaussian_density()

subroutine box/box_iter_merge(boxit)
Parameters:boxit [box_iterator, inout]
Called from:bind_box_iter_merge(), multipole_centers_to_gaussian_density()
function box/cell_new(dom, ndims, hgrids)

function cell_new(geocode,ndims,hgrids,alpha_bc,beta_ac,gamma_ab,abc) result(mesh)

Parameters:
  • dom [domain, in] :: < data type for the simulation domain
  • ndims (3) [integer, in]
  • hgrids (3) [real, in]
Return:

mesh [cell]

Use :

numerics (onehalf(), pi()), wrapper_linalg (det_3x3()), f_utils (f_assert()), dictionaries (f_err_throw())

Called from:

bind_cell_new()

function box/cell_r(mesh, i, dim)
Parameters:
  • mesh [cell, in]
  • i [integer, in]
  • dim [integer, in]
Return:

t [real]

Called from:

bind_cell_r()

function box/box_iter_square_gd(bit)
Parameters:bit [box_iterator, in]
Return:box_iter_square_gd [real]
Called from:bind_box_iter_square_gd(), radial_3d_function()
function box/box_iter_closest_r(bit, rxyz[, orthorhombic])
Parameters:
Options:

orthorhombic [logical, in,]

Return:

r (3) [real]

Called from:

bind_box_iter_closest_r(), field_multipoles()

function box/box_iter_distance(bit, rxyz0)
Parameters:
Return:

box_iter_distance [real]

Called from:

bind_box_iter_distance(), multipole_centers_to_gaussian_density()

function box/box_iter_inside(iter, sub)
Parameters:
Return:

in [logical]

Called from:

multipole_centers_to_gaussian_density()

function box/subbox_null()
Return:sub [subbox]
Called from:multipole_centers_to_gaussian_density()