Yeah, Roy is right, better to use quadrature.

The approach I suggested initially would require you to project the exact
solution into the FE space first, but you probably want to avoid that since
it introduces a projection error into your calculation.

David



On Tue, Jan 19, 2016 at 6:20 PM, Roy Stogner <royst...@ices.utexas.edu>
wrote:

>
> This may not be what you want to do, IMHO.
>
> In the extreme case: If you compute the Uexact vector and then do the
> vec*mat*vec, then you'll get a result of 0 for problems where your
> method gives you an interpolant of the exact solution, even if that
> interpolant doesn't equal the exact solution.
>
> If you evaluate the energy norm quadrature point by quadrature point,
> you'll get a more accurate estimate of the error in general and you
> can easily test for quadrature error by bumping up the order of your
> rule.
> ---
> Roy
>
>
> On Tue, 19 Jan 2016, David Knezevic wrote:
>
> Assemble the Uexact vector, then compute the difference e = U - Uexact.
>>
>> You can also refer to error_estimation/exact_solution.h, but I believe
>> that's used for computing L2 or H1 error, not an arbitrary energy norm.
>>
>> David
>>
>>
>>
>> On Tue, Jan 19, 2016 at 5:04 PM, Junchao Zhang <junchao.zh...@gmail.com>
>> wrote:
>>
>> How to get e = U - Uex? Is there a libmesh interface for that?
>>>
>>> --Junchao Zhang
>>>
>>> On Tue, Jan 19, 2016 at 3:57 PM, David Knezevic <
>>> david.kneze...@akselos.com> wrote:
>>>
>>> Assuming you've already assembled K, so you can just do a matvec
>>>> (SparseMatrix::vector_mult) followed by a dot product
>>>> (NumericVector::dot).
>>>>
>>>> David
>>>>
>>>>
>>>>
>>>> On Tue, Jan 19, 2016 at 4:53 PM, Junchao Zhang <junchao.zh...@gmail.com
>>>> >
>>>> wrote:
>>>>
>>>> Hello,
>>>>>   I want to compute e^TKe as a measure of the error of a solution. Here
>>>>> e =
>>>>> U - Uex, supposing I know the analytic answer to the PDE.
>>>>>   How can I do it in libmesh? Is there an example?
>>>>>   Thank you.
>>>>>
>>>>> --Junchao Zhang
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Site24x7 APM Insight: Get Deep Visibility into Application Performance
>>>>> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
>>>>> Monitor end-to-end web transactions and take corrective actions now
>>>>> Troubleshoot faster and improve end-user experience. Signup Now!
>>>>> http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
>>>>> _______________________________________________
>>>>> Libmesh-users mailing list
>>>>> Libmesh-users@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/libmesh-users
>>>>>
>>>>>
>>>>
>>>>
>>>
>> ------------------------------------------------------------------------------
>> Site24x7 APM Insight: Get Deep Visibility into Application Performance
>> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
>> Monitor end-to-end web transactions and take corrective actions now
>> Troubleshoot faster and improve end-user experience. Signup Now!
>> http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
>> _______________________________________________
>> Libmesh-users mailing list
>> Libmesh-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/libmesh-users
>>
>>
>>
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Libmesh-users mailing list
Libmesh-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to