Intrepid
Intrepid basis class

## Degree of freedom ordinals and tags

Regardless of the basis type, i.e., FEM or FVD, each DoF is assigned an ordinal number which specifies its numerical position in the DoF set, and a 4-field DoF tag whose first 3 fields establish association between the DoF and a subcell of particular dimension. The last field in the DoF tag is for convenience and stores the total number of DoFs associated with the specified subcell. In summary, the tag contains the following information about a DoF with a given ordinal:

• field 0: dimension of the subcell associated with the specified DoF ordinal;
• field 1: ordinal of the subcell relative to its parent cell;
• field 2: ordinal of the DoF relative to the subcell;
• field 3: cardinality of the DoF set associated with this subcell.

DoF definition, DoF ordinals and DoF tags are basis-dependent and are documemented in the concrete basis implementation. A typical entry in a DoF tag table has the following format:

``` |-------------------------------------------------------------------------------------------------|
|         |           degree-of-freedom-tag table                    |                            |
|   DoF   |----------------------------------------------------------|      DoF definition        |
| ordinal |  subc dim    | subc ordinal | subc DoF ord |subc num DoF |                            |
|-------------------------------------------------------------------------------------------------|
|---------|--------------|--------------|--------------|-------------|----------------------------|
|    k    |       1      |       2      |       1      |      3      |   L_k(u) = (definition)    |
|---------|--------------|--------------|--------------|-------------|----------------------------|
|-------------------------------------------------------------------------------------------------|
```

The tag in this example establishes an association between the DoF with ordinal k and the 3rd edge of the parent cell on which the basis is defined. Furthermore, the tag specifies that relative to that edge, this DoF has ordinal 1, i.e., it is the second DoF on that edge. The last field in the tag indicates that there are a total of 3 DoFs associated with that subcell.

## MD array template arguments for basis methods

FEM and FVD basis evaluation methods use generic MD arrays (see Multi-dimensional array (MD array) template arguments for details) to pass the evaluation points (and cell vertices for FVD evaluation) and to return the basis values. The ranks and the dimensions of the MD array arguments for these methods are as follows.

### Rank and dimensions of the output MD array

Rank and dimensions of the output array depend on the field rank of the basis functions, which can be 0 (scalar fields), 1 (vector fields), or 2 (tensor fields), the space dimension, and the operatorType. The following table summarizes all admissible combinations:

``` |-------------------------------------------------------------------------------------------------|
|            Rank and multi-dimensions of the output MD array in getValues methods                |
|--------------------|-------------------------|-------------------------|------------------------|
|operator/field rank |  rank 0                 |  rank 1 2D/3D           |  rank 2 2D/3D          |
|--------------------|-------------------------|-------------------------|------------------------|
|       VALUE        |  (F,P)                  | (F,P,D)                 | (F,P,D,D)              |
|--------------------|-------------------------|-------------------------|------------------------|
|     GRAD, D1       |  (F,P,D)                | (F,P,D,D)               | (F,P,D,D,D)            |
|--------------------|-------------------------|-------------------------|------------------------|
|        CURL        |  (F,P,D) (undef. in 3D) | (F,P)/(F,P,D)           | (F,P,D)/(F,P,D,D)      |
|--------------------|-------------------------|-------------------------|------------------------|
|        DIV         |  (F,P,D) (only in 1D)   | (F,P)                   | (F,P,D)                |
|--------------------|-------------------------|-------------------------|------------------------|
|    D1,D2,..,D10    |  (F,P,K)                | (F,P,D,K)               | (F,P,D,D,K)            |
|-------------------------------------------------------------------------------------------------|
```
Remarks:
• The totality of all derivatives whose order equals k (OPERATOR_Dk in Intrepid) forms a multiset; see http://mathworld.wolfram.com/Multiset.html In Intrepid this multiset is enumerated using the lexicographical order of the partial derivatives; see getDkEnumeration() for details.
• The last dimension of the output array for D1,...,D10 is the cardinality of the Dk multiset (computed by DkCardinality). The array is filled with zeroes whenever the order of the derivative Dk exceeed the polynomial degree.

### Rank and dimensions of the input MD arrays

The FEM evaluation method has one MD array input argument which is used to pass the coordinates of P evaluation points in the reference cell for which the concrete basis is defined. The FVD method has two MD array input arguments. The first one passes the coordinates of P evaluation points in the physical cell for which the concrete basis is defined. The second MD array passes the vertices of the physical cell. Ranks and dimensions of these arrays are summarized in the following table:

``` |-------------------------------------------------------------------------------------------------|
|             Rank and multi-dimensions of the input MD arrays in getValues methods               |
|--------------------|------------------------|---------------------------------------------------|
| MD array           | rank | multi-dimension |  Description                                      |
|--------------------|------------------------|---------------------------------------------------|
| evaluation points  |   2  |  (P,D)          |  Coordinates of P points in D-dimensions          |
|--------------------|------------------------|---------------------------------------------------|
| cell vertices      |   2  |  (V,D)          |  Coordinates of V vertices of D-dimensional cell  |
|-------------------------------------------------------------------------------------------------|
```