Custom shapeset questions

55 views
Skip to first unread message

Lukas Korous

unread,
Apr 18, 2017, 4:20:18 PM4/18/17
to deal.II User Group
Hello,

for solving the (ideal) MHD equations, I would like to implement two custom shapesets:

  • one for the flow part, completely discontinuous, scalar FE space, analogy to FE_DGQ, but based on Taylor expansion in the cell center
    • this should be the easy part, but I would like to ask how to go about it in deal.ii - I would like to implement at least linear and quadratic functions
  • one for the magnetic field, a vector Hdiv space, analogy to FE_RaviartThomas, but in this case a space of divergence-free functions that satisfy div F = 0 within the reference cell
    • this I assume will be more difficult, but here I am only after linear functions


Reasoning behind usage of these is in https://github.com/l-korous/mhdeal/blob/master/papers/Compumag2017_MHD.pdf, section IV.A (divergence free space), IV.B (Vertex-based limiting which needs the Taylor-basis FE space). Currently the code in https://github.com/l-korous/mhdeal/blob/master/code/ is failing for DG order > 0 because of undershoots and overshoots present in the unlimited flow solution, mag field works, but there is no divergence cleaning employed.


Could you please point me in the right direction where to start with this and what all needs to be done for these two new shapesets / spaces to be employed?


Many thanks

Wolfgang Bangerth

unread,
Apr 20, 2017, 11:27:33 PM4/20/17
to dea...@googlegroups.com

Lukas,

> for solving the (ideal) MHD equations, I would like to implement two custom
> shapesets:

By "shapeset" do you mean "set of shape functions"?


> * one for the flow part, completely discontinuous, scalar FE space, analogy
> to FE_DGQ, but based on Taylor expansion in the cell center
>
> o this should be the easy part, but I would like to ask how to go about
> it in deal.ii - I would like to implement at least linear and
> quadratic functions

Do you do the Taylor expansion in real space, or on the reference cell and
then map to real space?

If the former, I think you will want to look at the implementation of the
FE_DGP and FE_DGP_Monomial classes, of which at least one does something
similar IIRC.


> * one for the magnetic field, a vector Hdiv space, analogy to
> FE_RaviartThomas, but in this case a space of divergence-free functions
> that satisfy div F = 0 within the reference cell
> o this I assume will be more difficult, but here I am only after linear
> functions

Again: on the reference cell or in real space?

If you work in real space, then in 2d there are 2x3 basis functions for the
linear space (two vector components, each of which has the form a+bx+cy), of
which you can eliminate one because of the divergence constraint, if I count
correctly.

If you map from the reference cell, but require that div u = 0 pointwise in
real space, then things may be more complicated.

Best
Wolfgang

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

Praveen C

unread,
Apr 21, 2017, 12:14:26 AM4/21/17
to Deal.II Googlegroup
Hello Lukas

You may want to look up this thread


I started implementing Taylor basis as FE_DGT class some years back but did not complete it, see code here


FE_DGT is basically monomials, see

These shape functions are defined in physical space. They are not orthogonal.

In my implementation, I transform as

(x-xc)/h, (y-yc)/h     where h = cell diameter

You probably want to transform as

(x-xc)/dx, (y-yc)/dy

then calculate shape_value, subtract integral of shape_function also. Then all shape functions have zero integral and only first one has non-zero integral. This should be possible to implement for Cartesian grids. 


Best
praveen

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dealii+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Lukas Korous

unread,
Apr 21, 2017, 10:21:46 AM4/21/17
to dea...@googlegroups.com
Hello,


for solving the (ideal) MHD equations, I would like to implement two custom
shapesets:

By "shapeset" do you mean "set of shape functions"?

Exactly.
 


  * one for the flow part, completely discontinuous, scalar FE space, analogy
    to FE_DGQ, but based on Taylor expansion in the cell center

      o this should be the easy part, but I would like to ask how to go about
        it in deal.ii - I would like to implement at least linear and
        quadratic functions

