← Back to team overview

dolfin team mailing list archive

Re: [Question #103034]: Different norms of a functional

 

Question #103034 on DOLFIN changed:
https://answers.launchpad.net/dolfin/+question/103034

Murtazo Nazarov posted a new comment:
Murtazo Nazarov wrote:
> Question #103034 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/103034
>
> Murtazo Nazarov posted a new comment:
> Murtazo Nazarov wrote:
>   
>> Your question #103034 on DOLFIN changed:
>> https://answers.launchpad.net/dolfin/+question/103034
>>
>>     Status: Answered => Open
>>
>> You are still having a problem:
>> Anders Logg wrote:
>>   
>>     
>>> Question #103034 on DOLFIN changed:
>>> https://answers.launchpad.net/dolfin/+question/103034
>>>
>>>     Status: Open => Answered
>>>
>>> Anders Logg proposed the following answer:
>>> On Wed, Mar 03, 2010 at 02:36:59AM -0000, Murtazo Nazarov wrote:
>>>   
>>>     
>>>       
>>>> New question #103034 on DOLFIN:
>>>> https://answers.launchpad.net/dolfin/+question/103034
>>>>
>>>> Hi,
>>>>
>>>> I am wondering how to compute an L1-norm, and L_inf norm of a functional on the cell. For instance how to compute
>>>>
>>>> 1. ||\div(Pu)||_{L_\infty} ?
>>>>     
>>>>       
>>>>         
>>> Try projecting div(Pu) onto piecewise constants and then pick the
>>> largest absolute value in the vector.
>>>
>>>   
>>>     
>>>       
>> I need L_inf norm on the cell. With this way, doesn't give the L_inf for 
>> the entire domain?
>>
>> murtazo
>>
>>   
>>     
>
> Instead of projecting div(Pu) onto piecewise constants, I projected it 
> into dG(1), with this way I get three values on each cell, which I can 
> then pick up the largest of them. That gives me then L_inf_K, where K is 
> a cell. Now, I cannot figured out how is the numbering done for the 
> dG(1) elements.
>
> If N is a total number of cells, then my projected vector Pdg has 3*N 
> elements. How can I pick up elements of Pdg in the cell K?
>
> Thanks,
> murtazo
>
>   

It seems the numbering is as the following:

      int nsdim = mesh.topology().dim();
      int num_en = 1 + nsdim; // number of vertices's on the cell
      real L_inf_K = 0.;
      for (int i = 0; i < num_en ; i++){
        L_inf_K = max(L_inf_K, fabs(my_arr[num_en*cid + i]));
      }

probably there is a better way, but this works for now in one cpu (maybe 
not in parallel).

murtazo

>>>> 2. ||\div(Pu)||_{L_1} ?
>>>>     
>>>>       
>>>>         
>>> Try
>>>
>>> M = abs(div(Pu))*dx
>>>
>>> --
>>> Anders
>>>
>>>
>>>   
>>>     
>>>       
>>>> where u is velocity (vector) and P is pressure (scalar). L2 norm is obvious to do.
>>>>
>>>> I use C++ interface
>>>>
>>>>     
>>>>       
>>>>         
>>>     
>>>       
>>     
>
>

-- 
You received this question notification because you are a member of
DOLFIN Team, which is an answer contact for DOLFIN.