Skip to content

puncturedfem.LocalPolynomial

Polynomial on a mesh cell.

A typical use case for this class is to represent a polynomial part of a local Poisson function.

The weighted normal derivative of the polynomial and that of its anti-Laplacian are computed and stored in their respective DirichletTrace objects.

Attributes:

Name Type Description
exact_form Polynomial

Exact form of the polynomial.

trace DirichletTrace

Dirichlet trace of the polynomial.

grad1 Polynomial

First gradient of the polynomial.

grad2 Polynomial

Second gradient of the polynomial.

antilap Polynomial

Anti-Laplacian of the polynomial.

antilap_trace DirichletTrace

Dirichlet trace of the anti-Laplacian.

__add__(other)

Add two local polynomials.

Parameters:

Name Type Description Default
other LocalPolynomial

The other local polynomial.

required

Returns:

Type Description
LocalPolynomial

The sum of the two local polynomials.

__init__(exact_form, mesh_cell)

Initialize the polynomial.

Parameters:

Name Type Description Default
exact_form Polynomial

Exact form of the polynomial.

required
mesh_cell MeshCell

The mesh cell on which the polynomial is defined.

required

__mul__(other)

Multiply a local polynomial by a scalar.

Parameters:

Name Type Description Default
other Union[int, float]

The scalar.

required

Returns:

Type Description
LocalPolynomial

The product of the local polynomial and the scalar.

__rmul__(other)

Multiply a local polynomial by a scalar.

Parameters:

Name Type Description Default
other Union[int, float]

The scalar.

required

Returns:

Type Description
LocalPolynomial

The product of the local polynomial and the scalar.

__sub__(other)

Subtract two local polynomials.

Parameters:

Name Type Description Default
other LocalPolynomial

The other local polynomial.

required

Returns:

Type Description
LocalPolynomial

The difference of the two local polynomials.

__truediv__(other)

Divide a local polynomial by a scalar.

Parameters:

Name Type Description Default
other Union[int, float]

The scalar.

required

Returns:

Type Description
LocalPolynomial

The division of the local polynomial by the scalar.