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!

Methods

getEdgeInnerProduct(self[, prop, invProp, …]) Generate the edge inner product matrix
getEdgeInnerProductDeriv(self, prop[, …])
param prop:material property (tensor properties are possible) at each cell center (nC, (1, 3, or 6))
getFaceInnerProduct(self[, prop, invProp, …]) Generate the face inner product matrix
getFaceInnerProductDeriv(self, prop[, …])
param prop:material property (tensor properties are possible) at each cell center (nC, (1, 3, or 6))

Attributes

Methods

InnerProducts.getEdgeInnerProduct(self, 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(self, 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(self, 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(self, 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