

def solve(self, A=None, b=None, iterative_solver=None, **kwargs):
    '\n        Executes the right algorithm for the solution: regular solution of a\n        linear system or iterative solution over the nonlinear source terms.\n\n        Parameters\n        ----------\n        A : sparse matrix\n            2D Coefficient matrix\n        b : dense matrix\n            1D RHS vector\n        iterative_sovler : string\n            Name of solver to use.  If not solve is specified, sp.solve is used\n            which is a direct solver (SuperLU on default Scipy installation)\n        kwargs : list of keyword arguments\n            These arguments and values are sent to the sparse solver, so read\n            the specific documentation for the solver chosen\n        '
    self._iterative_solver = iterative_solver
    if any((('pore.source_nonlinear' in s) for s in self.props())):
        X = self._do_one_outer_iteration(**kwargs)
    else:
        X = self._do_one_inner_iteration(A, b, **kwargs)
    self.X = X
    self._Neumann_super_X = self.X[self.Np:self._coeff_dimension]
    self[self._quantity] = self.X[self.Ps]
    logger.info(((((('Writing the results to ' + "['") + self._quantity) + "'] in the ") + self.name) + ' algorithm.'))

dataset/ETHPy150Open PMEAL/OpenPNM/OpenPNM/Algorithms/__GenericLinearTransport__.py GenericLinearTransport.solve/original