@@ -4,7 +4,7 @@ use rlst::{Array, MutableArrayImpl, RlstScalar, ValueArrayImpl};
44use std:: fmt:: Debug ;
55use std:: hash:: Hash ;
66
7- /// This trait provides the definition of a finite element.
7+ /// A finite element.
88pub trait FiniteElement {
99 /// The scalar type
1010 type T : RlstScalar ;
@@ -14,21 +14,9 @@ pub trait FiniteElement {
1414 /// The cell type is typically defined through [ReferenceCellType](crate::types::ReferenceCellType).
1515 type CellType : Debug + PartialEq + Eq + Clone + Copy + Hash ;
1616
17- /// Transformation type
18- ///
19- /// The Transformation type specifies possible transformations of the dofs on the reference element.
20- /// In most cases these will be rotations and reflections as defined in [Transformation](crate::types::Transformation).
21- type TransformationType : Debug + PartialEq + Eq + Clone + Copy + Hash ;
22-
2317 /// The reference cell type, eg one of `Point`, `Interval`, `Triangle`, etc.
2418 fn cell_type ( & self ) -> Self :: CellType ;
2519
26- /// The smallest degree Lagrange space that contains all possible polynomials of the finite element's polynomial space.
27- ///
28- /// Details on the definition of the degree of Lagrange spaces of finite elements are
29- /// given [here](https://defelement.org/ciarlet.html#The+degree+of+a+finite+element).
30- fn lagrange_superdegree ( & self ) -> usize ;
31-
3220 /// The number of basis functions.
3321 fn dim ( & self ) -> usize ;
3422
@@ -75,6 +63,9 @@ pub trait FiniteElement {
7563 data : & mut Array < Array4MutImpl , 4 > ,
7664 ) ;
7765
66+ /// Get the required shape for a tabulation array.
67+ fn tabulate_array_shape ( & self , nderivs : usize , npoints : usize ) -> [ usize ; 4 ] ;
68+
7869 /// Return the dof indices that are associated with the subentity with index `entity_number` and dimension `entity_dim`.
7970 ///
8071 /// - For `entity_dim = 0` this returns the degrees of freedom (dofs) associated with the corresponding point.
@@ -92,9 +83,21 @@ pub trait FiniteElement {
9283 /// associated with the boundary of an entity. For an edge (for example) it returns the dofs associated
9384 /// with the vertices at the boundary of the edge (as well as the dofs associated with the edge itself).
9485 fn entity_closure_dofs ( & self , entity_dim : usize , entity_number : usize ) -> Option < & [ usize ] > ;
86+ }
9587
96- /// Get the required shape for a tabulation array.
97- fn tabulate_array_shape ( & self , nderivs : usize , npoints : usize ) -> [ usize ; 4 ] ;
88+ /// A finite element that is mapped from a reference cell.
89+ pub trait MappedFiniteElement : FiniteElement {
90+ /// Transformation type
91+ ///
92+ /// The Transformation type specifies possible transformations of the dofs on the reference element.
93+ /// In most cases these will be rotations and reflections as defined in [Transformation](crate::types::Transformation).
94+ type TransformationType : Debug + PartialEq + Eq + Clone + Copy + Hash ;
95+
96+ /// The smallest degree Lagrange space that contains all possible polynomials of the finite element's polynomial space.
97+ ///
98+ /// Details on the definition of the degree of Lagrange spaces of finite elements are
99+ /// given [here](https://defelement.org/ciarlet.html#The+degree+of+a+finite+element).
100+ fn lagrange_superdegree ( & self ) -> usize ;
98101
99102 /// Push function values forward to a physical cell.
100103 ///
@@ -117,7 +120,7 @@ pub trait FiniteElement {
117120 /// is the topological dimension, and the third dimension is the geometric dimension. If the Jacobian is rectangular then the
118121 /// inverse Jacobian is the pseudo-inverse of the Jacobian, ie the matrix $J^\dagger$ such that $J^\dagger J = I$.
119122 /// - `physical_values`: The output array of the push operation. This shape of this array is the same as the `reference_values`
120- /// input, with the [FiniteElement ::physical_value_size] used instead of the reference value size.
123+ /// input, with the [MappedFiniteElement ::physical_value_size] used instead of the reference value size.
121124 fn push_forward <
122125 Array3RealImpl : ValueArrayImpl < <Self :: T as RlstScalar >:: Real , 3 > ,
123126 Array4Impl : ValueArrayImpl < Self :: T , 4 > ,
@@ -134,7 +137,7 @@ pub trait FiniteElement {
134137
135138 /// Pull function values back to the reference cell.
136139 ///
137- /// This is the inverse operation to [FiniteElement ::push_forward].
140+ /// This is the inverse operation to [MappedFiniteElement ::push_forward].
138141 fn pull_back <
139142 Array3RealImpl : ValueArrayImpl < <Self :: T as RlstScalar >:: Real , 3 > ,
140143 Array4Impl : ValueArrayImpl < Self :: T , 4 > ,
0 commit comments