Re: [Libmesh-users] Energy norm of errors

2016-01-19 Thread David Knezevic
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

Re: [Libmesh-users] Energy norm of errors

2016-01-19 Thread Roy Stogner
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

Re: [Libmesh-users] Energy norm of errors

2016-01-19 Thread Junchao Zhang
Thanks, that is helpful. --Junchao Zhang On Tue, Jan 19, 2016 at 4:10 PM, 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

Re: [Libmesh-users] Energy norm of errors

2016-01-19 Thread David Knezevic
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 wrote: > How to get e =

Re: [Libmesh-users] Energy norm of errors

2016-01-19 Thread Junchao Zhang
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 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 > > >

Re: [Libmesh-users] Energy norm of errors

2016-01-19 Thread David Knezevic
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 wrote: > Hello, > I want to compute e^TKe as a measure of the error of a solution. Here e = > U -

[Libmesh-users] Energy norm of errors

2016-01-19 Thread Junchao Zhang
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 -