In the code I found in the site (unsteady nonlinear Navier-Stokes) it is
written this way:

                 AutoPtr<NumericVector<Number> >

        last_nonlinear_soln (catenary_static_system.solution->clone());

                 equation_systems.get_system("Catenary").solve();



        last_nonlinear_soln->add (-1., *catenary_static_system.solution);



        last_nonlinear_soln->close();



        // Compute the L2 norm of the solution difference

        const Real norm_delta = last_nonlinear_soln->l2_norm();


This way I'am actually computing the l2 vector norm not the function norm,
is that right? To compute the actual functional norm I should have to
associate it to the system. Is there any particular reason to consider the
vector norm and not the functional one?

On Mon, Oct 6, 2014 at 4:51 PM, Rodrigo Broggi <[email protected]> wrote:

> Good point, thanks
>
> On Mon, Oct 6, 2014 at 4:12 PM, Roy Stogner <[email protected]>
> wrote:
>
>>
>>
>> On Mon, 6 Oct 2014, Rodrigo Broggi wrote:
>>
>>  Yeah, I have actually the same mesh (these are two consecutive steps of a
>>> Newton method) so I should use:
>>>
>>> Real normh1 = system.calculate_norm(uh - vh,H1);  ?????
>>>
>>> uh and vh are NumericVector<Number> type right?
>>>
>>
>> I don't think we overload NumericVector::operator-.  Returning a
>> new NumericVector[1] would make it too easy to generate temporary vectors
>> (which is expensive) accidentally.
>>
>> So here where you *want* to generate a temporary vector, so it's more
>> convoluted, something like:
>>
>> AutoPtr<NumericVector<Number> > diff_h = uh.clone();
>> diff_h -= vh;
>> Real normh1 = system.calculate_norm(diff_h,H1);
>>
>>
>> 1) Alternatively, returning an expression template would make it too
>> necessary to write expression template code (which is complicated)
>> extensively.  But patches from anyone else who wants to write that
>> code would be welcome.
>> ---
>> Roy
>>
>
>
------------------------------------------------------------------------------
Slashdot TV.  Videos for Nerds.  Stuff that Matters.
http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to