discretize.InnerProducts.InnerProducts

class discretize.InnerProducts.InnerProducts[source]

Bases: object

This is a base for the discretize mesh classes. This mixIn creates the all the inner product matrices that you need!

Attributes

Methods

InnerProducts.getEdgeInnerProduct(prop=None, invProp=False, invMat=False, doFast=True)[source]

Generate the edge inner product matrix

Parameters:
  • prop (numpy.ndarray) – material property (tensor properties are possible) at each cell center (nC, (1, 3, or 6))
  • invProp (bool) – inverts the material property
  • invMat (bool) – inverts the matrix
  • doFast (bool) – do a faster implementation if available.
Returns:

M, the inner product matrix (nE, nE)

Return type:

scipy.sparse.csr_matrix

InnerProducts.getEdgeInnerProductDeriv(prop, doFast=True, invProp=False, invMat=False)[source]
Parameters:
  • prop (numpy.ndarray) – material property (tensor properties are possible) at each cell center (nC, (1, 3, or 6))
  • doFast (bool) – do a faster implementation if available.
  • invProp (bool) – inverts the material property
  • invMat (bool) – inverts the matrix
Returns:

dMdm, the derivative of the inner product matrix (nE, nC*nA)

Return type:

scipy.sparse.csr_matrix

InnerProducts.getFaceInnerProduct(prop=None, invProp=False, invMat=False, doFast=True)[source]

Generate the face inner product matrix

Parameters:
  • prop (numpy.ndarray) – material property (tensor properties are possible) at each cell center (nC, (1, 3, or 6))
  • invProp (bool) – inverts the material property
  • invMat (bool) – inverts the matrix
  • doFast (bool) – do a faster implementation if available.
Returns:

M, the inner product matrix (nF, nF)

Return type:

scipy.sparse.csr_matrix

InnerProducts.getFaceInnerProductDeriv(prop, doFast=True, invProp=False, invMat=False)[source]
Parameters:
  • prop (numpy.ndarray) – material property (tensor properties are possible) at each cell center (nC, (1, 3, or 6))
  • doFast – bool do a faster implementation if available.
  • invProp (bool) – inverts the material property
  • invMat (bool) – inverts the matrix
Returns:

dMdmu(u), the derivative of the inner product matrix for a certain u

Return type:

scipy.sparse.csr_matrix