← Back to team overview

dolfin team mailing list archive

Re: Issues with interpolate

 

On Friday 03 July 2009 12:04:20 Garth N. Wells wrote:
> Johan Hake wrote:
> > On Thursday 02 July 2009 12:58:25 Garth N. Wells wrote:
> >> Marie Rognes wrote:
> >>> The following code gives r = 0.0. It is not supposed to be.
> >>>
> >>> The problem seems to be that f's vector is still all zeros at the call
> >>> to interpolate. Could this be easily fixed?
> >>
> >> This example should have led to an error message since f is not a
> >> discrete function. I'll take a look.
> >
> > Why should f be discrete?
>
> It is "discrete" in that it has a finite element type, but it is not
> "discrete" in the the sense that it has a vector of dofs.

Arghh...

Then I have missunderstood part of this discussion :P

I assume this will be clearer when (if) we move to the 
all-Functions-needs-a-FunctionSpace design.

Johan

> Garth
>
> f is interpolated into Q_h. Pi_f is the one that has
>
> > to be discrete. Isn't f's eval used in the interpolation when it is not
> > discrete?
> >
> > ... or have I got lost in the interpolation jungle?
> >
> > Johan
> >
> >> Garth
> >>
> >>> --
> >>> from dolfin import *
> >>>
> >>> mesh = UnitSquare(1,1)
> >>> V_h = FunctionSpace(mesh, "CG", 1)
> >>> f = Function(V_h, "1.0")
> >>>
> >>> Q_h = FunctionSpace(mesh, "DG", 1)
> >>> Pi_f = interpolate(f, Q_h)
> >>>
> >>> r = norm(Pi_f)
> >>> print "r = ", r
> >>> ---
> >>>
> >>> --
> >>> Marie
> >>>
> >>>
> >>> _______________________________________________
> >>> DOLFIN-dev mailing list
> >>> DOLFIN-dev@xxxxxxxxxx
> >>> http://www.fenics.org/mailman/listinfo/dolfin-dev
> >>
> >> _______________________________________________
> >> DOLFIN-dev mailing list
> >> DOLFIN-dev@xxxxxxxxxx
> >> http://www.fenics.org/mailman/listinfo/dolfin-dev




Follow ups

References