Afivo  0.3
Functions/Subroutines
m_af_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(size(ivs)), public af_interp0 (tree, r, ivs, success, id_guess)
 Using zeroth order interpolation to get a value at r in cell. More...
 
real(dp) function, dimension(size(ivs)), public af_interp1 (tree, r, ivs, success, id_guess)
 Using linear interpolation to get a value at r. More...
 
subroutine, public af_interp0_to_grid (tree, r, iv, amount, to_density)
 Add 'amount' to the grid cell nearest to r. More...
 
real(dp) function, dimension(ndim), public af_interp1_fc (tree, r, ifc, success, id_guess)
 Linearly interpolate face-centered variable to a position r. 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

◆ af_interp0()

real(dp) function, dimension(size(ivs)), public m_af_interp::af_interp0 ( type(af_t), intent(in)  tree,
real(dp), dimension(ndim), intent(in)  r,
integer, dimension(:), intent(in)  ivs,
logical, intent(out)  success,
integer, intent(inout), optional  id_guess 
)

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

Parameters
[in]treeParent box
[in]rWhere to interpolate
[in]ivsVariables to interpolate
[out]successWhether the interpolation worked
[in,out]id_guessGuess for box id (will be updated)

Definition at line 19 of file m_af_interp.f90.

◆ af_interp1()

real(dp) function, dimension(size(ivs)), public m_af_interp::af_interp1 ( type(af_t), intent(in)  tree,
real(dp), dimension(ndim), intent(in)  r,
integer, dimension(:), intent(in)  ivs,
logical, intent(out)  success,
integer, intent(inout), optional  id_guess 
)

Using linear interpolation to get a value at r.

Parameters
[in]treeParent box
[in]rWhere to interpolate
[in]ivsVariables to interpolate
[out]successWhether the interpolation worked
[in,out]id_guessGuess for box id (will be updated)

Definition at line 43 of file m_af_interp.f90.

◆ af_interp0_to_grid()

subroutine, public m_af_interp::af_interp0_to_grid ( type(af_t), intent(inout)  tree,
real(dp), dimension(ndim), intent(in)  r,
integer, intent(in)  iv,
real(dp), intent(in)  amount,
logical, intent(in)  to_density 
)

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

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

Definition at line 108 of file m_af_interp.f90.

◆ af_interp1_fc()

real(dp) function, dimension(ndim), public m_af_interp::af_interp1_fc ( type(af_t), intent(in)  tree,
real(dp), dimension(ndim), intent(in)  r,
integer, intent(in)  ifc,
logical, intent(out)  success,
integer, intent(inout), optional  id_guess 
)

Linearly interpolate face-centered variable to a position r.

Parameters
[in]treeParent box
[in]rWhere to interpolate
[in]ifcFace-centered variable
[out]successWhether the interpolation worked
[in,out]id_guessGuess for box id (will be updated)

Definition at line 142 of file m_af_interp.f90.