# Compare VectorFacetFESpace, TangentialFacetFESpace and more

I tried to understand the meaning of different syntax of different FE spaces that I thought they were the same. But I found they were different.
1.

```V1 = HDiv ( mesh, order = order, dirichlet = "wall|cyl|inlet" ) V2 = FESpace ( "vectorfacet", mesh, order = order, dirichlet = "wall|cyl|inlet" ) Q = L2( mesh, order = order-1) V = FESpace ([V1,V2,Q])```
2.

```V1 = HDiv ( mesh, order = order, dirichlet = "wall|cyl|inlet" ) V2=TangentialFacetFESpace (mesh, order = order, dirichlet ='wall|cyl|inlet' ) Q = L2( mesh, order = order-1) V = FESpace ([V1,V2,Q])```
3.

```V1 = HDiv ( mesh, order = order, dirichlet = "wall|cyl|inlet" ) Vhat = FacetFESpace(mesh, order = order, dirichlet= "wall|cyl|inlet" ) #V2=[Vhat, Vhat] Q = L2( mesh, order = order-1) V = FESpace ([V1,Vhat, Vhat,Q])```
4.

```V1 = HDiv ( mesh, order = order, dirichlet = "wall|cyl|inlet" ) V2=VectorFacetFESpace (mesh, order = order, dirichlet ='wall|cyl|inlet' ) Q = L2( mesh, order = order-1) V = FESpace ([V1,V2,Q])```

The first two cases gave the same results. The 3rd case had the error: NgException: UmfpackInverse: Numeric factorization failed. When running the last case, the error is ‘NgException: Matrix dimensions don’t fit: mat is 2 x 1, vec is 2’.

The problem is from 3.6. The code is attached.

Could you please explain what the difference among those space are and when I should use a specific one?
Thank you so much.

Attachment: FacetFEspace1.ipynb

A VectorFacetFESpace is the copy of 2 in 2D or 3 in 3D FacetFESpaces.

When you declare trialfunctions in your case 3 you write

``ut, ufx, ufy, p = V.TrialFunction()``

while in case 4 you get one vector-valued facet field:

``ut, uf, p = V.TrialFunction()``

Case 2, the TangentialFacetFESpace defines a vector field in the tangential plane to the edge/face. This is needed, e.g., for the H(div)-conforming DG, where the normal continuity of the velocity is already in the approximation space. (advanced info: since we use covariant mapping from the reference element, the tangential component of the field is single-valued on the facet. The normal component is in general not zero, and different on both elements).

Case 1,

``FESpace ( "vectorfacet",``

is deprecated. The original C+±side vectorfacet space is the space which we call now (since NGSolve1906) “TangentialVectorFESpace” from Python.

Up to NGSolve2004, the VectorFacetFESpace returns a dim x 1 matrix-valued trialfunction, instead of a dim - vector. I just fixed it, update to nightly, or do a reshape from the matrix to the vector.

Thank you so much for your clarification.