OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
LNorms< lnorm_type > Class Template Reference

Class for computing the l2/l_infinity norm for distributed grids and vectors based on given errors. More...

Detailed Description

template<typename lnorm_type = double>
class LNorms< lnorm_type >

Class for computing the l2/l_infinity norm for distributed grids and vectors based on given errors.

Template Parameters
lnorm_typeReturn type for l-norm.

Definition at line 104 of file LNorms.hpp.

#include <LNorms.hpp>

Public Member Functions

template<size_t Error, typename gridtype >
void get_l_norms_grid (gridtype &grid)
 Computes the L_2 and L_infinity norm on the basis of the precomputed error on a grid.
 
template<size_t Error, typename vectortype >
void get_l_norms_vector (vectortype &vd)
 Computes the L_2 and L_infinity norm on the basis of the precomputed error on a particle vector.
 
template<size_t Error, typename grid_type >
void get_l_norms (grid_type &grid)
 Computes the L_2 and L_infinity norm from the error stored in a property on sparse grids, grids or particle vectors.
 
template<typename T >
void write_to_file (const T col_0, const int precision, const std::string &filename, const std::string &path_output)
 Writes the N (number of grid points on a square grid) and L-norms as strings to a csv-file.
 

Data Fields

lnorm_type l2
 
lnorm_type linf
 

Constructor & Destructor Documentation

◆ LNorms()

template<typename lnorm_type = double>
LNorms< lnorm_type >::LNorms ( )
inline

Definition at line 107 of file LNorms.hpp.

Member Function Documentation

◆ get_l_norms()

template<typename lnorm_type = double>
template<size_t Error, typename grid_type >
void LNorms< lnorm_type >::get_l_norms ( grid_type grid)
inline

Computes the L_2 and L_infinity norm from the error stored in a property on sparse grids, grids or particle vectors.

Template Parameters
ErrorIndex of grid property that contains the error.
grid_typeTemplate type of the input data structure: can be a sparse grid, dense grid or particle vector.
Parameters
gridInput sparse grid, dense grid or particle vector.

Definition at line 189 of file LNorms.hpp.

◆ get_l_norms_grid()

template<typename lnorm_type = double>
template<size_t Error, typename gridtype >
void LNorms< lnorm_type >::get_l_norms_grid ( gridtype &  grid)
inline

Computes the L_2 and L_infinity norm on the basis of the precomputed error on a grid.

Template Parameters
ErrorIndex of grid property that contains the error.
gridtypeTemplate type of the input grid.
Parameters
gridInput OpenFPM grid. Can be of any dimension.

Definition at line 124 of file LNorms.hpp.

◆ get_l_norms_vector()

template<typename lnorm_type = double>
template<size_t Error, typename vectortype >
void LNorms< lnorm_type >::get_l_norms_vector ( vectortype &  vd)
inline

Computes the L_2 and L_infinity norm on the basis of the precomputed error on a particle vector.

Template Parameters
ErrorIndex of grid property that contains the error.
vectortypeTemplate type of the input particle vector.
Parameters
vdInput particle vector.

Definition at line 155 of file LNorms.hpp.

◆ write_to_file()

template<typename lnorm_type = double>
template<typename T >
void LNorms< lnorm_type >::write_to_file ( const T  col_0,
const int  precision,
const std::string &  filename,
const std::string &  path_output 
)
inline

Writes the N (number of grid points on a square grid) and L-norms as strings to a csv-file.

Template Parameters
TType of variable that will be written in the first column of the file as reference.
Parameters
col_0Type T variable that will be written in the first column of the file as reference.
precisionPrecision in number of digits after the points for writing of the l-norms to file.
filenameStd::string containing the name of the csv file (without the .csv) to which the l-norms should be written to.
path_outputStd::string containing the path where the output csv file should be saved.

Definition at line 226 of file LNorms.hpp.

Field Documentation

◆ l2

template<typename lnorm_type = double>
lnorm_type LNorms< lnorm_type >::l2

Definition at line 113 of file LNorms.hpp.

◆ linf

template<typename lnorm_type = double>
lnorm_type LNorms< lnorm_type >::linf

Definition at line 114 of file LNorms.hpp.


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