How to add addtional point to enrichment functions (FE_Enriched)

56 views
Skip to first unread message

Edith Sotelo

unread,
Nov 1, 2017, 12:27:10 AM11/1/17
to deal.II User Group
Hello,

I would like to implement enrichment functions of this type: f(x-xo) where xo is a user defined point. It could be the center of the cell or the dof coordinate.
I would like a suggestion about how to implement this, because I do not see how to pass it in the constructor since it is not a static point.I think it has to be  during the assembly step, but FE_values call the enrich function with a single argument (the quadrature point). 
What sould be a way to do pass the addtional point?

Thank you for you help.

Denis Davydov

unread,
Nov 1, 2017, 6:29:42 PM11/1/17
to deal.II User Group
Hi Edith,

f(x-x0) is just your enrichment function derived from dealii::Function. So define a class which takes that extra parameter (or any number of them) and use it with FE_Enriched.
Assuming that your bilinear form needs gradients, then you would need to implement gradients of your custom function so that FE_Enriched can work out chain rule for you.

Cheers,
Denis.

Edith Sotelo

unread,
Nov 1, 2017, 9:50:34 PM11/1/17
to dea...@googlegroups.com
Hi Denis,
Thank you for your answer but I still need to further understand some things :  
* I think I need to pass the point (xo) during assembly since it will different for different cells ( dof coordinate or center of the cell), and I do not see how I can pass the point when declaring the function (ex. Enrichment <dim> (param1,param2, etc...) ) to create the  FE_Enriched constructor, maybe I am missing something here.

*  The thing is that  during assembly the functions are already encapsulated  in the “enrichments” vector and if I even  create a member function like Enrichment<dim>::get_point(Point<dim> & ) how do I apply it to the functions that are already in the “enrichments” vector ? Maybe I can make  the “enrichments” vector  public?...

Thank you for your help

Edith



--
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/fFbITWIMW5M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dealii+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Edith







Denis Davydov

unread,
Nov 2, 2017, 2:49:14 AM11/2/17
to dea...@googlegroups.com


2 нояб. 2017 г., в 2:50, Edith Sotelo <eso...@tamu.edu> написал(а):

Hi Denis,
Thank you for your answer but I still need to further understand some things :  
* I think I need to pass the point (xo) during assembly since it will different for different cells ( dof coordinate or center of the cell),

Unless you work with discontinuous Galerkin, then you need to be careful with how you use PUM.

If you take a global view of the shape functions and enrich each of them with a a given function, it will be extremely tedious to pull of. 

I don’t know what you are trying to do, but I suggest to draw a 1D sketch with a global view to linear shape-functions and the enriched functions (shape functions times enrichments), try to number them and see what constraints you should have on DoFs to make your FE space continuous.

and I do not see how I can pass the point when declaring the function (ex. Enrichment <dim> (param1,param2, etc...) ) to create

See below

the  FE_Enriched constructor, maybe I am missing something here.

*  The thing is that  during assembly the functions are already encapsulated  in the “enrichments” vector and if I even  create a member function like Enrichment<dim>::get_point(Point<dim> & ) how do I apply it to the functions that are already in the “enrichments” vector ? Maybe I can make  the “enrichments” vector  public?...

Writing out of head (there could be typos): 

template <int dim>
class MyFavoriteEnrichment : public dealii::Function<dim >
{
public:
   MyFavoriteEnrichment(const Point<dim> &x0);

}

is what u need.
Look at implementation of any dealii’s functions.

Edith Sotelo

unread,
Nov 2, 2017, 10:46:47 AM11/2/17
to dea...@googlegroups.com

Hi  Denis,
Thank you for answering my (odd) questions...

I think I meant that I do not see how I could pass a point that is calculated during assembly when constructing the enrichments functions. So to pass the point during assembly I think I need to get to the enrichment functions that are already in the “enrichments” vector,  and this is a protected  member of the FE_Enriched class … so I was thinking to make it public…  maybe you have a different suggestion...

I want to do this to try a couple of things..

* I want to test a function like this : Cos ( z) with  z=sqrt ( (x-xo)^2 + (y-yo)^2), where  (xo, yo) is the point I need to pass..

* I would like to implement the  kronecker delta property: f(x)-f(xi) where xi is the coordinate of the dof


 and I was also thinking that I would probably need to work with DG methods. But I can try the 1D test you suggested first to find out the continuity of my functions

Thank you for your help.

Edith

Denis Davydov

unread,
Nov 2, 2017, 11:56:43 AM11/2/17
to dea...@googlegroups.com
Hi Edith,

On 2 Nov 2017, at 15:46, Edith Sotelo <sotelo...@gmail.com> wrote:


Hi  Denis,
Thank you for answering my (odd) questions...

I think I meant that I do not see how I could pass a point that is calculated during assembly when constructing the enrichments functions. So to pass the point during

what do you **have to** calculate this point during assembly? If it’s just a support point of the FE basis or a vertex, surely you can get it prior to assembly.
You can also use pointers to a Point<dim> in your custom function and then modify the value outside.

Edith Sotelo

