Example #1
0
 def test01(self):
     """ Check diagonal content of M """
     md = get_diagonal(self.M)
     bi = Function(self.V)
     for index, ii in enumerate(md):
         b = bi.vector().copy()
         b[index] = 1.0
         Mb = (self.M*b).inner(b)
         self.assertTrue(abs(ii - Mb)/abs(Mb) < 1e-16)
Example #2
0
 def test11(self):
     """ Check diagonal content of K """
     kd = get_diagonal(self.K)
     bi = Function(self.V)
     for index, ii in enumerate(kd):
         b = bi.vector().copy()
         b[index] = 1.0
         Kb = (self.K*b).inner(b)
         self.assertTrue(abs(ii - Kb)/abs(Kb) < 1e-16)
Example #3
0
 def test11(self):
     """ Check diagonal content of K """
     kd = get_diagonal(self.K)
     bi = Function(self.V)
     for index, ii in enumerate(kd):
         b = bi.vector().copy()
         b[index] = 1.0
         Kb = (self.K * b).inner(b)
         self.assertTrue(abs(ii - Kb) / abs(Kb) < 1e-16)
Example #4
0
 def test01(self):
     """ Check diagonal content of M """
     md = get_diagonal(self.M)
     bi = Function(self.V)
     for index, ii in enumerate(md):
         b = bi.vector().copy()
         b[index] = 1.0
         Mb = (self.M * b).inner(b)
         self.assertTrue(abs(ii - Mb) / abs(Mb) < 1e-16)
Example #5
0
 def _assemble_invMw(self):
     """ Assemble inverse of matrix Mw,
     weighted mass matrix in dual space """
     # WARNING: only works if Mw is diagonal (e.g, DG0)
     Mw = assemble(self.massw)
     Mwd = get_diagonal(Mw)
     as_backend_type(self.invMwd).vec().pointwiseDivide(\
         as_backend_type(self.one).vec(),\
         as_backend_type(Mwd).vec())
     self.invMwMat.set_diagonal(self.invMwd)
Example #6
0
 def test10(self):
     """ Get diagonal of K """
     kd = get_diagonal(self.K)
Example #7
0
 def test00(self):
     """ Get diagonal of M """
     md = get_diagonal(self.M)
Example #8
0
 def test10(self):
     """ Get diagonal of K """
     kd = get_diagonal(self.K)
Example #9
0
 def test00(self):
     """ Get diagonal of M """
     md = get_diagonal(self.M)