Re: [deal.II] Evaluating an expression u(x), can that take *q_index* information

46 views
Skip to first unread message

Wolfgang Bangerth

unread,
Dec 22, 2021, 12:27:59 AM12/22/21
to dea...@googlegroups.com
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/

Message has been deleted

Judy Lee

unread,
Dec 23, 2021, 10:38:30 AM12/23/21
to deal.II User Group
Dr. Bangerth,

Thanks so much for your reply that pointed out my problem.
Quadrature is applied to the residual expression, which includes both analytical and approximation.
"right-hand-side" showed me that approximation can be obtained at quadrature point, before getting Jacobians and weighted.
This is wonderful! I will keep up my work.

Happy Holidays!
Best,
Judy
Reply all
Reply to author
Forward
0 new messages