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


> On Nov 2, 2017, at 3:03 PM, Denis Davydov <davyd...@gmail.com> wrote:
> 
> 
> 
>> On 2 Nov 2017, at 20:45, Denis Davydov <davyd...@gmail.com 
>> <mailto:davyd...@gmail.com>> wrote:
>> 
>> Hi Edith,
>> 
>>> On 2 Nov 2017, at 20:08, Edith Sotelo <sotelog.ed...@gmail.com 
>>> <mailto:sotelog.ed...@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
>>  
>> <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.
> 
> 
>> 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.
>> 
>> 
>>> 
>>> 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.
>>> 
>>> 
>>> 
>>>> On Nov 2, 2017, at 10:56 AM, Denis Davydov <davyd...@gmail.com 
>>>> <mailto:davyd...@gmail.com>> wrote:
>>>> 
>>>> Hi Edith,
>>>> 
>>>>> On 2 Nov 2017, at 15:46, Edith Sotelo <sotelog.ed...@gmail.com 
>>>>> <mailto:sotelog.ed...@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.
>>>> 
>>>>> 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
>>>>> 
>>>>> 
>>>>>> On Nov 2, 2017, at 1:49 AM, Denis Davydov <davyd...@gmail.com 
>>>>>> <mailto:davyd...@gmail.com>> wrote:
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 2 нояб. 2017 г., в 2:50, Edith Sotelo <esot...@tamu.edu 
>>>>>> <mailto:esot...@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.
>>>>>> 
>>>>>>> 
>>>>>>> Thank you for your help
>>>>>>> 
>>>>>>> Edith
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>>> On Nov 1, 2017, at 5:29 PM, Denis Davydov <davyd...@gmail.com 
>>>>>>>> <mailto:davyd...@gmail.com>> wrote:
>>>>>>>> 
>>>>>>>> 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.
>>>>>>>> 
>>>>>>>> On Wednesday, November 1, 2017 at 5:27:10 AM UTC+1, Edith Sotelo wrote:
>>>>>>>> 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.
>>>>>>>> 
>>>>>>>> 
>>>>>>>> -- 
>>>>>>>> The deal.II project is located at http://www.dealii.org/ 
>>>>>>>> <http://www.dealii.org/>
>>>>>>>> For mailing list/forum options, see 
>>>>>>>> https://groups.google.com/d/forum/dealii?hl=en 
>>>>>>>> <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 
>>>>>>>> <https://groups.google.com/d/topic/dealii/fFbITWIMW5M/unsubscribe>.
>>>>>>>> To unsubscribe from this group and all its topics, send an email to 
>>>>>>>> dealii+unsubscr...@googlegroups.com 
>>>>>>>> <mailto:dealii+unsubscr...@googlegroups.com>.
>>>>>>>> For more options, visit https://groups.google.com/d/optout 
>>>>>>>> <https://groups.google.com/d/optout>.
>>>>>>> 
>>>>>>> Edith
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> -- 
>>>>>>> The deal.II project is located at http://www.dealii.org/ 
>>>>>>> <http://www.dealii.org/>
>>>>>>> For mailing list/forum options, see 
>>>>>>> https://groups.google.com/d/forum/dealii?hl=en 
>>>>>>> <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 
>>>>>>> <https://groups.google.com/d/topic/dealii/fFbITWIMW5M/unsubscribe>.
>>>>>>> To unsubscribe from this group and all its topics, send an email to 
>>>>>>> dealii+unsubscr...@googlegroups.com 
>>>>>>> <mailto:dealii+unsubscr...@googlegroups.com>.
>>>>>>> For more options, visit https://groups.google.com/d/optout 
>>>>>>> <https://groups.google.com/d/optout>.
>>>>>> 
>>>>>> -- 
>>>>>> The deal.II project is located at http://www.dealii.org/ 
>>>>>> <http://www.dealii.org/>
>>>>>> For mailing list/forum options, see 
>>>>>> https://groups.google.com/d/forum/dealii?hl=en 
>>>>>> <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 
>>>>>> <https://groups.google.com/d/topic/dealii/fFbITWIMW5M/unsubscribe>.
>>>>>> To unsubscribe from this group and all its topics, send an email to 
>>>>>> dealii+unsubscr...@googlegroups.com 
>>>>>> <mailto:dealii+unsubscr...@googlegroups.com>.
>>>>>> For more options, visit https://groups.google.com/d/optout 
>>>>>> <https://groups.google.com/d/optout>.
>>>>> 
>>>>> Edith
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> -- 
>>>>> The deal.II project is located at http://www.dealii.org/ 
>>>>> <http://www.dealii.org/>
>>>>> For mailing list/forum options, see 
>>>>> https://groups.google.com/d/forum/dealii?hl=en 
>>>>> <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 
>>>>> <https://groups.google.com/d/topic/dealii/fFbITWIMW5M/unsubscribe>.
>>>>> To unsubscribe from this group and all its topics, send an email to 
>>>>> dealii+unsubscr...@googlegroups.com 
>>>>> <mailto:dealii+unsubscr...@googlegroups.com>.
>>>>> For more options, visit https://groups.google.com/d/optout 
>>>>> <https://groups.google.com/d/optout>.
>>>> 
>>>> 
>>>> -- 
>>>> The deal.II project is located at http://www.dealii.org/ 
>>>> <http://www.dealii.org/>
>>>> For mailing list/forum options, see 
>>>> https://groups.google.com/d/forum/dealii?hl=en 
>>>> <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 
>>>> <https://groups.google.com/d/topic/dealii/fFbITWIMW5M/unsubscribe>.
>>>> To unsubscribe from this group and all its topics, send an email to 
>>>> dealii+unsubscr...@googlegroups.com 
>>>> <mailto:dealii+unsubscr...@googlegroups.com>.
>>>> For more options, visit https://groups.google.com/d/optout 
>>>> <https://groups.google.com/d/optout>.
>>> 
>>> Edith
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> -- 
>>> The deal.II project is located at http://www.dealii.org/ 
>>> <http://www.dealii.org/>
>>> For mailing list/forum options, see 
>>> https://groups.google.com/d/forum/dealii?hl=en 
>>> <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 
>>> <https://groups.google.com/d/topic/dealii/fFbITWIMW5M/unsubscribe>.
>>> To unsubscribe from this group and all its topics, send an email to 
>>> dealii+unsubscr...@googlegroups.com 
>>> <mailto:dealii+unsubscr...@googlegroups.com>.
>>> For more options, visit https://groups.google.com/d/optout 
>>> <https://groups.google.com/d/optout>.
>> 
> 
> 
> -- 
> The deal.II project is located at http://www.dealii.org/ 
> <http://www.dealii.org/>
> For mailing list/forum options, see 
> https://groups.google.com/d/forum/dealii?hl=en 
> <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 
> <https://groups.google.com/d/topic/dealii/fFbITWIMW5M/unsubscribe>.
> To unsubscribe from this group and all its topics, send an email to 
> dealii+unsubscr...@googlegroups.com 
> <mailto:dealii+unsubscr...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

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 the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to