- Thank you received: 0
dofs of FacetFESpace
- rhebergens
- Topic Author
- Offline
- Junior Member
Less
More
7 years 1 month ago #206
by rhebergens
dofs of FacetFESpace was created by rhebergens
Hello,
I'm running the following code:
For the FacetFESpace, for order 1, I expect 2 DOFs per edge, but it seems I'm getting slightly more. There are a total of 208 edges, and I get a total of 493 DOFs for the whole mesh (I expect 416). For order 2, I expect to 624 DOFs, but get 701. As I increase the order, I realised that the total number of DOFs I get for the FacetFESpace, for the given mesh, is: DOFs = (p+1)*nrEdges + 77. Could you explain to me where the 77 extra DOFs comes from?
Thanks,
Sander
I'm running the following code:
Code:
from ngsolve import *
from netgen.geom2d import SplineGeometry
geo = SplineGeometry()
geo.AddRectangle( (0.0, 0.0), (1.0, 1.0), bc=1 )
mesh = Mesh( geo.GenerateMesh(maxh=1.6))
mesh.Refine()
mesh.Refine()
mesh.Refine()
Q = FacetFESpace(mesh, order=1)
print("ndof qfe:", Q.ndof)
For the FacetFESpace, for order 1, I expect 2 DOFs per edge, but it seems I'm getting slightly more. There are a total of 208 edges, and I get a total of 493 DOFs for the whole mesh (I expect 416). For order 2, I expect to 624 DOFs, but get 701. As I increase the order, I realised that the total number of DOFs I get for the FacetFESpace, for the given mesh, is: DOFs = (p+1)*nrEdges + 77. Could you explain to me where the 77 extra DOFs comes from?
Thanks,
Sander
7 years 1 month ago #208
by schruste
Replied by schruste on topic dofs of FacetFESpace
Dear Sander,
This is related to facets from the former meshes that you refined from. To these older facets the low order dofs are still created. However, you may check the CouplingTypes to see that they are marked as unused as they actually never appear in the usual assembly (no non-zero couplings will be reserved for these dofs). If you don't like to have these 'virtual' facet dofs, you can save and reload the mesh which removes the refinement history and in turn also the virtual facets and hence the virtual dofs. You will get as many dofs as you expect.
Best,
Christoph
This is related to facets from the former meshes that you refined from. To these older facets the low order dofs are still created. However, you may check the CouplingTypes to see that they are marked as unused as they actually never appear in the usual assembly (no non-zero couplings will be reserved for these dofs). If you don't like to have these 'virtual' facet dofs, you can save and reload the mesh which removes the refinement history and in turn also the virtual facets and hence the virtual dofs. You will get as many dofs as you expect.
Best,
Christoph
- rhebergens
- Topic Author
- Offline
- Junior Member
Less
More
- Thank you received: 0
7 years 1 month ago #209
by rhebergens
Replied by rhebergens on topic dofs of FacetFESpace
Thanks for the explanation!
Sander
Sander
Time to create page: 0.099 seconds