symfem.basix_interface ====================== .. py:module:: symfem.basix_interface .. autoapi-nested-parse:: Interface to Basix. Attributes ---------- .. autoapisummary:: symfem.basix_interface.sobolev_spaces symfem.basix_interface.map_types Functions --------- .. autoapisummary:: symfem.basix_interface.get_embedded_degrees symfem.basix_interface._create_custom_element_args symfem.basix_interface.create_basix_element symfem.basix_interface._to_python_string symfem.basix_interface._to_cpp_string symfem.basix_interface.generate_basix_element_code Module Contents --------------- .. py:data:: sobolev_spaces .. py:data:: map_types .. py:function:: get_embedded_degrees(poly, reference) -> tuple[int, int] Get embedded degrees of a set of polynomials. :param poly: Polynomials :param reference: Reference cell Returns: Embedded sub- and superdegrees .. py:function:: _create_custom_element_args(element: symfem.finite_element.FiniteElement, dtype: numpy.typing.DTypeLike = np.float64) -> tuple[list[Any], dict[str, Any]] Generate the arguments to create a Basix custom element. :param element: The Symfem element :param dtype: The dtype of the Basix element :returns: A list of args and a dict of kwargs .. py:function:: create_basix_element(element: symfem.finite_element.FiniteElement, dtype: numpy.typing.DTypeLike = np.float64, ufl: bool = False) -> basix.finite_element.FiniteElement | basix.ufl._ElementBase Create a Basix element from a Symfem element. :param element: The Symfem element :param dtype: The dtype of the Basix element :param ufl: If generating Python, a basix.ufl element will be created if this is set to True :returns: A Basix element .. py:function:: _to_python_string(item: Any, in_array: bool = False) -> str .. py:function:: _to_cpp_string(item: Any, in_array: bool = False) -> tuple[list[str], str] .. py:function:: generate_basix_element_code(element: symfem.finite_element.FiniteElement, language: str = 'python', dtype: numpy.typing.DTypeLike | str = np.float64, variable_name: str = 'e', *, ufl: bool | None = None, include_imports: bool = True, include_comment: bool = True) -> str Generate code to create a Basix custom element. :param element: The Symfem element :param language: Programming language to generate ("python" or "c++") :param dtype: The dtype of the Basix element :param variable_name: The variable name to use for the element in the code :param ufl: If generating Python, a basix.ufl element will be created if this is set to True :param include_imports: Should imports be included in the generated code? :param include_comment: Should comment saying what is being created be included in the generated code? :returns: A Basix element