I wrote a drop-in function which can replace VectorTools::interpolate, but 
works for both FE_Q and FE_Bernstein (not tested yet for other elements). 
Is it useful to have something like that in the library, and if yes, what 
is the best way for proof-checking and integrating?
Thanks!

Am Donnerstag, 16. Mai 2019 22:00:23 UTC+2 schrieb luca.heltai:
>
>
> > On 16 May 2019, at 9:16, 'Maxi Miller' via deal.II User Group <
> dea...@googlegroups.com <javascript:>> wrote: 
> > 
> > I would like to use the interpolate()-function to interpolate the 
> correct function onto my mesh for comparison during some simple tests. This 
> works fine when using FE_Q-elements, but fails when using FE_Bernstein 
> elements. 
>
> FE_Bernstein, like BSplines, are not interpolatory, there is not a single 
> definition of “interpolation”, since there are no support points. 
>
> If you want your function to be interpolated at some points, then you’d 
> have to construct the interpolation matrix yourself, by solving in some 
> sense the following system 
>
> sum_i  B_i(x_j) u_i = f(x_j) 
>
> provided that you specify exactly the same number of interpolation points 
> as there are degrees of freedom. 
>
> One easy way to do this, is to interpolate to a dofhandler with FE_Q(d), 
> with the same degree of the FEBernstein, and then call 
>
>
> void VectorTools::interpolate        (        const DoFHandler< dim, 
> spacedim > &         dof_1, 
> const DoFHandler< dim, spacedim > &         dof_2, 
> const FullMatrix< double > &         transfer, 
> const InVector &         data_1, 
> OutVector &         data_2 
> ) 
>
> where the FullMatrix< double > & transfer represents the local 
> interpolation between FE_Bernstein and FE_Q. 
>
>
> https://www.dealii.org/current/doxygen/deal.II/namespaceVectorTools.html#a5e3af70a47cedfaf361cf5c621e94e3d
>  
>
> This is used, for example, here: 
>
>
> https://github.com/dealii/dealii/blob/master/include/deal.II/numerics/vector_tools.templates.h#L9120
>  
>
> You can do the exact same thing. Construct a local interpolation matrix, 
> and then call the interpolate function above passing this matrix (and the 
> vector you interpolated on the standard FE_Q space). 
>
>
> https://github.com/dealii/dealii/blob/master/include/deal.II/numerics/vector_tools.templates.h#L9208
>  
>
> Best, 
> Luca. 
>
>
>
> > The error message I get is 
> > An error occurred in line <3098> of file 
> <~/Downloads/git-files/dealii/source/fe/fe_values.cc> in function 
> >     dealii::FEValuesBase<dim, spacedim>::FEValuesBase(unsigned int, 
> unsigned int, dealii::UpdateFlags, const dealii::Mapping<dim, spacedim>&, 
> const dealii::FiniteElement<dim, spacedim>&) [with int dim = 2; int 
> spacedim = 2] 
> > The violated condition was: 
> >     n_q_points > 0 
> > Additional information: 
> >     There is nothing useful you can do with an FEValues object when 
> using a quadrature formula with zero quadrature points! 
> > 
> > 
> > Is there an alternative way to interpolate a function onto the mesh when 
> using FE_Bernstein elements? 
> > 
> > -- 
> > 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 dea...@googlegroups.com <javascript:>. 
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/dealii/2f5b238a-b78a-4097-b492-2e0ebd82ec93%40googlegroups.com.
>  
>
> > For more options, visit https://groups.google.com/d/optout. 
>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/f8829f33-a47a-41fd-a74e-159b8ac698c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to