Coverage for /usr/share/miniconda3/envs/dolfin/lib/python3.8/site-packages/block/algebraic/petsc/__init__.py: 80%

18 statements  

« prev     ^ index     » next       coverage.py v7.2.1, created at 2023-03-20 13:03 +0000

1from builtins import object 

2def _init(): 

3 import block.algebraic 

4 class active_backend(object): 

5 name = 'petsc' 

6 def __call__(self): 

7 import sys 

8 return sys.modules[self.__module__] 

9 if block.algebraic.active_backend and block.algebraic.active_backend.name != 'petsc': 9 ↛ 10line 9 didn't jump to line 10, because the condition on line 9 was never true

10 raise ImportError('another backend is already active') 

11 block.algebraic.active_backend = active_backend() 

12 

13 import dolfin 

14 dolfin.parameters["linear_algebra_backend"] = "PETSc" 

15 import petsc4py, sys 

16 petsc4py.init(sys.argv) 

17_init() 

18 

19from .precond import * 

20from .matrix import *