Afivo  0.3
Functions/Subroutines
m_a2_interp Module Reference

This module contains routines related to interpolation, which can interpolate 'to' the grid and 'from' the grid (useful for e.g. particle simulations). The interpolation for meshes is called prolongation, see m_aX_prolong. More...

Functions/Subroutines

real(dp) function, dimension(n_var), public a2_interp0 (tree, rr, ivs, n_var)
 Using zeroth order interpolation to get a value at r in cell. More...
 
real(dp) function, dimension(n_var), public a2_interp1 (tree, r, ivs, n_var, id_guess)
 Using linear interpolation to get a value at r. More...
 
subroutine, public a2_interp0_to_grid (tree, rr, iv, amount, to_density)
 Add 'amount' to the grid cell nearest to rr. More...
 

Detailed Description

This module contains routines related to interpolation, which can interpolate 'to' the grid and 'from' the grid (useful for e.g. particle simulations). The interpolation for meshes is called prolongation, see m_aX_prolong.

Function/Subroutine Documentation

§ a2_interp0()

real(dp) function, dimension(n_var), public m_a2_interp::a2_interp0 ( type(a2_t), intent(in)  tree,
real(dp), dimension(2), intent(in)  rr,
integer, dimension(n_var), intent(in)  ivs,
integer, intent(in)  n_var 
)

Using zeroth order interpolation to get a value at r in cell.

Parameters
[in]treeParent box
[in]rrWhere to interpolate
[in]n_varNumber of variables
[in]ivsVariables to interpolate

Definition at line 19 of file m_a2_interp.f90.

§ a2_interp1()

real(dp) function, dimension(n_var), public m_a2_interp::a2_interp1 ( type(a2_t), intent(in)  tree,
real(dp), dimension(2), intent(in)  r,
integer, dimension(n_var), intent(in)  ivs,
integer, intent(in)  n_var,
integer, intent(in), optional  id_guess 
)

Using linear interpolation to get a value at r.

Parameters
[in]treeParent box
[in]rWhere to interpolate
[in]n_varNumber of variables
[in]ivsVariables to interpolate
[in]id_guessGuess for box id

Definition at line 39 of file m_a2_interp.f90.

§ a2_interp0_to_grid()

subroutine, public m_a2_interp::a2_interp0_to_grid ( type(a2_t), intent(inout)  tree,
real(dp), dimension(2), intent(in)  rr,
integer, intent(in)  iv,
real(dp), intent(in)  amount,
logical, intent(in)  to_density 
)

Add 'amount' to the grid cell nearest to rr.

Parameters
[in]ivIndex of variable
[in]rrLocation
[in]amountHow much to add
[in]to_densityIf true, divide by cell volume
Todo:
Support cylindrical coordinates

Definition at line 80 of file m_a2_interp.f90.