:py:mod:`FELiCS.SpaceDisc.FEMSpaces` ==================================== .. py:module:: FELiCS.SpaceDisc.FEMSpaces Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: FELiCS.SpaceDisc.FEMSpaces.FEMSpaces Functions ~~~~~~~~~ .. autoapisummary:: FELiCS.SpaceDisc.FEMSpaces.getElementShape FELiCS.SpaceDisc.FEMSpaces.getElementType FELiCS.SpaceDisc.FEMSpaces.createFunctionSpace Attributes ~~~~~~~~~~ .. autoapisummary:: FELiCS.SpaceDisc.FEMSpaces.logger .. py:data:: logger .. py:function:: getElementShape(meshDim) Get the element shape (triangle or tetrahedron) based on mesh dimension. :param meshDim: Geometric dimension of the mesh (2 or 3). :type meshDim: :py:class:`int` :returns: 'triangle' for 2D, 'tetrahedron' for 3D. :rtype: :py:class:`str` :raises Exception: If meshDim is not 2 or 3. .. py:function:: getElementType() Get the default element type string for finite elements. :returns: The element type string ('CG' for continuous Galerkin). :rtype: :py:class:`str` .. py:function:: createFunctionSpace(mesh, degree=2, dim=1) Create a finite element function space for the given mesh, order, and dimension. For scalar fields (``dim == 1``), a standard Basix element is constructed via ``element(elementType, elementShape, degree)``. For vector fields, a tuple-based element description ``(elementType, degree, (dim,))`` is used to create a vector-valued function space. :param mesh: The mesh object containing ``dolfinxMesh``. :type mesh: :py:class:`FELiCSMesh` :param degree: Polynomial degree of the element (default is 2). :type degree: :py:class:`int`, *optional* :param dim: Number of components (default is 1 for scalar fields). :type dim: :py:class:`int`, *optional* :returns: The created function space. :rtype: :py:class:`dolfinx.fem.FunctionSpace` .. py:class:: FEMSpaces(param, mesh, degree=2) Class containing all Finite Element (FE) spaces used in the simulation. Organizes and initializes various FE spaces such as scalar, vector, mixed, and export function spaces based on the mesh and problem configuration. **Initialize the FEMSpaces object** :param param: Configuration object containing simulation parameters including Case, BoundaryCondition, Numerics, and Export settings. :type param: :py:class:`ParameterClass` :param mesh: Computational mesh object used to define the function spaces. :type mesh: :py:class:`FELiCSMesh` :param degree: Polynomial degree for the function spaces (default is 2). :type degree: :py:class:`int`, *optional* :ivar element_shape: Shape of the element (triangle or tetrahedron). :vartype element_shape: :py:class:`ufl.Cell` :ivar elementTypeStr: Type of finite element ('CG' for continuous Galerkin). :vartype elementTypeStr: :py:class:`str` :ivar _nVelocityComponents: Number of velocity components defined by the case. :vartype _nVelocityComponents: :py:class:`int` :ivar FunctionSpaceVectorVelocity: Velocity vector space on the main mesh. :vartype FunctionSpaceVectorVelocity: :py:class:`dolfinx.fem.FunctionSpace` :ivar FunctionSpaceVectorVelocityExport: Velocity vector space on the export mesh. :vartype FunctionSpaceVectorVelocityExport: :py:class:`dolfinx.fem.FunctionSpace` :ivar FunctionSpaceVectorVelocityP1: First-order vector space for velocity. :vartype FunctionSpaceVectorVelocityP1: :py:class:`dolfinx.fem.FunctionSpace` :ivar VMixed: Mixed finite element space for all variables. :vartype VMixed: :py:class:`dolfinx.fem.FunctionSpace` :ivar VMixedExport: Export version of the mixed space. :vartype VMixedExport: :py:class:`dolfinx.fem.FunctionSpace` :ivar P1, P2: First- and second-order scalar function spaces on the main mesh. :vartype P1, P2: :py:class:`dolfinx.fem.FunctionSpace` :ivar P1Export, P2Export: First- and second-order scalar function spaces on the export mesh. :vartype P1Export, P2Export: :py:class:`dolfinx.fem.FunctionSpace` :ivar mappingObj: Mapping object that links the function spaces to coordinate mappings. :vartype mappingObj: :py:class:`Mapping` .. py:method:: addCustomScalarSpaceToMixedSpace(mesh, order) Deprecated method for adding a scalar element to the mixed function space. .. admonition:: Notes This method no longer functions as originally intended: it does not modify ``self.MixedList`` and uses outdated API calls (``MixedElement`` and ``FunctionSpace``). It is kept only for legacy reference and is not used anywhere in the current codebase. It will be removed in future releases. :param mesh: Mesh on which the mixed function space would be defined. :type mesh: :py:class:`FELiCSMesh` :param order: Intended polynomial order of the added scalar element (unused). :type order: :py:class:`int`