spaces.operators Module

Provides data structures that represent weak forms differential operators.

class pysofe.spaces.operators.Operator(fe_space)[source]

Base class for all operators.

Derived classes have to implement the method _compute_entries()

Parameters:fe_space (pysofe_light.spaces.space.FESpace) – A function space the operator works on
assemble(codim=0, mask=None)[source]

Assembles the discrete weak operator.

Parameters:
  • codim (int) – The codimension of the entities for which to assemble
  • mask (array_like) – Boolean 1d array marking specific entities for assembling
Returns:

Return type:

scipy.sparse.lil_matrix

class pysofe.spaces.operators.MassMatrix(fe_space, c=1)[source]

Represents the operator

\[\int_{\Omega} c uv\]

where \(u,v \in V\) and \(c \in L^{2}\).

Parameters:
  • fe_space (pysofe_light.spaces.space.FESpace) – The function space the operator works on
  • c (scalar, callable) – The function factor
class pysofe.spaces.operators.L2Product(fe_space, f=1)[source]

Represents the operator

\[\int_{\Omega} fv\]

where \(v \in V\) and \(f \in L^{2}\).

Parameters:
  • fe_space (pysofe_light.spaces.space.FESpace) – The function space the operator works on
  • f (scalar, callable) – The function factor
class pysofe.spaces.operators.Laplacian(fe_space, a=1)[source]

Represents the operator

\[\int_{\Omega} a \nabla u \cdot \nabla v\]

where \(u,v \in V\) and \(a \in L^{2}\).

Parameters:
  • fe_space (pysofe_light.spaces.space.FESpace) – The function space the operator works on
  • a (scalar, callable) – The function factor
class pysofe.spaces.operators.L2Projection[source]

Provides an object for the \(L^{2}\)-projection of a given function.

static project(fnc, fe_space, codim=0, mask=None)[source]

Projects the given function to the given finite element space.

Parameters:
  • fnc (scalar, callable) – The function to project
  • fe_space – The function space onto which to project
  • codim (int) – The codimension of the considered entities
  • mask (array_like) – Boolean array marking entities onto which to project