Loading...
Searching...
No Matches
dolfin::Lagrange Class Reference

`#include <Lagrange.h>`

Inheritance diagram for dolfin::Lagrange:
[legend]
Collaboration diagram for dolfin::Lagrange:
[legend]

## Public Member Functions

| Lagrange (std::size_t q)
| Constructor.
| Lagrange (const Lagrange &p)
| Copy constructor.
void | set (std::size_t i, double x)
std::size_t | size () const
std::size_t | degree () const
double | point (std::size_t i) const
double | operator() (std::size_t i, double x)
double | eval (std::size_t i, double x)
double | ddx (std::size_t i, double x)
double | dqdx (std::size_t i)
std::string | str (bool verbose) const
Public Member Functions inherited from dolfin::Variable
| Variable ()
| Create unnamed variable.
| Variable (const std::string name, const std::string label)
| Create variable with given name and label.
| Variable (const Variable &variable)
| Copy constructor.
virtual | ~Variable ()
| Destructor.
const Variable & | operator= (const Variable &variable)
| Assignment operator.
void | rename (const std::string name, const std::string label)
| Rename variable.
std::string | name () const
| Return name.
std::string | label () const
| Return label (description).
std::size_t | id () const

## Additional Inherited Members

Public Attributes inherited from dolfin::Variable
Parameters | parameters
| Parameters.

## Detailed Description

Lagrange polynomial (basis) with given degree q determined by n = q + 1 nodal points.

Example: q = 1 (n = 2)

Lagrange p(1); p.set(0, 0.0); p.set(1, 1.0);

It is the callers responsibility that the points are distinct.

This creates a Lagrange polynomial (actually two Lagrange polynomials):

p(0,x) = 1 - x (one at x = 0, zero at x = 1) p(1,x) = x (zero at x = 0, one at x = 1)

## Member Function Documentation

## ddx()

double Lagrange::ddx | ( | std::size_t | i,
|  | double | x )

Return derivate of polynomial i at given point x

Parameters

  i | (std::size_t)
  x | (double)

## degree()

std::size_t Lagrange::degree | ( |  | ) | const

Return degree

Returns
  std::size_t

## dqdx()

double Lagrange::dqdx | ( | std::size_t | i | ) |

Return derivative q (a constant) of polynomial

Parameters

  i | (std::size_t)

## eval()

double Lagrange::eval | ( | std::size_t | i,
|  | double | x )

Return value of polynomial i at given point x

Parameters

  i | (std::size_t)
  x | (double)

## operator()()

double Lagrange::operator() | ( | std::size_t | i,
|  | double | x )

Return value of polynomial i at given point x

Parameters

  i | (std::size_t)
  x | (double)

## point()

double Lagrange::point | ( | std::size_t | i | ) | const

Return point

Parameters

  i | (std::size_t)

## set()

void Lagrange::set | ( | std::size_t | i,
|  | double | x )

Specify point

Parameters

  i | (std::size_t)
  x | (double)

## size()

std::size_t Lagrange::size | ( |  | ) | const

Return number of points

Returns
  std::size_t

## str()

std::string Lagrange::str | ( | bool | verbose | ) | const

virtual

Return informal string representation (pretty-print)

Parameters

  verbose | (bool) Verbosity of output string

Reimplemented from dolfin::Variable.

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

- /build/dolfin-lFBzDh/dolfin-2019.2.0~legacy20240219.1c52e83/dolfin/math/Lagrange.h
- /build/dolfin-lFBzDh/dolfin-2019.2.0~legacy20240219.1c52e83/dolfin/math/Lagrange.cpp