Thank you for your help, I really appreciate it. I thought regarding the
second one we can also compute the lump, because we have
m_i = sigma (m_ij) = int(phi_i dx)
and
M_l = diag(m_1,m_2,...,m_N).


Regards
Shahin


<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon>
Virus-free.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Fri, May 21, 2021 at 9:27 PM Bruno Turcksin <bruno.turck...@gmail.com>
wrote:

> Shahin,
>
> The two codes are not equivalent and I think that they are both wrong. The
> second code is not lumping anything, you just keep the diagonal of the
> matrix and that's it. The first code set lump = 0.0 at the wrong place and
> you forgot a += or you need to reorder the loops. I think you want
> something like this:
>
>   for(unsigned int i = 0; i<dofs_per_cell; ++i)
>
>   {
>
>    double lump = 0.;
>
>     for(unsigned int j = 0; j<dofs_per_cell; ++j)
>
>    {
>
>        for(unsigned int q_index = 0 ; q_index < n_q_points ; ++q_index)
>
>        {
>
>          lump += fe_values.shape_value(i, q_index)
> *fe_values.shape_value(j, q_index) * fe_values.JxW(q_index);
>
>        }
>
>    }
>
>    lump_cell_matrix(i,i) = lump;
>
>   }
>
>
>
> Best,
>
> Bruno
>
> Le ven. 21 mai 2021 à 14:54, Shahin Heydari <sh1990.heyd...@gmail.com> a
> écrit :
>
>> Dear Bruno
>>
>> Thank you so much for your reply, It was very helpful. Regarding the mass
>> lumping question,  I just compute it as follows:
>>
>> for(unsigned int q_index = 0 ; q_index < n_q_points ; ++q_index)
>>
>> {
>>
>> double lump = 0.0;
>>
>> for(unsigned int i = 0; i<dofs_per_cell; ++i)
>>
>> for(unsigned int j = 0; j<dofs_per_cell; ++j)
>>
>> lump += fe_values.shape_value(i, q_index) *
>>
>> fe_values.shape_value(j, q_index) *
>>
>>  fe_values.JxW(q_index);
>>
>>
>> lump_cell_matrix(i,i) = lump;
>>
>> }
>>
>>
>>
>> or another way can be
>>
>> for(unsigned int q_index = 0 ; q_index < n_q_points ; ++q_index)
>>
>> {
>>
>> for(unsigned int i = 0; i<dofs_per_cell; ++i)
>>
>>   for(unsigned int j = 0; j<dofs_per_cell; ++j)
>>
>>  if(i==j)
>>
>>  lump_cell_matrix(i,j) += fe_values.shape_value(i, q_index)*
>>
>> fe_values.JxW(q_index) ;
>>
>> else
>>
>> 0;
>>
>> }
>> but I am not sure if it always works, what if I want to use Q2, I feel
>> like it's not correct. I would be happy to hear your opinion or advice.
>>
>> Regards
>> Shahin
>>
>>
>> On Thu, May 20, 2021, 14:49 Bruno Turcksin <bruno.turck...@gmail.com>
>> wrote:
>>
>>> Shahin,
>>>
>>> I think this does what you want
>>> https://dealii.org/current/doxygen/deal.II/namespaceGridTools.html#addb822f0e3068e48640ecc981ee6c1e6
>>> I am not sure I understand what's your question about lumping.
>>>
>>> Best,
>>>
>>> Bruno
>>>
>>> On Thursday, May 20, 2021 at 4:11:47 AM UTC-4 sh1990....@gmail.com
>>> wrote:
>>>
>>>> Dear all
>>>> Hello, hope you are safe and healthy.
>>>>
>>>> I am trying to use deal.ii for my work but I have encountered some
>>>> difficulties during implementation and I would highly appreciate it if you
>>>> can help me with it.
>>>>
>>>> I want  to use flux corrected transport scheme, and for this I should
>>>> go through all the neighbouring of a certain node and compute the fluxes to
>>>> that node, there is also a flux limiter which is depend on this flux, so I
>>>> can't go cell by cell as many of the tutorial in dealii has suggested,
>>>> instead I need to go through a patch consist of all neighbouring cells, now
>>>> I am just wondering whether there is any class in dealii which can do this
>>>> process, I would really appreciate any help and feedback from you.
>>>>
>>>> On the other hand there is a part in which I should compute a lump
>>>> matrix and add it to the scheme, but I feel like this is also wrong and
>>>> should not be done over a cell(please see the attachment).
>>>>
>>>> I am trying to implement some initial conditions, whenever I run each
>>>> part of the code separately I can get the picture but when I am trying to
>>>> put it all together in a loop it won't work (please see the attachment). I
>>>> would be thankful if you could let me know how I can fix it.
>>>>
>>>> I am looking forward to hearing from you.
>>>> Sincerely
>>>> Shahin Heydari
>>>>
>>>> --
>>> 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.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/dealii/c77c7def-c89e-4bdb-8f2d-6cc23fc1eec8n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/dealii/c77c7def-c89e-4bdb-8f2d-6cc23fc1eec8n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>
>>
>> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon>
>>  Virus-free.
>> www.avast.com
>> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link>
>> <#m_7582570965796856719_m_1817937648256189538_m_-1766663769396021098_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>>
>> --
>> 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/0B1nGC0O1Tc/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> dealii+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/dealii/CALUbCFwGm8duazCftHqU%2BOUzkOxHxgsm%2B4EgZZk1r9Thf%3DiTQA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/dealii/CALUbCFwGm8duazCftHqU%2BOUzkOxHxgsm%2B4EgZZk1r9Thf%3DiTQA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/dealii/CAGVt9ePyAxprvkxEEwOG4du9_hp7bcQFq%2B2mHBfntA7rY4-p7g%40mail.gmail.com
> <https://groups.google.com/d/msgid/dealii/CAGVt9ePyAxprvkxEEwOG4du9_hp7bcQFq%2B2mHBfntA7rY4-p7g%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/CALUbCFw_rTEneDgea2vY%3Dm7P%3DoBAvcHs2p7AVRoon2PHEwcQGw%40mail.gmail.com.

Reply via email to