OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
LNorms.hpp File Reference

Header file containing functions for computing the error and the L_2 / L_infinity norm. More...

#include <iostream>
#include <typeinfo>
#include <cmath>
#include <cstdio>
#include <stdlib.h>
#include "Vector/vector_dist.hpp"
#include "Grid/grid_dist_id.hpp"
#include "util/PathsAndFiles.hpp"
#include "level_set/redistancing_Sussman/HelpFunctions.hpp"

Go to the source code of this file.

Data Structures

class  LNorms< lnorm_type >
 Class for computing the l2/l_infinity norm for distributed grids and vectors based on given errors. More...
 

Functions

template<size_t PropNumeric, size_t PropAnalytic, size_t Error, typename gridtype >
void get_absolute_error (gridtype &grid)
 At each grid node, the absolute error is computed and stored in another property. More...
 
template<size_t PropNumeric, size_t PropAnalytic, size_t Error, typename gridtype >
void get_relative_error (gridtype &grid)
 At each grid node, the relative error is computed and stored in another property. More...
 

Detailed Description

Header file containing functions for computing the error and the L_2 / L_infinity norm.

The L_2 and L_inf norm are useful for verification by convergence testings / plots.

Author
Justina Stark
Date
May 2020

Definition in file LNorms.hpp.

Function Documentation

◆ get_absolute_error()

template<size_t PropNumeric, size_t PropAnalytic, size_t Error, typename gridtype >
void get_absolute_error ( gridtype &  grid)

At each grid node, the absolute error is computed and stored in another property.

The absolute error is computed as:

\[ Error_{abs} = | numerical solution - analytical solution | \]

Template Parameters
PropNumericIndex of grid property that contains the numerical value.
PropAnalyticIndex of grid property that contains the analytical (exact) value.
ErrorIndex of grid property where the computed error should be written to.
gridtypeTemplate type of the input grid.
Parameters
gridInput OpenFPM grid. Can be of any dimension.

Definition at line 43 of file LNorms.hpp.

◆ get_relative_error()

template<size_t PropNumeric, size_t PropAnalytic, size_t Error, typename gridtype >
void get_relative_error ( gridtype &  grid)

At each grid node, the relative error is computed and stored in another property.

The relative error is computed as:

\[ Error_{rel} = | 1 - \frac{numerical solution}{analytical solution} | \]

Template Parameters
PropNumericIndex of grid property that contains the numerical value.
PropAnalyticIndex of grid property that contains the analytical (exact) value.
ErrorIndex of grid property where the computed error should be written to.
gridtypeTemplate type of the input grid.
Parameters
gridInput OpenFPM grid. Can be of any dimension.

Definition at line 75 of file LNorms.hpp.