Alsvinn  0.5.3
The fast FVM simulator with UQ support
Public Member Functions | List of all members
alsfvm::functional::Legendre Class Reference

#include <alsfvm/functional/Legendre.hpp>

Inheritance diagram for alsfvm::functional::Legendre:
alsfvm::functional::Functional

Public Member Functions

 Legendre (const Parameters &parameters)
 
virtual void operator() (volume::Volume &conservedVolumeOut, const volume::Volume &conservedVolumeIn, const real weight, const grid::Grid &grid) override
 
virtual ivec3 getFunctionalSize (const grid::Grid &grid) const override
 Returns ivec3{1,1,1} – we only need one element to represent this functional. More...
 
- Public Member Functions inherited from alsfvm::functional::Functional
virtual ~Functional ()
 
virtual ivec3 getGhostCellSizes (const grid::Grid &grid, const volume::Volume &volume) const
 
virtual std::string getPlatformToAllocateOn (const std::string &platform) const
 

Additional Inherited Members

- Public Types inherited from alsfvm::functional::Functional
typedef alsutils::parameters::Parameters Parameters
 To be used to pass parameters to the constructors. More...
 

Detailed Description

Computes the spatial integral of the n-th Legendre polynomial, ie it will compute

\[\int_D L_k(x)L_n(y)L_k(u(x, y))\; dx\; dy\]

where $L_n$ is the n-th Legendre polynomial.

You have the option of scaling the input u to the interval [-1,1] by specifying the keywords maxValue and minValue, this will essentially compute

\[\int_D L_k(x)L_n(y)L_m(\frac{u(x, y)-\mathrm{minValue}}{\mathrm{maxValue}-\mathrm{minValue}})\;dx\]

In terms of pairing between one point Young measures and test functions, this corresponds to

\[\langle \psi, \langle \nu, g\rangle \rangle\]

where $\psi(x,y)= L_k(x)L_n(y)$ and $g(\xi) = L_m(\xi)$.

Note
We always scale the polynomials in the spatial direction (ie. $L_k(x)L_n(y)$)
The computation of the Legendre polynomials are done through the boost library, see http://www.boost.org/doc/libs/1_46_1/libs/math/doc/sf_and_dist/html/math_toolkit/special/sf_poly/legendre.html for any implementation details. In short, $L_n(x)=boost::math::legendre_p(n,x)$

Constructor & Destructor Documentation

◆ Legendre()

alsfvm::functional::Legendre::Legendre ( const Parameters parameters)

The following parameters are accepted through parameters

Name Description
minValue minimum value that the solution can obtain
maxValue maximum value that the solution can obtain
degree_k the degree of the polynomial $L_k(x)$
degree_n the degree of the polynomial $L_n(x)$
degree_m the degree of the polynomial $L_m(u(x,y))$
variables the variables to compute for (space separated)

Member Function Documentation

◆ getFunctionalSize()

ivec3 alsfvm::functional::Legendre::getFunctionalSize ( const grid::Grid grid) const
overridevirtual

Returns ivec3{1,1,1} – we only need one element to represent this functional.

Implements alsfvm::functional::Functional.

◆ operator()()

void alsfvm::functional::Legendre::operator() ( volume::Volume conservedVolumeOut,
const volume::Volume conservedVolumeIn,
const real  weight,
const grid::Grid grid 
)
overridevirtual

Computes the operator value on the givne input data

Note
In order to support time integration, the result should be added to conservedVolumeOut and extraVolumeOut, not overriding it.
Parameters
[out]conservedVolumeOutat the end, should have the contribution of the functional for the conservedVariables
[in]conservedVolumeInthe state of the conserved variables
[in]weightthe current weight to be applied to the functional. Ie, the functional should compute
conservedVolumeOut += weight + f(conservedVolumeIn)
[in]gridthe current grid

Implements alsfvm::functional::Functional.


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