← Back to team overview

dolfin team mailing list archive

Re: Interesting issue with interpolate(?)

 

On Sat, Aug 22, 2009 at 12:00:13AM +0200, Marie Rognes wrote:
> Garth N. Wells wrote:
> >
> >
> > Marie Rognes wrote:
> >> Garth N. Wells wrote:
> >>>
> >>>
> >>> Marie Rognes wrote:
> >>>> I have a slightly interesting issue, possibly with interpolate:
> >>>>
> >>>> Say I have a RT_0 function u. I want to interpolate this function
> >>>> onto a DG_1 function Pi_u.
> >>>> Since RT_0 \subset DG_1, I would expect to get the same function.
> >>>> This does not seem
> >>>> to be the case at the moment.
> >>>>
> >>>
> >>> Need to be careful interpolating in discontinuous spaces because you
> >>> will pick up the 'last' evaluated term, i.e. you can't be sure which
> >>> on side the function will be evaluated on. This could be the issue.
> >>> Have a look inside the interpolate functions in Function.cpp.
> >>>
> >>>
> >>
> >>
> >> Ah. This makes the use of interpolate in errornorm pretty
> >> unpredictable ...
> >>
> >
> > Should be OK if u and uh are continuous.
> >
> > I would be inclined to remove errornorm - too much can go wrong, for
> > example, it defaults to k =3 for interpolating the exact solution and
> > what happens if uh is discontinuous.
> >
>
> I happen to be using errornorm a lot ;)

That function is pretty useful. We got pretty strange results before
we added it, that is, before realizing how to appropriately evaluate
errors. It seems we've discovered some more corner cases.

> The main problem is with the interpolation of discontinuous functions.
> As far as I can understand, this should be mathematically possible....
>
> Interpolate seems to interate over each cell, so the current cell is
> known. However, this information seems
> to be thrown away in UFCFunction::evaluate at the call to
>
>     void Function::eval(double* values, const Data& data) const
>
> Wouldn't it be possible to use
>
>     void Function::eval(double* values, const double* x, const
> ufc::cell& ufc_cell, uint cell_index) const
>
> instead?

Good idea. I have made an attempt to implement this. See if it works.

--
Anders

Attachment: signature.asc
Description: Digital signature


References