On 12/21/21 8:59 AM, Judy Lee wrote:
>
> Can I make an expression u(x) for 1D analytical solution, that can take
> *q_index* for evaluating u(@ *q_index*), while skip obtaining *q_index*
> locations/points value?
What is 'q_index'? It's usually the index (an integer) of a quadrature point
on a cell. But u(x) is a function of a spatial variable (a point in the
domain). You can't ask for u(q_index). You have to say what that point is
where you want to evaluate the function.
If I understand right then all you need is the ability to evaluate the exact
solution at the location of a quadrature point. There are many examples of how
this is done in the example programs (just search for where a right hand side
is evaluated, for example). For evaluating the error u-uh, you can also take a
look at step-7.
Best
WB
--
------------------------------------------------------------------------
Wolfgang Bangerth email:
bang...@colostate.edu
www:
http://www.math.colostate.edu/~bangerth/