LocalSolver

class dolfin.fem.solving.LocalSolver(a, L=None, solver_type=0)

Bases: dolfin.cpp.fem.LocalSolver

Solve problems cell-wise. This class solves problems cell-wise. It computes the local left-hand side A_local which must be square locally but not globally. The right-hand side b_local is either computed locally for one cell or globally for all cells depending on which of the solve_local_rhs or solve_global_rhs methods which are called. You can optionally assemble the right-hand side vector yourself and use the solve_local method. You must then provide the DofMap of the right-hand side. The local solver solves A_local x_local = b_local. The result x_local is copied into the global vector x of the provided Function u. You can optionally call the factorize method to pre-calculate the local left-hand side factorizations to speed up repeated applications of the LocalSolver with the same LHS. The solve_xxx methods will factorise the LHS A_local matrices each time if they are not cached by a previous call to factorize. You can chose upon initialization whether you want Cholesky or LU (default) factorisations. For forms with no coupling across cell edges, this function is identical to a global solve. For problems with coupling across cells it is not. This class can be used for post-processing solutions, e.g. computing stress fields for visualisation, far more cheaply that using global projections.

Create a local (cell-wise) solver for a linear variational problem a(u, v) = L(v).