Forum Message

 

 

We have moved the forum to https://forum.ngsolve.org . This is an archived version of the topics until 05/05/23. All the topics were moved to the new forum and conversations can be continued there. This forum is just kept as legacy to not invalidate old links. If you want to continue a conversation just look for the topic in the new forum.

Notice

The forum is in read only mode.

Compare VectorFacetFESpace, TangentialFacetFESpace and more

More
3 years 11 months ago #2722 by dong
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.
Code:
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.
Code:
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.
Code:
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.
Code:
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.
More
3 years 11 months ago #2723 by joachim
A VectorFacetFESpace is the copy of 2 in 2D or 3 in 3D FacetFESpaces.

When you declare trialfunctions in your case 3 you write
Code:
ut, ufx, ufy, p = V.TrialFunction()

while in case 4 you get one vector-valued facet field:
Code:
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,
Code:
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.
More
3 years 11 months ago #2724 by dong
Thank you so much for your clarification.
Time to create page: 0.104 seconds