Hello,
I am using NGSolve to solve Maxwell’s equations in time-harmonic form. I created a finite element space as:
fes = HCurl(mesh, order=1, type1=True, dirichlet=“outer”),
fes.SetOrder(TRIG,2)
fes.SetOrder(TET,3)
fes.Update()
Can I define HCurl space with just face degrees of freedom of order 2, HCurl space with just cell degrees of freedom of order 3, or HCurl space with both face degrees of freedom of order 2 and cell degrees of freedom of order 3?
I am grateful for any help
Hi Elsakori,
you will always have the lowest order degrees of freedom at the edges.
With your example you create an HCurl space with face degrees of freedom of order 2 and cell degrees of freedom of order 3 + the lowest order edge degrees of freedom.
Attached you’ll find a minimal example creating different kind of HCurl spaces and the number of degrees of freedom.
If you really want to neglect the lowest order edge dofs you need to work with BitArrays, or set them as unused_dofs.
Best
Michael
Attachment: hcurl_space_setorder.py
Hello Michael,
Thank you for your response and clarification.
As you mentioned in the last line, I want to neglect the lowest order edge dofs. I want HCurl space just with face degrees of freedom of order 2 and cell degrees of freedom of order 3. Can you explain more about setting them as “unused_dofs” in my case?, I couldn’t find more information about “unused_dofs” in the website.
Thanks,
Ahmed
Hi Elsakori,
I managed to “neglect” the lowest order dofs by using bitarrays and setting them as UNUSED_DOF.
It is important that the lowest order dofs are saved before all other dofs.
Attached you find both approaches
https://ngsolve.org/media/kunena/attachments/889/hcurl_no_lo_dofs.py
https://ngsolve.org/media/kunena/attachments/889/hcurl_no_lo_dofs.py.
Best
Michael
Attachment: hcurl_no_lo_dofs.py
Hi Michael,
Thank you so much.
It is much clear now, I will try using these approaches in my code.
Thanks,
Ahmed