Initialize SuperLU_DIST solver for a linear variational problem. Args: a: Bilinear UFL form, the left-hand side of the variational problem. L: Linear UFL form, the right-hand side of the variational problem. bcs: Dirichlet bo
(
self,
a: ufl.Form,
L: ufl.Form,
bcs: Sequence[DirichletBC] | None = None,
u: Function | None = None,
dtype: npt.DTypeLike = default_scalar_type,
superlu_dist_options: dict | None = None,
form_compiler_options: dict | None = None,
jit_options: dict | None = None,
entity_maps: Sequence[EntityMap] | None = None,
)
| 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: |
| 95 | _dtype = u.dtype |
| 96 | if dtype is not u.dtype: |
| 97 | raise ValueError(f"dtype ({dtype}) does not match u.dtype ({u.dtype}).") |
| 98 | else: |
| 99 | _dtype = dtype |
| 100 | |
| 101 | self._a = typing.cast( |
| 102 | Form, |
| 103 | form( |
| 104 | a, |
| 105 | _dtype, |
nothing calls this directly
no test coverage detected