OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
Avg< d, arg, Sys_eqs, CENTRAL > Class Template Reference

Central average scheme on direction i. More...

Detailed Description

template<unsigned int d, typename arg, typename Sys_eqs>
class Avg< d, arg, Sys_eqs, CENTRAL >

Central average scheme on direction i.

*
*  +0.5     +0.5
*   *---+---*
*
* 

Definition at line 65 of file Average.hpp.

#include <Average.hpp>

Static Public Member Functions

static void value (const typename stub_or_real< Sys_eqs, Sys_eqs::dims, typename Sys_eqs::stype, typename Sys_eqs::b_grid::decomposition::extended_type >::type &g_map, grid_dist_key_dx< Sys_eqs::dims > &kmap, const grid_sm< Sys_eqs::dims, void > &gs, typename Sys_eqs::stype(&spacing)[Sys_eqs::dims], std::unordered_map< long int, typename Sys_eqs::stype > &cols, typename Sys_eqs::stype coeff)
 Calculate which colums of the Matrix are non zero.
 
static grid_key_dx< Sys_eqs::dims > position (grid_key_dx< Sys_eqs::dims > &pos, const grid_sm< Sys_eqs::dims, void > &gs, const comb< Sys_eqs::dims >(&s_pos)[Sys_eqs::nvar])
 Calculate the position where the average is calculated.
 

Member Function Documentation

◆ position()

template<unsigned int d, typename arg , typename Sys_eqs >
static grid_key_dx< Sys_eqs::dims > Avg< d, arg, Sys_eqs, CENTRAL >::position ( grid_key_dx< Sys_eqs::dims > &  pos,
const grid_sm< Sys_eqs::dims, void > &  gs,
const comb< Sys_eqs::dims >(&)  s_pos[Sys_eqs::nvar] 
)
inlinestatic

Calculate the position where the average is calculated.

It follow the same concept of central derivative

Parameters
posposition where we are calculating the derivative
gsGrid info
s_posstaggered position of the properties

Definition at line 116 of file Average.hpp.

◆ value()

template<unsigned int d, typename arg , typename Sys_eqs >
static void Avg< d, arg, Sys_eqs, CENTRAL >::value ( const typename stub_or_real< Sys_eqs, Sys_eqs::dims, typename Sys_eqs::stype, typename Sys_eqs::b_grid::decomposition::extended_type >::type &  g_map,
grid_dist_key_dx< Sys_eqs::dims > &  kmap,
const grid_sm< Sys_eqs::dims, void > &  gs,
typename Sys_eqs::stype(&)  spacing[Sys_eqs::dims],
std::unordered_map< long int, typename Sys_eqs::stype > &  cols,
typename Sys_eqs::stype  coeff 
)
inlinestatic

Calculate which colums of the Matrix are non zero.

stub_or_real it is just for change the argument type when testing, in normal conditions it is a distributed map

Parameters
g_mapIt is the map explained in FDScheme
kmapposition where the average is calculated
gsGrid info
colsnon-zero colums calculated by the function
coeffcoefficent (constant in front of the derivative)

Example

Definition at line 85 of file Average.hpp.


The documentation for this class was generated from the following file: