Beispiel #1
0
 def assert_resnorm(self, lhs):
   res = self.residual.eval(arguments=dict(dofs=lhs))[numpy.isnan(self.cons)] if self.single \
     else numpy.concatenate([sparse.toarray(sparse.take(r, [numpy.isnan(self.cons[d])]) if d in self.cons else r)
       for d, r in zip(self.dofs, sample.eval_integrals_sparse(*self.residual, **lhs))])
   resnorm = numpy.linalg.norm(res)
   self.assertLess(resnorm, self.tol)
Beispiel #2
0
 def assert_resnorm(self, lhs):
   res, = sample.eval_integrals_sparse(self.residual, dofs=lhs)
   resnorm = numpy.linalg.norm(sparse.toarray(res)[~self.boolcons])
   self.assertLess(resnorm, self.tol)