A finite element form.
| 35 | |
| 36 | |
| 37 | class Form(typing.Generic[Scalar]): |
| 38 | """A finite element form.""" |
| 39 | |
| 40 | _cpp_object: ( |
| 41 | _cpp.fem.Form_complex64 |
| 42 | | _cpp.fem.Form_complex128 |
| 43 | | _cpp.fem.Form_float32 |
| 44 | | _cpp.fem.Form_float64 |
| 45 | ) |
| 46 | _code: str | list[str] | None |
| 47 | |
| 48 | def __init__( |
| 49 | self, |
| 50 | form: _cpp.fem.Form_complex64 |
| 51 | | _cpp.fem.Form_complex128 |
| 52 | | _cpp.fem.Form_float32 |
| 53 | | _cpp.fem.Form_float64, |
| 54 | ufcx_form=None, |
| 55 | code: str | list[str] | None = None, |
| 56 | module: types.ModuleType | list[types.ModuleType] | None = None, |
| 57 | ): |
| 58 | """Initialize a finite element form. |
| 59 | |
| 60 | Note: |
| 61 | Forms should normally be constructed using :func:`form` and |
| 62 | not using this class initialiser. This class is combined |
| 63 | with different base classes that depend on the scalar type |
| 64 | used in the Form. |
| 65 | |
| 66 | Args: |
| 67 | form: Compiled form object. |
| 68 | ufcx_form: UFCx form. |
| 69 | code: Form C++ code. |
| 70 | module: CFFI module. |
| 71 | """ |
| 72 | self._code = code |
| 73 | self._ufcx_form = ufcx_form |
| 74 | self._cpp_object = form |
| 75 | self._module = module |
| 76 | |
| 77 | @property |
| 78 | def ufcx_form(self): |
| 79 | """The compiled ufcx_form object.""" |
| 80 | return self._ufcx_form |
| 81 | |
| 82 | @property |
| 83 | def code(self) -> str | list[str] | None: |
| 84 | """C code strings.""" |
| 85 | return self._code |
| 86 | |
| 87 | @property |
| 88 | def module(self) -> types.ModuleType | list[types.ModuleType] | None: |
| 89 | """The CFFI module.""" |
| 90 | return self._module |
| 91 | |
| 92 | @property |
| 93 | def rank(self) -> int: |
| 94 | """Rank of this form.""" |
no outgoing calls