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

Method __init__

python/dolfinx/fem/function.py:717–740  ·  view source on GitHub ↗

Create a finite element function space. Note: This initialiser is for internal use and not normally called in user code. Use :func:`functionspace` to create a function space. Args: mesh: Mesh that space is defined on. elem

(
        self,
        mesh: Mesh[Real],
        element: ufl.finiteelement.AbstractFiniteElement,
        cppV: (_cpp.fem.FunctionSpace_float32 | _cpp.fem.FunctionSpace_float64),
    )

Source from the content-addressed store, hash-verified

715 _mesh: Mesh[Real]
716
717 def __init__(
718 self,
719 mesh: Mesh[Real],
720 element: ufl.finiteelement.AbstractFiniteElement,
721 cppV: (_cpp.fem.FunctionSpace_float32 | _cpp.fem.FunctionSpace_float64),
722 ):
723 """Create a finite element function space.
724
725 Note:
726 This initialiser is for internal use and not normally called
727 in user code. Use :func:`functionspace` to create a function
728 space.
729
730 Args:
731 mesh: Mesh that space is defined on.
732 element: UFL finite element.
733 cppV: Compiled C++ function space.
734 """
735 if mesh._cpp_object is not cppV.mesh:
736 raise RuntimeError("Meshes do not match in function space initialisation.")
737 ufl_domain = mesh.ufl_domain()
738 self._cpp_object = cppV
739 self._mesh = mesh
740 super().__init__(ufl_domain, element)
741
742 def clone(self) -> FunctionSpace[Real]:
743 """Create a FunctionSpace which shares data with this space.

Callers

nothing calls this directly

Calls 2

ufl_domainMethod · 0.80
__init__Method · 0.45

Tested by

no test coverage detected