hp HDG in deal.II

135 views
Skip to first unread message

sml.i...@gmail.com

unread,
Nov 16, 2016, 5:15:37 AM11/16/16
to deal.II User Group
Hello all

I am attempting to implement a hp hybridized dg-method for solving ellipctic problems in deal.II. I am relying on steps 27 and 51 of the deal.II tutorial programs. However, when I try to group some FE_FaceQ elements in an hp::FeCollection and distribute the degrees of freedom, I get an ExcNotImplemented() exception thrown by some method hp_vertex_dof_identities. Am I getting something wrong? Or is this feature just not implemented for
FaceQ yet?
I have attached the error message and a minimal example that reproduces the error.

Thanks,
Samuel
output.txt
faceq_error.cc

Daniel Arndt

unread,
Nov 16, 2016, 9:41:59 AM11/16/16
to deal.II User Group
Samuel,


I am attempting to implement a hp hybridized dg-method for solving ellipctic problems in deal.II. I am relying on steps 27 and 51 of the deal.II tutorial programs. However, when I try to group some FE_FaceQ elements in an hp::FeCollection and distribute the degrees of freedom, I get an ExcNotImplemented() exception thrown by some method hp_vertex_dof_identities. Am I getting something wrong? Or is this feature just not implemented for
FaceQ yet?
This feature is just not implemented yet. As FE_FaceQ is in fact discontinuous, you can try to just copy
hp_vertex_dof_identities, hp_line_dof_identities and hp_quad_dof_identities from source/fe/fe_dgq.cc to source/fe/fe_faceq.cc.
If you are successful with this, we would gladly accept a patch.  :-)

Best,
Daniel

sml.i...@gmail.com

unread,
Jun 26, 2017, 9:12:12 AM6/26/17
to deal.II User Group
Hi Daniel

Thanks for your answer, your approach actually worked quite well. (How would I go about submitting a patch? I have absolutely no experience with these things)

Now I have another question. I am trying to compute the L2 error over all the faces. For simplicity, I tested this starting from the tutorial step-51. I added another VectorTools::integrate_difference statement to the postprocess routine, with arguments dof_handler and solution (these correspond to the solution on the faces). However, this gives me an exception saying that some number is not finite (see error log in attachment). Is it even possible to compute errors on faces (and not cells) using VectorTools::integrate_difference? Or is there some other way to do it?

Best,
Samuel
error.log
step-51.cc

Daniel Arndt

unread,
Jun 26, 2017, 6:30:13 PM6/26/17
to deal.II User Group
Samuel,


Thanks for your answer, your approach actually worked quite well.
Thanks!
 
(How would I go about submitting a patch? I have absolutely no experience with these things)
Have a look the FAQ [1]. If you have problems doing this, we happily help.
 
Now I have another question. I am trying to compute the L2 error over all the faces. For simplicity, I tested this starting from the tutorial step-51. I added another VectorTools::integrate_difference statement to the postprocess routine, with arguments dof_handler and solution (these correspond to the solution on the faces). However, this gives me an exception saying that some number is not finite (see error log in attachment). Is it even possible to compute errors on faces (and not cells) using VectorTools::integrate_difference? Or is there some other way to do it?
Well, from the documentation [2] the relevant part is "Compute the cellwise error of the finite element solution [...]". Indeed, VectorTools::integrate_difference doesn't consider face integrals. However, you can just write such a function with not too much effort if you already use face loops in your cod:
Basically, just evaluate your reference function on the respective face in the quadrature points using Function::[vector_]value/gradient[_list] depending on the number of components your solution has and the norm you are interested in. Then, you compute the respective values for your solution using FEValues::get_function_values/gradients, compute the squared difference (for L^2 or H^1), multiply with FEValues::JxW and add everything up.
 
Best,
Daniel

Wolfgang Bangerth

unread,
Jun 28, 2017, 6:08:12 AM6/28/17
to dea...@googlegroups.com
On 06/26/2017 07:12 AM, sml.i...@gmail.com wrote:
>
> Thanks for your answer, your approach actually worked quite well. (How would I
> go about submitting a patch? I have absolutely no experience with these things)

In addition to the link Daniel already shared, here's also a video that shows
how this is done in practice -- take a look at lecture 32.8:
http://www.math.colostate.edu/~bangerth/videos.html
If you don't quite know how git works, check out lecture 32.75.

We really do appreciate everyone's contributions. It would be great if you
could submit a patch for what you have, and we'll be very happy to walk you
through the process!

Cheers
Wolfgang

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/

Jean-Paul Pelteret

unread,
Jun 28, 2017, 6:21:02 AM6/28/17
to deal.II User Group, bang...@colostate.edu
I've updated the Wiki entry to point to the video lecture as well.

sml.i...@gmail.com

unread,
Jul 6, 2017, 8:56:38 AM7/6/17
to deal.II User Group, bang...@colostate.edu
Hello all

Thanks a lot for your replies. I managed to submit a pull request (the video lecture was quite helpful). I hope I did it right, otherwise I'm happy for feedback.

I will try to implement the error computation using Daniels suggestions.

Now a follow-up question regarding development with git: How do I keep my own fork up to date with the deal.ii master branch? Since I forked it last Tuesday I am now several commits behind.
I found this in the official github help. Is this the way to do it?

Best,
Samuel

On Wednesday, June 28, 2017 at 12:08:12 PM UTC+2, Wolfgang Bangerth wrote:

Jean-Paul Pelteret

unread,
Jul 6, 2017, 9:15:45 AM7/6/17
to dea...@googlegroups.com, bang...@colostate.edu
Dear Samuel,

1. Track deal.II's remote master branch
git remote add dealii git@github.com:dealii/dealii.git

2. Fetch the up-to-date master from the deal.II remote
git fetch dealii

3. Merge or rebase as necessary:
git merge dealii/master
or
git rebase master

In all likelihood "rebasing" is the best way to go here. This means that your patches are applied on top of those already in deal.II's master branch, and will make getting them committed to the main branch much easier when you finally open a pull request. If there are any conflicts then you'll need to resolve them using "git mergetool". 

I hope that this helps!
J-P

sml.i...@gmail.com

unread,
Aug 4, 2017, 8:02:26 AM8/4/17
to deal.II User Group
Daniel,


Now I have another question. I am trying to compute the L2 error over all the faces. For simplicity, I tested this starting from the tutorial step-51. I added another VectorTools::integrate_difference statement to the postprocess routine, with arguments dof_handler and solution (these correspond to the solution on the faces). However, this gives me an exception saying that some number is not finite (see error log in attachment). Is it even possible to compute errors on faces (and not cells) using VectorTools::integrate_difference? Or is there some other way to do it?
Well, from the documentation [2] the relevant part is "Compute the cellwise error of the finite element solution [...]". Indeed, VectorTools::integrate_difference doesn't consider face integrals. However, you can just write such a function with not too much effort if you already use face loops in your cod:
Basically, just evaluate your reference function on the respective face in the quadrature points using Function::[vector_]value/gradient[_list] depending on the number of components your solution has and the norm you are interested in. Then, you compute the respective values for your solution using FEValues::get_function_values/gradients, compute the squared difference (for L^2 or H^1), multiply with FEValues::JxW and add everything up.

I managed to implement the error computation, in the way you indicated above. Thanks for the hint :-)

Best,
Samuel
Reply all
Reply to author
Forward
0 new messages