unread,
Nov 2, 2017, 3:08:42 PM11/2/17
to dea...@googlegroups.com
Hey Denis,

I think I was not clear enough in describing what I want to do . I apologize, that’s my bad. I hope the next lines explain it better

I want to implement Ni*F(x-xi) or   Ni*[F(x)-F(xi)]  for the enrichment part

where:
Ni is the i-th standard basis function,
F is a enrichment function ,
xi is the dof coordinate of the i-th standard basis function.

That’s why I think  I need to look for the corresponding xi point  during assembly… 

Thank you for your patience.

Denis Davydov

unread,
Nov 2, 2017, 3:45:05 PM11/2/17
to dea...@googlegroups.com
Hi Edith,

On 2 Nov 2017, at 20:08, Edith Sotelo <sotelo...@gmail.com> wrote:

Hey Denis,

I think I was not clear enough in describing what I want to do . I apologize, that’s my bad. I hope the next lines explain it better

I want to implement Ni*F(x-xi) or   Ni*[F(x)-F(xi)]  for the enrichment part

(below I assume you have the same FE for enriched and non-enriched parts).

If you have a FE space spanned by { Ni(x), Ni(x) * F(x-xi) } then it essentially means you have a different enrichment function for each DoF.
You might as well write it as  {Ni(x), Ni(x) * Fi (x) }   where Fi(x) := F(x-xi)
That won’t work with FE_Enriched because a single function F(x) is used to enrich all DoFs on the element.
There is no mechanism to selectively pick up a single DoF. You would have to do this manually.

If you need to enrich only a hand-full of all DoFs (say 10 out of 100000) each with a different function, 
then you can try to work out the chain-rule in your bilinear forms manually. That’s easy but tedious, see https://github.com/dealii/dealii/blob/master/tests/fe/fe_enriched_step-36b.cc#L455-L590
which implements PUM without FE_Enriched.
What is worse is managing FE_Collection and figuring out all the constraints to keep continuous FE space. 
On each element you would go  local_dof -> global_dof -> enrichment_function.
I guess it’s doable, but not trivial in implementation.


The second case you have a space spanned by { Ni(x), Ni(x) * [F(x) - F(xi)] } \equiv {Ni(x), Ni(x) * F(x) } is perfectly doable with FE_Enriched.

Regards,
Denis.

Denis Davydov

unread,
Nov 2, 2017, 4:03:40 PM11/2/17
to dea...@googlegroups.com
On 2 Nov 2017, at 20:45, Denis Davydov <davy...@gmail.com> wrote:

Hi Edith,

On 2 Nov 2017, at 20:08, Edith Sotelo <sotelo...@gmail.com> wrote:

Hey Denis,

I think I was not clear enough in describing what I want to do . I apologize, that’s my bad. I hope the next lines explain it better

I want to implement Ni*F(x-xi) or   Ni*[F(x)-F(xi)]  for the enrichment part

(below I assume you have the same FE for enriched and non-enriched parts).

If you have a FE space spanned by { Ni(x), Ni(x) * F(x-xi) } then it essentially means you have a different enrichment function for each DoF.
You might as well write it as  {Ni(x), Ni(x) * Fi (x) }   where Fi(x) := F(x-xi)
That won’t work with FE_Enriched because a single function F(x) is used to enrich all DoFs on the element.
There is no mechanism to selectively pick up a single DoF. You would have to do this manually.

If you need to enrich only a hand-full of all DoFs (say 10 out of 100000) each with a different function, 
then you can try to work out the chain-rule in your bilinear forms manually. That’s easy but tedious, see https://github.com/dealii/dealii/blob/master/tests/fe/fe_enriched_step-36b.cc#L455-L590
which implements PUM without FE_Enriched.
What is worse is managing FE_Collection and figuring out all the constraints to keep continuous FE space. 

p.s. constraints are actually simpler in this case. For scalar problem you only need two components in FE_System — one for enriched DoFs and one for standard.

Edith Sotelo

unread,
Nov 10, 2017, 2:34:39 PM11/10/17
to dea...@googlegroups.com
Hello Denis,

Coming back to this. I think it is still possible to use the FE-Enriched class..  My idea is to  access the “enrichments” class variable that contains the enrichments functions. However this variable is protected. 
Whatever solution I think of to  access this variable , it ends up modifying the class, which I think it is not the idea. (to make it public, to  declare a friend class/function) 

My final idea is to implement a get_point (Point<dim>  &) function in my enrichment function class and be able to apply it to the enrichments stored in the “enrichments” FE_Enriched class variable, something  similar to what you did in the “multiply_by_enrichment” FE_Enriched member function.

I will appreciate any suggestion regarding this and thank you for your help.

Edith

Edith Sotelo

unread,
Nov 10, 2017, 5:23:57 PM11/10/17
to dea...@googlegroups.com
Hello again,
My solution:  I just made a local copy of FE_Enriched.cc and .h and I am including in my main program the local the Enriched.h 
Still have to implement the rest, maybe more questions to come…

thank you for your help,

Edith
Edith







Reply all
Reply to author
Forward
0 new messages