Opm::DGBasisMultilin Class Reference

A class providing discontinuous Galerkin basis functions of multi-degree 1 (bilinear or trilinear functions). More...

#include <DGBasis.hpp>

Inheritance diagram for Opm::DGBasisMultilin:
Opm::DGBasisInterface

Public Member Functions

 DGBasisMultilin (const UnstructuredGrid &grid, const int degree)
 Constructor. More...
 
virtual ~DGBasisMultilin ()
 Destructor.
 
virtual int numBasisFunc () const
 The number of basis functions per cell.
 
virtual int dimensions () const
 The number of space dimensions.
 
virtual int degree () const
 The polynomial degree of the basis functions.
 
virtual void eval (const int cell, const double *x, double *f_x) const
 Evaluate all basis functions associated with cell at x, writing to f_x. More...
 
virtual void evalGrad (const int cell, const double *x, double *grad_f_x) const
 Evaluate gradients of all basis functions associated with cell at x, writing to grad_f_x. More...
 
virtual void addConstant (const double increment, double *coefficients) const
 Modify basis coefficients to add to the function value. More...
 
virtual void multiplyGradient (const double factor, double *coefficients) const
 Modify basis coefficients to change the function's slope. More...
 
virtual double functionAverage (const double *coefficients) const
 Compute the average of the function f = sum_i c_i b_i. More...
 
- Public Member Functions inherited from Opm::DGBasisInterface
virtual ~DGBasisInterface ()
 Virtual destructor.
 
double evalFunc (const int cell, const double *coefficients, const double *x) const
 Evaluate function f = sum_i c_i b_i at the point x. More...
 

Detailed Description

A class providing discontinuous Galerkin basis functions of multi-degree 1 (bilinear or trilinear functions).

The basis functions for a cell are the following Degree 0: 1. (for 2 dims:) (Bi)degree 1: (x-)(y-), (x-)(y+), (x+)(y-), (x+)(y+) where (x-) = (1/2 - x + xc), (x+) = (1/2 + x - xc) and xc is the x-coordinate of the cell centroid. Similar for (y-), (y+).

Constructor & Destructor Documentation

◆ DGBasisMultilin()

Opm::DGBasisMultilin::DGBasisMultilin ( const UnstructuredGrid &  grid,
const int  degree_arg 
)

Constructor.

Parameters
[in]gridgrid on which basis is used (cell-wise)
[in]degreepolynomial degree of basis (in each coordinate)
[in]gridgrid on which basis is used (cell-wise)
[in]degreepolynomial degree of basis

Member Function Documentation

◆ addConstant()

void Opm::DGBasisMultilin::addConstant ( const double  increment,
double *  coefficients 
) const
virtual

Modify basis coefficients to add to the function value.

A function f = sum_i c_i b_i is assumed, and we change it to (f + increment) by modifying the c_i. This is done without modifying its gradient.

Parameters
[in]incrementAdd this value to the function.
[out]coefficientsCoefficients {c_i} for a single cell.

Implements Opm::DGBasisInterface.

◆ eval()

void Opm::DGBasisMultilin::eval ( const int  cell,
const double *  x,
double *  f_x 
) const
virtual

Evaluate all basis functions associated with cell at x, writing to f_x.

The array f_x must have size equal to numBasisFunc().

Implements Opm::DGBasisInterface.

◆ evalGrad()

void Opm::DGBasisMultilin::evalGrad ( const int  cell,
const double *  x,
double *  grad_f_x 
) const
virtual

Evaluate gradients of all basis functions associated with cell at x, writing to grad_f_x.

The array grad_f_x must have size numBasisFunc() * dimensions(). The dimensions() components of the first basis function gradient come before the components of the second etc.

Implements Opm::DGBasisInterface.

◆ functionAverage()

double Opm::DGBasisMultilin::functionAverage ( const double *  coefficients) const
virtual

Compute the average of the function f = sum_i c_i b_i.

Parameters
[in]coefficientsCoefficients {c_i} for a single cell.

Implements Opm::DGBasisInterface.

◆ multiplyGradient()

void Opm::DGBasisMultilin::multiplyGradient ( const double  factor,
double *  coefficients 
) const
virtual

Modify basis coefficients to change the function's slope.

A function f = sum_i c_i b_i is assumed, and we change it to a function g with the property that grad g = factor * grad f by modifying the c_i. This is done without modifying the average, i.e. the integrals of g and f over the cell are the same.

Parameters
[in]factorMultiply gradient by this factor.
[out]coefficientsCoefficients {c_i} for a single cell.

Implements Opm::DGBasisInterface.


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