feec.derivatives#

Classes#

Inheritance diagram of psydac.feec.derivatives

BrokenGradient2D(V0h, V1h)

Gradient operator in a 2D multipatch domain, acting independently on each patch.

BrokenScalarCurl2D(V1h, V2h)

Scalar curl operator in a 2D multipatch domain, acting independently on each patch.

BrokenTransposedGradient2D(V0h, V1h)

Transposed gradient operator in a 2D multipatch domain, acting independently on each patch.

BrokenTransposedScalarCurl2D(V1h, V2h)

Transposed scalar curl operator in a 2D multipatch domain, acting independently on each patch.

Curl3D(Hcurl, Hdiv)

Curl operator in 3D.

Derivative1D(H1, L2)

1D derivative.

DirectionalDerivativeOperator(V, W, diffdir, *)

Represents a matrix-free derivative operator in a specific cardinal direction.

Divergence2D(Hdiv, L2)

Divergence operator in 2D.

Divergence3D(Hdiv, L2)

Divergence operator in 3D.

Gradient2D(H1, Hcurl)

Gradient operator in 2D.

Gradient3D(H1, Hcurl)

Gradient operator in 3D.

ScalarCurl2D(Hcurl, L2)

Scalar curl operator in 2D: computes a scalar field from a vector field.

VectorCurl2D(H1, Hdiv)

Vector curl operator in 2D: computes a vector field from a scalar field.

Details#

class DirectionalDerivativeOperator(V, W, diffdir, *, negative=False, transposed=False)[source]#

Bases: LinearOperator

Represents a matrix-free derivative operator in a specific cardinal direction. Can be negated and transposed.

Parameters:
VStencilVectorSpace

The domain of the operator. (or codomain if transposed)

WStencilVectorSpace

The codomain of the operator. (or domain, if transposed) Has to be compatible with the domain, i.e. it has to be equal to it, except for the differentiation direction.

diffdirint

The differentiation direction.

negativebool

If True, this operator is multiplied by -1 after execution. (if False, nothing happens)

transposedbool

If True, this operator represents the transposed derivative operator. Note that then V is the codomain and W is the domain.

property domain#

The domain of the linear operator - an element of Vectorspace

property codomain#

The codomain of the linear operator - an element of Vectorspace

property dtype#

The data type of the coefficients of the linear operator, upon convertion to matrix.

dot(v, out=None)[source]#

Applies the derivative operator on the given StencilVector.

This operation will not allocate any temporary memory unless used in-place. (i.e. only if v is out)

Parameters:
vStencilVector

The input StencilVector. Has to be in the domain space.

outStencilVector | NoneType

The output StencilVector, or None. If given, it has to be in the codomain space.

Returns:
outStencilVector

Either a new allocation (if out is None), or a reference to the parameter out.

tokronstencil()[source]#

Converts this KroneckerDerivativeOperator into a KroneckerStencilMatrix.

Returns:
outKroneckerStencilMatrix

The resulting KroneckerStencilMatrix.

transpose(conjugate=False)[source]#

Transposes this operator. Creates and returns a new object.

Returns:
outDirectionalDerivativeOperator

The transposed operator.

toarray(**kwargs)[source]#

Transforms this operator into a dense matrix.

Returns:
outndarray

The resulting matrix.

tosparse(**kwargs)[source]#

Transforms this operator into a sparse matrix in COO format. Includes padding in both domain and codomain which is optional, if the domain is serial, but mandatory if the domain is parallel.

Parameters:
with_padsBool,optional

If true, then padding in domain and codomain direction is included. Enabled by default.

Returns:
outCOOMatrix

The resulting matrix.

copy()[source]#

Create an identical copy of this operator. Creates and returns a new object.

class Derivative1D(H1, L2)[source]#

Bases: FemLinearOperator

1D derivative.

Parameters:
H11D TensorFemSpace

Domain of derivative operator.

L21D TensorFemSpace

Codomain of derivative operator.

class Gradient2D(H1, Hcurl)[source]#

Bases: FemLinearOperator

Gradient operator in 2D.

Parameters:
H12D TensorFemSpace

Domain of gradient operator.

Hcurl2D VectorFemSpace

Codomain of gradient operator.

class Gradient3D(H1, Hcurl)[source]#

Bases: FemLinearOperator

Gradient operator in 3D.

Parameters:
H13D TensorFemSpace

Domain of gradient operator.

Hcurl3D VectorFemSpace

Codomain of gradient operator.

class ScalarCurl2D(Hcurl, L2)[source]#

Bases: FemLinearOperator

Scalar curl operator in 2D: computes a scalar field from a vector field.

Parameters:
Hcurl2D VectorFemSpace

Domain of 2D scalar curl operator.

L22D TensorFemSpace

Codomain of 2D scalar curl operator.

class VectorCurl2D(H1, Hdiv)[source]#

Bases: FemLinearOperator

Vector curl operator in 2D: computes a vector field from a scalar field. This is sometimes called the ‘rot’ operator.

Parameters:
H12D TensorFemSpace

Domain of 2D vector curl operator.

Hdiv2D VectorFemSpace

Codomain of 2D vector curl operator.

class Curl3D(Hcurl, Hdiv)[source]#

Bases: FemLinearOperator

Curl operator in 3D.

Parameters:
Hcurl3D VectorFemSpace

Domain of 3D curl operator.

Hdiv3D VectorFemSpace

Codomain of 3D curl operator.

class Divergence2D(Hdiv, L2)[source]#

Bases: FemLinearOperator

Divergence operator in 2D.

Parameters:
Hdiv2D VectorFemSpace

Domain of divergence operator.

L22D TensorFemSpace

Codomain of divergence operator.

class Divergence3D(Hdiv, L2)[source]#

Bases: FemLinearOperator

Divergence operator in 3D.

Parameters:
Hdiv3D VectorFemSpace

Domain of divergence operator.

L23D TensorFemSpace

Codomain of divergence operator.

class BrokenGradient2D(V0h, V1h)[source]#

Bases: FemLinearOperator

Gradient operator in a 2D multipatch domain, acting independently on each patch. In general, the resulting field is therefore discontinuous, or “broken”.

Parameters:
V0hMultipatchFemSpace

Domain of the gradient operator.

V1hMultipatchFemSpace

Codomain of the gradient operator.

transpose(conjugate=False)[source]#
class BrokenTransposedGradient2D(V0h, V1h)[source]#

Bases: FemLinearOperator

Transposed gradient operator in a 2D multipatch domain, acting independently on each patch. In general, the resulting field is therefore discontinuous, or “broken”.

Parameters:
V0hMultipatchFemSpace

Codomain of the transposed gradient operator.

V1hMultipatchFemSpace

Domain of the transposed gradient operator.

transpose(conjugate=False)[source]#
class BrokenScalarCurl2D(V1h, V2h)[source]#

Bases: FemLinearOperator

Scalar curl operator in a 2D multipatch domain, acting independently on each patch. In general, the resulting field is therefore discontinuous, or “broken”.

Parameters:
V1hMultipatchFemSpace

Domain of the scalar curl operator.

V2hMultipatchFemSpace

Codomain of the scalar curl operator.

transpose(conjugate=False)[source]#
class BrokenTransposedScalarCurl2D(V1h, V2h)[source]#

Bases: FemLinearOperator

Transposed scalar curl operator in a 2D multipatch domain, acting independently on each patch. In general, the resulting field is therefore discontinuous, or “broken”.

Parameters:
V1hMultipatchFemSpace

Codomain of the transposed scalar curl operator.

V2hMultipatchFemSpace

Domain of the transposed scalar curl operator.

transpose(conjugate=False)[source]#