diff --git a/SimPEG/Mesh/InnerProducts.py b/SimPEG/Mesh/InnerProducts.py index 28befd6e..87d106d2 100644 --- a/SimPEG/Mesh/InnerProducts.py +++ b/SimPEG/Mesh/InnerProducts.py @@ -5,183 +5,51 @@ import numpy as np class InnerProducts(object): """ - Class creates the inner product matrices that you need! - - InnerProducts is a base class providing inner product matrices for meshes and cannot run on its own. Inherit to your favorite Mesh class. - - - **Example problem for DC resistivity** - - .. math:: - - \sigma^{-1}\mathbf{J} = \\nabla \phi - - We can define in weak form by integrating with a general face function F: - - .. math:: - - \int_{\\text{cell}}{\sigma^{-1}\mathbf{J} \cdot \mathbf{F}} = \int_{\\text{cell}}{\\nabla \phi \cdot \mathbf{F}} - - \int_{\\text{cell}}{\sigma^{-1}\mathbf{J} \cdot \mathbf{F}} = \int_{\\text{cell}}{(\\nabla \cdot \mathbf{F}) \phi } + \int_{\partial \\text{cell}}{ \phi \mathbf{F} \cdot \mathbf{n}} - - We can then discretize for every cell: - - .. math:: - - v_{\\text{cell}} \sigma^{-1} (\mathbf{J}_x \mathbf{F}_x +\mathbf{J}_y \mathbf{F}_y + \mathbf{J}_z \mathbf{F}_z ) = -\phi^{\\top} v_{\\text{cell}} (\mathbf{D}_{\\text{cell}} \mathbf{F}) + \\text{BC} - - We can represent this in vector form (again this is for every cell), and will generalize for the case of anisotropic (tensor) sigma. - - .. math:: - - \mathbf{F}_c^{\\top} (\sqrt{v_{\\text{cell}}} \Sigma^{-1} \sqrt{v_{\\text{cell}}}) \mathbf{J}_c = -\phi^{\\top} v_{\\text{cell}}( v_\\text{cell}^{-1} \mathbf{D}_{\\text{cell}} \mathbf{A} \mathbf{F}) + \\text{BC} - - We multiply by volume on each side of the tensor conductivity to keep symmetry in the system. Here J_c is the Cartesian J (on the faces) and must be calculated differently depending on the mesh: - - .. math:: - \mathbf{J}_c = \mathbf{Q}_{(i)}\mathbf{J}_\\text{TENSOR} = \mathbf{N}_{(i)}^{-1}\mathbf{Q}_{(i)}\mathbf{J}_\\text{LOM} - - Here the i index refers to where we choose to approximate this integral. - We will approximate this relation at every node of the cell, there are 8 in 3D, using a projection matrix Q_i to pick the appropriate fluxes. - We will then average to the cell center. For the TENSOR mesh, this looks like: - - .. math:: - - \mathbf{F}^{\\top} - {1\over 8} - \left(\sum_{i=1}^8 - \mathbf{Q}_{(i)}^{-\\top} \sqrt{v_{\\text{cell}}} \Sigma^{-1} \sqrt{v_{\\text{cell}}} \mathbf{Q}_{(i)} - \\right) - \mathbf{J} - = - -\mathbf{F}^{\\top} \mathbf{A} \mathbf{D}_{\\text{cell}}^{\\top} \phi + \\text{BC} - - \mathbf{M}(\Sigma^{-1}) \mathbf{J} - = - -\mathbf{A} \mathbf{D}_{\\text{cell}}^{\\top} \phi + \\text{BC} - - \mathbf{M}(\Sigma^{-1}) = {1\over 8} - \left(\sum_{i=1}^8 - \mathbf{Q}_{(i)}^{-\\top} \sqrt{v_{\\text{cell}}} \Sigma^{-1} \sqrt{v_{\\text{cell}}} \mathbf{Q}_{(i)} - \\right) - - The M is returned if mu is set equal to \Sigma^{-1}. - - If requested (returnP=True) the projection matricies are returned as well (ordered by nodes). - Here each P (3*nC, sum(nF)) is a combination of the projection, volume, and any normalization to Cartesian coordinates: - - .. math:: - \mathbf{P}_{(i)} = \sqrt{ {1\over 8} v_{\\text{cell}}} \overbrace{\mathbf{N}_{(i)}^{-1}}^{\\text{LOM only}} \mathbf{Q}_{(i)} - - Note that this is completed for each cell in the mesh at the same time. + This is a base for the SimPEG.Mesh classes. This mixIn creates the all the inner product matrices that you need! """ def __init__(self): raise Exception('InnerProducts is a base class providing inner product matrices for meshes and cannot run on its own. Inherit to your favorite Mesh class.') - def getFaceInnerProduct(M, mu=None, returnP=False): + def getFaceInnerProduct(self, materialProperty=None, returnP=False): """ - :param numpy.array mu: material property (tensor properties are possible) at each cell center (nC, (1, 3, or 6)) + :param numpy.array materialProperty: material property (tensor properties are possible) at each cell center (nC, (1, 3, or 6)) :param bool returnP: returns the projection matrices :rtype: scipy.csr_matrix - :return: M, the inner product matrix (sum(nF), sum(nF)) - - Depending on the number of columns (either 1, 3, or 6) of mu, the material property is interpreted as follows: - - .. math:: - \\vec{\mu} = \left[\\begin{matrix} \mu_{1} & 0 & 0 \\\\ 0 & \mu_{1} & 0 \\\\ 0 & 0 & \mu_{1} \end{matrix}\\right] - - \\vec{\mu} = \left[\\begin{matrix} \mu_{1} & 0 & 0 \\\\ 0 & \mu_{2} & 0 \\\\ 0 & 0 & \mu_{3} \end{matrix}\\right] - - \\vec{\mu} = \left[\\begin{matrix} \mu_{1} & \mu_{4} & \mu_{5} \\\\ \mu_{4} & \mu_{2} & \mu_{6} \\\\ \mu_{5} & \mu_{6} & \mu_{3} \end{matrix}\\right] - - \mathbf{M}(\\vec{\mu}) = {1\over 8} - \left(\sum_{i=1}^8 - \mathbf{J}_c^{-\\top} \sqrt{v_{\\text{cell}}} \\vec{\mu} \sqrt{v_{\\text{cell}}} \mathbf{J}_c - \\right) - - If requested (returnP=True) the projection matricies are returned as well (ordered by nodes):: - - P = [P000, P100, P010, P110, P001, P101, P011, P111] - - Here each P (3*nC, sum(nF)) is a combination of the projection, volume, and any normalization to Cartesian coordinates: - - .. math:: - \mathbf{P}_{(i)} = \sqrt{ {1\over 8} v_{\\text{cell}}} \overbrace{\mathbf{N}_{(i)}^{-1}}^{\\text{LOM only}} \mathbf{Q}_{(i)} - - Note that this is completed for each cell in the mesh at the same time. - - **For 2D:** - - Depending on the number of columns (either 1, 2, or 3) of mu, the material property is interpreted as follows: - - .. math:: - \\vec{\mu} = \left[\\begin{matrix} \mu_{1} & 0 \\\\ 0 & \mu_{1} \end{matrix}\\right] - - \\vec{\mu} = \left[\\begin{matrix} \mu_{1} & 0 \\\\ 0 & \mu_{2} \end{matrix}\\right] - - \\vec{\mu} = \left[\\begin{matrix} \mu_{1} & \mu_{3} \\\\ \mu_{3} & \mu_{2} \end{matrix}\\right] - - - .. math:: - - \mathbf{M}(\\vec{\mu}) = {1\over 4} - \left(\sum_{i=1}^4 - \mathbf{J}_c^{-\\top} \sqrt{v_{\\text{cell}}} \\vec{\mu} \sqrt{v_{\\text{cell}}} \mathbf{J}_c - \\right) - - - If requested (returnP=True) the projection matricies are returned as well (ordered by nodes):: - - P = [P00, P10, P01, P11] - - Here each P (2*nC, sum(nF)) is a combination of the projection, volume, and any normalization to Cartesian coordinates: - - .. math:: - \mathbf{P}_{(i)} = \sqrt{ {1\over 4} v_{\\text{cell}}} \overbrace{\mathbf{N}_{(i)}^{-1}}^{\\text{LOM only}} \mathbf{Q}_{(i)} - - Note that this is completed for each cell in the mesh at the same time. - + :return: M, the inner product matrix (nF, nF) """ - if M.dim == 1: - v = np.sqrt(0.5*M.vol) - V1 = sdiag(v) # We will multiply on each side to keep symmetry + d = self.dim + # We will multiply by sqrt on each side to keep symmetry + V = sp.kron(sp.identity(d), sdiag(np.sqrt((2**(-d))*self.vol))) - Px = _getFacePx(M) - P000 = V1*Px('fXm') - P100 = V1*Px('fXp') - elif M.dim == 2: - # Square root of cell volume multiplied by 1/4 - v = np.sqrt(0.25*M.vol) - V2 = sdiag(np.r_[v, v]) # We will multiply on each side to keep symmetry + if d == 1: + Px = _getFacePx(self) + P000 = V*Px('fXm') + P100 = V*Px('fXp') + elif d == 2: + Pxx = _getFacePxx(self) + P000 = V*Pxx('fXm', 'fYm') + P100 = V*Pxx('fXp', 'fYm') + P010 = V*Pxx('fXm', 'fYp') + P110 = V*Pxx('fXp', 'fYp') + elif d == 3: + Pxxx = _getFacePxxx(self) + P000 = V*Pxxx('fXm', 'fYm', 'fZm') + P100 = V*Pxxx('fXp', 'fYm', 'fZm') + P010 = V*Pxxx('fXm', 'fYp', 'fZm') + P110 = V*Pxxx('fXp', 'fYp', 'fZm') + P001 = V*Pxxx('fXm', 'fYm', 'fZp') + P101 = V*Pxxx('fXp', 'fYm', 'fZp') + P011 = V*Pxxx('fXm', 'fYp', 'fZp') + P111 = V*Pxxx('fXp', 'fYp', 'fZp') - Pxx = _getFacePxx(M) - P000 = V2*Pxx('fXm', 'fYm') - P100 = V2*Pxx('fXp', 'fYm') - P010 = V2*Pxx('fXm', 'fYp') - P110 = V2*Pxx('fXp', 'fYp') - elif M.dim == 3: - # Square root of cell volume multiplied by 1/8 - v = np.sqrt(0.125*M.vol) - V3 = sdiag(np.r_[v, v, v]) # We will multiply on each side to keep symmetry - - Pxxx = _getFacePxxx(M) - P000 = V3*Pxxx('fXm', 'fYm', 'fZm') - P100 = V3*Pxxx('fXp', 'fYm', 'fZm') - P010 = V3*Pxxx('fXm', 'fYp', 'fZm') - P110 = V3*Pxxx('fXp', 'fYp', 'fZm') - P001 = V3*Pxxx('fXm', 'fYm', 'fZp') - P101 = V3*Pxxx('fXp', 'fYm', 'fZp') - P011 = V3*Pxxx('fXm', 'fYp', 'fZp') - P111 = V3*Pxxx('fXp', 'fYp', 'fZp') - - Mu = makePropertyTensor(M, mu) + Mu = makePropertyTensor(self, materialProperty) A = P000.T*Mu*P000 + P100.T*Mu*P100 P = [P000, P100] - if M.dim > 1: + if d > 1: A = A + P010.T*Mu*P010 + P110.T*Mu*P110 P += [P010, P110] - if M.dim > 2: + if d > 2: A = A + P001.T*Mu*P001 + P101.T*Mu*P101 + P011.T*Mu*P011 + P111.T*Mu*P111 P += [P001, P101, P011, P111] if returnP: @@ -189,91 +57,28 @@ class InnerProducts(object): else: return A - def getEdgeInnerProduct(M, sigma=None, returnP=False): + def getEdgeInnerProduct(self, materialProperty=None, returnP=False): """ - :param numpy.array sigma: material property (tensor properties are possible) at each cell center (nC, (1, 3, or 6)) + :param numpy.array materialProperty: material property (tensor properties are possible) at each cell center (nC, (1, 3, or 6)) :param bool returnP: returns the projection matrices :rtype: scipy.csr_matrix - :return: M, the inner product matrix (sum(nE), sum(nE)) - - - Depending on the number of columns (either 1, 3, or 6) of sigma, the material property is interpreted as follows: - - .. math:: - \Sigma = \left[\\begin{matrix} \sigma_{1} & 0 & 0 \\\\ 0 & \sigma_{1} & 0 \\\\ 0 & 0 & \sigma_{1} \end{matrix}\\right] - - \Sigma = \left[\\begin{matrix} \sigma_{1} & 0 & 0 \\\\ 0 & \sigma_{2} & 0 \\\\ 0 & 0 & \sigma_{3} \end{matrix}\\right] - - \Sigma = \left[\\begin{matrix} \sigma_{1} & \sigma_{4} & \sigma_{5} \\\\ \sigma_{4} & \sigma_{2} & \sigma_{6} \\\\ \sigma_{5} & \sigma_{6} & \sigma_{3} \end{matrix}\\right] - - What is returned: - - .. math:: - \mathbf{M}(\Sigma) = {1\over 8} - \left(\sum_{i=1}^8 - \mathbf{J}_c^{-\\top} \sqrt{v_{\\text{cell}}} \Sigma \sqrt{v_{\\text{cell}}} \mathbf{J}_c - \\right) - - If requested (returnP=True) the projection matricies are returned as well (ordered by nodes):: - - P = [P000, P100, P010, P110, P001, P101, P011, P111] - - Here each P (3*nC, sum(nE)) is a combination of the projection, volume, and any normalization to Cartesian coordinates: - - .. math:: - \mathbf{P}_{(i)} = \sqrt{ {1\over 8} v_{\\text{cell}}} \overbrace{\mathbf{N}_{(i)}^{-1}}^{\\text{LOM only}} \mathbf{Q}_{(i)} - - Note that this is completed for each cell in the mesh at the same time. - - **For 2D:** - - Depending on the number of columns (either 1, 2, or 3) of sigma, the material property is interpreted as follows: - - .. math:: - \Sigma = \left[\\begin{matrix} \sigma_{1} & 0 \\\\ 0 & \sigma_{1} \end{matrix}\\right] - - \Sigma = \left[\\begin{matrix} \sigma_{1} & 0 \\\\ 0 & \sigma_{2} \end{matrix}\\right] - - \Sigma = \left[\\begin{matrix} \sigma_{1} & \sigma_{3} \\\\ \sigma_{3} & \sigma_{2} \end{matrix}\\right] - - - .. math:: - - \mathbf{M}(\Sigma) = {1\over 4} - \left(\sum_{i=1}^4 - \mathbf{J}_c^{-\\top} \sqrt{v_{\\text{cell}}} \Sigma \sqrt{v_{\\text{cell}}} \mathbf{J}_c - \\right) - - - If requested (returnP=True) the projection matricies are returned as well (ordered by nodes):: - - P = [P00, P10, P01, P11] - - Here each P (2*nC, sum(nE)) is a combination of the projection, volume, and any normalization to Cartesian coordinates: - - .. math:: - \mathbf{P}_{(i)} = \sqrt{ {1\over 4} v_{\\text{cell}}} \overbrace{\mathbf{N}_{(i)}^{-1}}^{\\text{LOM only}} \mathbf{Q}_{(i)} - - Note that this is completed for each cell in the mesh at the same time. - + :return: M, the inner product matrix (nE, nE) """ - if M.dim == 1: + d = self.dim + # We will multiply by sqrt on each side to keep symmetry + V = sp.kron(sp.identity(d), sdiag(np.sqrt((2**(-d))*self.vol))) + + if d == 1: raise NotImplementedError('getEdgeInnerProduct not implemented for 1D') # We will multiply by V on each side to keep symmetry - elif M.dim == 2: - # Square root of cell volume multiplied by 1/4 - v = np.sqrt(0.25*M.vol) - V = sdiag(np.r_[v, v]) - eP = _getEdgePxx(M) + elif d == 2: + eP = _getEdgePxx(self) P000 = V*eP('eX0', 'eY0') P100 = V*eP('eX0', 'eY1') P010 = V*eP('eX1', 'eY0') P110 = V*eP('eX1', 'eY1') - elif M.dim == 3: - # Square root of cell volume multiplied by 1/8 - v = np.sqrt(0.125*M.vol) - V = sdiag(np.r_[v, v, v]) - eP = _getEdgePxxx(M) + elif d == 3: + eP = _getEdgePxxx(self) P000 = V*eP('eX0', 'eY0', 'eZ0') P100 = V*eP('eX0', 'eY1', 'eZ1') P010 = V*eP('eX1', 'eY0', 'eZ2') @@ -283,11 +88,11 @@ class InnerProducts(object): P011 = V*eP('eX3', 'eY2', 'eZ2') P111 = V*eP('eX3', 'eY3', 'eZ3') - Sigma = makePropertyTensor(M, sigma) - A = P000.T*Sigma*P000 + P100.T*Sigma*P100 + P010.T*Sigma*P010 + P110.T*Sigma*P110 + Mu = makePropertyTensor(self, materialProperty) + A = P000.T*Mu*P000 + P100.T*Mu*P100 + P010.T*Mu*P010 + P110.T*Mu*P110 P = [P000, P100, P010, P110] - if M.dim == 3: - A = A + P001.T*Sigma*P001 + P101.T*Sigma*P101 + P011.T*Sigma*P011 + P111.T*Sigma*P111 + if d == 3: + A = A + P001.T*Mu*P001 + P101.T*Mu*P101 + P011.T*Mu*P011 + P111.T*Mu*P111 P += [P001, P101, P011, P111] if returnP: return A, P @@ -381,11 +186,11 @@ def _getFacePxx_Rectangular(M): 0 1 f2(Ym) - Pxx('m','m') = | 1, 0, 0, 0 | - | 0, 0, 1, 0 | + Pxx('fXm','fYm') = | 1, 0, 0, 0 | + | 0, 0, 1, 0 | - Pxx('p','m') = | 0, 1, 0, 0 | - | 0, 0, 1, 0 | + Pxx('fXp','fYm') = | 0, 1, 0, 0 | + | 0, 0, 1, 0 | """ i, j = np.int64(range(M.nCx)), np.int64(range(M.nCy)) diff --git a/docs/api_InnerProducts.rst b/docs/api_InnerProducts.rst new file mode 100644 index 00000000..0909f086 --- /dev/null +++ b/docs/api_InnerProducts.rst @@ -0,0 +1,164 @@ +.. _api_InnerProducts: + + +Inner Products +************** + +By using the weak formulation of many of the PDEs in geophysical applications, we can rapidly develop discretizations. Much of this work, however, needs a good understanding of how to approximate inner products on our discretized meshes. We will define the inner product as: + +.. math:: + + \left(a,b\right) = \int_\Omega{a \cdot b}{\partial v} + +where a and b are either scalars or vectors. + +.. note:: + + The InnerProducts class is a base class providing inner product matrices for meshes and cannot run on its own. + + +Example problem for DC resistivity +---------------------------------- +We will start with the formulation of the Direct Current (DC) resistivity problem in geophysics. + + +.. math:: + + \frac{1}{\sigma}\vec{j} = \nabla \phi \\ + + \nabla\cdot \vec{j} = q + +In the following discretization, \\\( \\sigma \\\) and \\\( \\phi \\\) +will be discretized on the cell-centers and the flux, \\\(\\vec{j}\\\), +will be on the faces. We will use the weak formulation to discretize +the DC resistivity equation. + +We can define in weak form by integrating with a general face function \\\(\\vec{f}\\\): + +.. math:: + + \int_{\Omega}{\sigma^{-1}\vec{j} \cdot \vec{f}} = \int_{\Omega}{\nabla \phi \cdot \vec{f}} + +Here we can integrate the right side by parts, + +.. math:: + + \nabla\cdot(\phi\vec{f})=\nabla\phi\cdot\vec{f} + \phi\nabla\cdot\vec{f} + +and rearrange it, and apply the Divergence theorem. + +.. math:: + + \int_{\Omega}{\sigma^{-1}\vec{j} \cdot \vec{f}} = + - \int_{\Omega}{(\phi \nabla \cdot \vec{f})} + + \int_{\partial \Omega}{ \phi \vec{f} \cdot \mathbf{n}} + +We can then discretize for every cell: + +.. math:: + + v_{\text{cell}} \sigma^{-1} (\mathbf{J}_x \mathbf{F}_x +\mathbf{J}_y \mathbf{F}_y + \mathbf{J}_z \mathbf{F}_z ) = -\phi^{\top} v_{\text{cell}} (\mathbf{D}_{\text{cell}} \mathbf{F}) + \text{BC} + +.. note:: + + We have discretized the dot product above, but remember that we do not really have a single vector \\\(\\mathbf{J}\\\), but approximations of \\\(\\vec{j}\\\) on each face of our cell. In 2D that means 2 approximations of \\\(\\mathbf{J}_x\\\) and 2 approximations of \\\(\\mathbf{J}_y\\\). In 3D we also have 2 approximations of \\\(\\mathbf{J}_z\\\). + +Regardless of how we choose to approximate this dot product, we can represent this in vector form (again this is for every cell), and will generalize for the case of anisotropic (tensor) sigma. + +.. math:: + + \mathbf{F}_c^{\top} (\sqrt{v_{\text{cell}}} \Sigma^{-1} \sqrt{v_{\text{cell}}}) \mathbf{J}_c = -\phi^{\top} v_{\text{cell}}( v_\text{cell}^{-1} \mathbf{D}_{\text{cell}} \mathbf{A} \mathbf{F}) + \text{BC} + +We multiply by square-root of volume on each side of the tensor conductivity to keep symmetry in the system. Here \\\(\\mathbf{J}_c\\\) is the Cartesian \\\(\\mathbf{J}\\\) (on the faces that we choose to use in our approximation) and must be calculated differently depending on the mesh: + +.. math:: + \mathbf{J}_c = \mathbf{Q}_{(i)}\mathbf{J}_\text{TENSOR} \\ + \mathbf{J}_c = \mathbf{N}_{(i)}^{-1}\mathbf{Q}_{(i)}\mathbf{J}_\text{LRM} + +Here the \\\(i\\\) index refers to where we choose to approximate this integral, as discussed in the note above. +We will approximate this integral by taking the fluxes clustered around every node of the cell, there are 8 combinations in 3D, and 4 in 2D. We will use a projection matrix \\\( \\mathbf{Q}_{(i)} \\\) to pick the appropriate fluxes. So, now that we have 8 approximations of this integral, we will just take the average. For the TensorMesh, this looks like: + +.. math:: + + \mathbf{F}^{\top} + {1\over 8} + \left(\sum_{i=1}^8 + \mathbf{Q}_{(i)}^{\top} \sqrt{v_{\text{cell}}} \Sigma^{-1} \sqrt{v_{\text{cell}}} \mathbf{Q}_{(i)} + \right) + \mathbf{J} + = + -\mathbf{F}^{\top} \mathbf{A} \mathbf{D}_{\text{cell}}^{\top} \phi + \text{BC} + +Or, when generalizing to the entire mesh and dropping our general face function: + +.. math:: + + \mathbf{M}^f_{\Sigma^{-1}} \mathbf{J} + = + -\mathbf{A} \mathbf{D}^{\top} \phi + \text{BC} + +By defining the faceInnerProduct in 3D (8 combinations of fluxes) to be: + +.. math:: + + \mathbf{M}^f_{\Sigma^{-1}} = {1\over 8} + \left(\sum_{i=1}^8 + \mathbf{P}_{(i)}^{\top} \Sigma^{-1} \mathbf{P}_{(i)} + \right) + +The M is returned when given the input of \\\( \\Sigma^{-1} \\\). + +Here each \\( \\mathbf{P} \\in \\mathbb{R}^{(d*nC, nF)} \\\) is a combination of the projection, volume, and any normalization to Cartesian coordinates (where the dot product is well defined): + +.. math:: + + \mathbf{P}_{(i)} = \sqrt{ \frac{1}{2^d} \mathbf{I}^d \otimes \text{diag}(\mathbf{v})} \overbrace{\mathbf{N}_{(i)}^{-1}}^{\text{LRM only}} \mathbf{Q}_{(i)} + +Where \\\(d\\\) is the dimension of the mesh. + +.. note:: + + This is actually completed for each cell in the mesh at the same time, and the full matrices are returned. + +If ``returnP=True`` is requested in any of these methods the projection matrices are returned as a list ordered by nodes around which the fluxes were approximated:: + + # In 3D + P = [P000, P100, P010, P110, P001, P101, P011, P111] + # In 2D + P = [P00, P10, P01, P11] + +The derivation for ``edgeInnerProducts`` is exactly the same, however, when we approximate the integral using the fields around each node, the projection matrices look a bit different because we have 12 edges in 3D instead of just 6 faces. The interface to the code is exactly the same. + +Defining Tensor Properties +-------------------------- + +**For 3D:** + +Depending on the number of columns (either 1, 3, or 6) of mu, the material property is interpreted as follows: + +.. math:: + + \vec{\mu} = \left[\begin{matrix} \mu_{1} & 0 & 0 \\ 0 & \mu_{1} & 0 \\ 0 & 0 & \mu_{1} \end{matrix}\right] + + \vec{\mu} = \left[\begin{matrix} \mu_{1} & 0 & 0 \\ 0 & \mu_{2} & 0 \\ 0 & 0 & \mu_{3} \end{matrix}\right] + + \vec{\mu} = \left[\begin{matrix} \mu_{1} & \mu_{4} & \mu_{5} \\ \mu_{4} & \mu_{2} & \mu_{6} \\ \mu_{5} & \mu_{6} & \mu_{3} \end{matrix}\right] + +**For 2D:** + + Depending on the number of columns (either 1, 2, or 3) of mu, the material property is interpreted as follows: + +.. math:: + \vec{\mu} = \left[\begin{matrix} \mu_{1} & 0 \\ 0 & \mu_{1} \end{matrix}\right] + + \vec{\mu} = \left[\begin{matrix} \mu_{1} & 0 \\ 0 & \mu_{2} \end{matrix}\right] + + \vec{\mu} = \left[\begin{matrix} \mu_{1} & \mu_{3} \\ \mu_{3} & \mu_{2} \end{matrix}\right] + + +The API +------- + +.. automodule:: SimPEG.Mesh.InnerProducts + :members: + :undoc-members: diff --git a/docs/api_Mesh.rst b/docs/api_Mesh.rst index a964b24d..df5f31d8 100644 --- a/docs/api_Mesh.rst +++ b/docs/api_Mesh.rst @@ -29,7 +29,6 @@ Logically Orthogonal Mesh :inherited-members: - Base Mesh ========= @@ -38,13 +37,6 @@ Base Mesh :undoc-members: -Inner Products -============== - -.. automodule:: SimPEG.Mesh.InnerProducts - :members: - :undoc-members: - Differential Operators ====================== diff --git a/docs/index.rst b/docs/index.rst index 84e0f925..6a282e36 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -30,6 +30,7 @@ Meshing & Operators :maxdepth: 2 api_Mesh + api_InnerProducts Forward Problems ****************