MCPcopy Create free account
hub / github.com/FEniCS/dolfinx / LinearProblem

Class LinearProblem

python/dolfinx/fem/problems.py:37–215  ·  view source on GitHub ↗

r"""High-level class for solving linear problems using SuperLU_DIST. Solves problems of the form :math:`a(u, v) = L(v) \; \forall v \in V` using :class:`dolfinx.la.superlu_dist.SuperLUDistSolver` as the linear solver. Note: DOLFINx must be built with SuperLU_DIST to use thi

Source from the content-addressed store, hash-verified

35
36
37class LinearProblem:
38 r"""High-level class for solving linear problems using SuperLU_DIST.
39
40 Solves problems of the form :math:`a(u, v) = L(v) \; \forall v \in V`
41 using :class:`dolfinx.la.superlu_dist.SuperLUDistSolver` as the
42 linear solver.
43
44 Note:
45 DOLFINx must be built with SuperLU_DIST to use this class.
46 """
47
48 def __init__(
49 self,
50 a: ufl.Form,
51 L: ufl.Form,
52 bcs: Sequence[DirichletBC] | None = None,
53 u: Function | None = None,
54 dtype: npt.DTypeLike = default_scalar_type,
55 superlu_dist_options: dict | None = None,
56 form_compiler_options: dict | None = None,
57 jit_options: dict | None = None,
58 entity_maps: Sequence[EntityMap] | None = None,
59 ) -> None:
60 """Initialize SuperLU_DIST solver for a linear variational problem.
61
62 Args:
63 a: Bilinear UFL form, the left-hand side of the variational
64 problem.
65 L: Linear UFL form, the right-hand side of the variational
66 problem.
67 bcs: Dirichlet boundary conditions to apply to the variational
68 problem.
69 u: Solution function. Created if not provided.
70 dtype: Scalar type for form compilation. Must match
71 ``u.dtype`` if ``u`` is provided.
72 superlu_dist_options: Options passed to the SuperLU_DIST
73 solver. See the SuperLU_DIST User's Guide for
74 available options and values.
75 form_compiler_options: Options used in FFCx compilation of
76 all forms. Run ``ffcx --help`` at the command line to see
77 all available options.
78 jit_options: Options used in CFFI JIT compilation of C code
79 generated by FFCx. See :func:`dolfinx.jit.ffcx_jit` for
80 all available options. Takes priority over all other
81 option values.
82 entity_maps: If any trial functions, test functions, or
83 coefficients in the form are not defined over the same mesh
84 as the integration domain, a corresponding
85 :class:`EntityMap <dolfinx.mesh.EntityMap>` must be
86 provided.
87
88 Example::
89
90 problem = LinearProblem(a, L, bcs=bc,
91 superlu_dist_options={"SymmetricMode": "YES"})
92 u_h = problem.solve()
93 """
94 if u is not None:

Callers 2

test_superlu_problemFunction · 0.90

Calls

no outgoing calls

Tested by 2

test_superlu_problemFunction · 0.72