discretize.DiffOperators.DiffOperators

class discretize.DiffOperators.DiffOperators[source]

Bases: object

Class creates the differential operators that you need!

Attributes

DiffOperators.aveCC2F

Construct the averaging operator on cell centers to faces.

DiffOperators.aveCCV2F

Construct the averaging operator on cell centers to faces as a vector.

DiffOperators.aveE2CC

Construct the averaging operator on cell edges to cell centers.

DiffOperators.aveE2CCV

Construct the averaging operator on cell edges to cell centers.

DiffOperators.aveEx2CC

Construct the averaging operator on cell edges in the x direction to cell centers.

DiffOperators.aveEy2CC

Construct the averaging operator on cell edges in the y direction to cell centers.

DiffOperators.aveEz2CC

Construct the averaging operator on cell edges in the z direction to cell centers.

DiffOperators.aveF2CC

Construct the averaging operator on cell faces to cell centers.

DiffOperators.aveF2CCV

Construct the averaging operator on cell faces to cell centers.

DiffOperators.aveFx2CC

Construct the averaging operator on cell faces in the x direction to cell centers.

DiffOperators.aveFy2CC

Construct the averaging operator on cell faces in the y direction to cell centers.

DiffOperators.aveFz2CC

Construct the averaging operator on cell faces in the z direction to cell centers.

DiffOperators.aveN2CC

Construct the averaging operator on cell nodes to cell centers.

DiffOperators.aveN2E

Construct the averaging operator on cell nodes to cell edges, keeping each dimension separate.

DiffOperators.aveN2F

Construct the averaging operator on cell nodes to cell faces, keeping each dimension separate.

DiffOperators.cellGrad

The cell centered Gradient, takes you to cell faces.

DiffOperators.cellGradBC

The cell centered Gradient boundary condition matrix

DiffOperators.cellGradx

Cell centered Gradient in the x dimension. Has neumann boundary conditions.

DiffOperators.cellGrady
DiffOperators.cellGradz

Cell centered Gradient in the x dimension. Has neumann boundary conditions.

DiffOperators.edgeCurl

Construct the 3D curl operator.

DiffOperators.faceDiv

Construct divergence operator (face-stg to cell-centres).

DiffOperators.faceDivx

Construct divergence operator in the x component (face-stg to cell-centres).

DiffOperators.faceDivy
DiffOperators.faceDivz

Construct divergence operator in the z component (face-stg to cell-centers).

DiffOperators.nodalGrad

Construct gradient operator (nodes to edges).

DiffOperators.nodalLaplacian

Construct laplacian operator (nodes to edges).

Methods

DiffOperators.getBCProjWF(BC, discretization='CC')[source]

The weak form boundary condition projection matrices.

Example

# Neumann in all directions
BC = 'neumann'

# 3D, Dirichlet in y Neumann else
BC = ['neumann', 'dirichlet', 'neumann']

# 3D, Neumann in x on bottom of domain, Dirichlet else
BC = [['neumann', 'dirichlet'], 'dirichlet', 'dirichlet']
DiffOperators.getBCProjWF_simple(discretization='CC')[source]

The weak form boundary condition projection matrices when mixed boundary condition is used

DiffOperators.setCellGradBC(BC)[source]

Function that sets the boundary conditions for cell-centred derivative operators.

Example

..code:: python

# Neumann in all directions BC = ‘neumann’

# 3D, Dirichlet in y Neumann else BC = [‘neumann’, ‘dirichlet’, ‘neumann’]

# 3D, Neumann in x on bottom of domain, Dirichlet else BC = [[‘neumann’, ‘dirichlet’], ‘dirichlet’, ‘dirichlet’]