Beispiel #1
0
def block_solve(block_A, block_x, block_b, linear_solver="default"):
    assert isinstance(block_A, GenericBlockMatrix)
    assert isinstance(block_x, GenericBlockVector)
    assert isinstance(block_b, GenericBlockVector)
    # Solve
    solver = PETScLUSolver(linear_solver)
    solver.solve(block_A, block_x, block_b)
    # Keep subfunctions up to date
    block_x.block_function().apply("to subfunctions")
Beispiel #2
0
 def solve(self):
     solver = PETScLUSolver(self._linear_solver)
     solver.solve(self.lhs, self.solution.vector(), self.rhs)
     if self.monitor is not None:
         self.monitor(self.solution)
Beispiel #3
0
 def solve(self):
     solver = PETScLUSolver(self._linear_solver)
     solver.solve(self.lhs, self.solution.vector(), self.rhs)
     return self.solution