Do you do the Taylor expansion in real space, or on the reference cell and then map to real space?

If the former, I think you will want to look at the implementation of the FE_DGP and FE_DGP_Monomial classes, of which at least one does something similar IIRC.

In real space, thank you, will look at that.
 


  * one for the magnetic field, a vector Hdiv space, analogy to
    FE_RaviartThomas, but in this case a space of divergence-free functions
    that satisfy div F = 0 within the reference cell
      o this I assume will be more difficult, but here I am only after linear
        functions

Again: on the reference cell or in real space?

If you work in real space, then in 2d there are 2x3 basis functions for the linear space (two vector components, each of which has the form a+bx+cy), of which you can eliminate one because of the divergence constraint, if I count correctly.

If you map from the reference cell, but require that div u = 0 pointwise in real space, then things may be more complicated.

Here I have no preference, whichever is an easier way to satisfy div u = 0 pointwise.

I will take a look at the implementation you mentioned, thanks.
 

Best
 Wolfgang

--
------------------------------------------------------------------------
Wolfgang Bangerth          email:                 bang...@colostate.edu
                           www: http://www.math.colostate.edu/~bangerth/
--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
--- You received this message because you are subscribed to a topic in the Google Groups "deal.II User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dealii/NDiUu3qESOM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dealii+unsubscribe@googlegroups.com.

Lukas Korous

unread,
Apr 21, 2017, 10:28:59 AM4/21/17
to dea...@googlegroups.com
Hello Praveen,

that is exactly what I am after - having all but the first basis function have a zero integral. Will take a look at what you sent me, thank you.

Regards,

Lukáš Korous

You received this message because you are subscribed to a topic in the Google Groups "deal.II User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dealii/NDiUu3qESOM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dealii+unsubscribe@googlegroups.com.

Wolfgang Bangerth

unread,
Apr 21, 2017, 11:02:28 AM4/21/17
to dea...@googlegroups.com
On 04/21/2017 08:21 AM, Lukas Korous wrote:
>
>
> If you work in real space, then in 2d there are 2x3 basis functions
> for the linear space (two vector components, each of which has the
> form a+bx+cy), of which you can eliminate one because of the
> divergence constraint, if I count correctly.
>
> If you map from the reference cell, but require that div u = 0
> pointwise in real space, then things may be more complicated.
>
>
> Here I have no preference, whichever is an easier way to satisfy div u =
> 0 pointwise.

I suspect that that's going to be difficult to do for arbitrary cell
shapes if you define shape functions on the reference cell and map them.

Best
W.

Lukas Korous

unread,
Apr 21, 2017, 3:41:30 PM4/21/17
to dea...@googlegroups.com
Hi,

yes, that is why I am asking for the easiest way. I will start with the Taylor DG space as suggested by Praveen, It is at the moment the larger of my two problems with the MHD code anyway.

Will be in touch, many thanks for your help.

Lukáš Korous

Lukas Korous

unread,
Dec 10, 2017, 10:58:45 AM12/10/17
to deal.II User Group
Hello,

I just want to share my success - I successfully incorporated the Taylor DG space into my code - https://github.com/l-korous/mhdeal.

Thank you for your help.

Wolfgang Bangerth

unread,
Dec 19, 2017, 11:55:48 AM12/19/17
to dea...@googlegroups.com
On 12/10/2017 08:58 AM, Lukas Korous wrote:
>
>
> I just want to share my success - I successfully incorporated the Taylor DG
> space into my code - https://github.com/l-korous/mhdeal.

Lukas,
is either the element (or the whole code) something you would perhaps like to
contribute to the library (or the code gallery)?

Lukas Korous

unread,
Dec 21, 2017, 6:27:20 AM12/21/17
to dea...@googlegroups.com
Hi Wolfgang,

once it is ready, sure.

Lukáš Korous

Reply all
Reply to author
Forward
0 new messages