Re: [deal.II] discretization of a analytical function on a second triangulation

25 views
Skip to first unread message

Daniel Arndt

unread,
Jul 5, 2022, 12:16:01 PM7/5/22
to dea...@googlegroups.com
Simon,

defining a class derived from dealii::Function sounds sensible.
Whether calling VectorTools::interpolate makes sense, depends on what you want to do with the interpolated function. In may cases, it's enough to just evaluate it locally during assembly using functionality like FEValues::get_function_values.

Best,
Daniel

On Mon, Jul 4, 2022 at 10:26 AM Simon <simon.w...@gmail.com> wrote:
Dear all:


I am solving a nonlinear PDE on a Triangulation T_1.

I know the analytical representation of a scalar function of two variables (no space co-ordinates, but two invariants of a quantity)
and my goal is to find a discretized version of the analytical function (on a second, two-dimensional triangulation T_2).
The nodal values of T_2 should be the exact values corresponding to the analytical solution.
As for the values between the nodes, I want to start with a bilinear interpolation.

The coupling to my original PDE works as follows:
For each quadrature point defined on T_1, I compute the two input variables of the above function based on my solution vector, find the corresponding cell of T_2 and want to retrieve the interpolated nodal values.

My idea is to use the function
VectorTools::interpolate ,
but I do not know a suitable Function object to hand over.

Is this an appropriate approach at all?


Thank you,
Simon

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/14b1d8f6-f902-4414-a5c6-348ae3f5003en%40googlegroups.com.

Simon Wiesheier

unread,
Jul 6, 2022, 3:03:21 AM7/6/22
to dea...@googlegroups.com
Dear Daniel,


yes, I defined a class derived from deal::Function and it seems to work for me.

Basically, my motivation to call VectorTools::interpolate is to compute the nodal values (scalar field --> DOFs) in the triangulation based on the formula implemented in the just derived class.
During the assembly routine, I access some interpolated values at quadrature points,...

With this in mind, is this an appropriate way?


Best
Simon

Daniel Arndt

unread,
Jul 6, 2022, 12:16:25 PM7/6/22
to dea...@googlegroups.com
Simon,

if you get all information you need using VectorTools::interpolate then this sounds good.
that implements the interpolation for you.

Best,
Daniel



Wolfgang Bangerth

unread,
Jul 6, 2022, 4:15:21 PM7/6/22
to dea...@googlegroups.com
On 7/6/22 01:02, Simon Wiesheier wrote:
>
> Basically, my motivation to call VectorTools::interpolate is to compute the
> nodal values (scalar field --> DOFs) in the triangulation based on the formula
> implemented in the just derived class.
> During the assembly routine, I access some interpolated values at quadrature
> points,...
>
> With this in mind, is this an appropriate way?

Why query the values at quadrature points from the interpolated field when you
could query them from the original function object?

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/

Reply all
Reply to author
Forward
0 new messages