From ffb78fea10e47191f62804365800037b1dbf0a82 Mon Sep 17 00:00:00 2001 From: ehaber99 Date: Fri, 19 Jul 2013 14:43:15 -0700 Subject: [PATCH] added mass matrix --- SimPEG/DiffOperators.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/SimPEG/DiffOperators.py b/SimPEG/DiffOperators.py index a755662f..0fb36c2b 100644 --- a/SimPEG/DiffOperators.py +++ b/SimPEG/DiffOperators.py @@ -161,3 +161,23 @@ class DiffOperators(object): return locals() _edgeAve = None edgeAve = property(**edgeAve()) + + + +def getEdgeMassMatrix(h,sigma): + # mass matix for products of edge functions w'*M(sigma)*e + + Av = getEdgeToCellAverge(h) + v = getVol(h) + sigma = mkvc(sigma) + + return sdiag(Av.T*(v*sigma)) + +def getFaceMassMatrix(h,sigma): + # mass matix for products of edge functions w'*M(sigma)*e + + Av = getFaceToCellAverge(h) + v = getVol(h) + sigma = mkvc(sigma) + + return sdiag(Av.T*(v*sigma)) \ No newline at end of file