Yes, the lambda worked, thanks!

Am Donnerstag, 27. Februar 2020 17:00:12 UTC+1 schrieb Wolfgang Bangerth:
>
>
> > | 
> > Functions::InterpolatedTensorProductGridData<dim> 
> interpolator(this->coordinate_values, 
> >                                                               
>  this->data_storage); 
> > 
> > VectorFunctionFromScalarFunctionObject<dim> 
> interpolator_object(&interpolator.value, 
>
> The error... 
>
> > but the compilation fails with 
> > error: ISO C++ forbids taking the address of a bound member function to 
> > form a pointer to member function.  Say 
> > ‘&dealii::Functions::InterpolatedTensorProductGridData<2>::value’. 
>
> ...comes from the line above. The problem is that 
>    &object.functionname 
> is simply not something that C++ understands. What you need is a 
> function object that takes a Point and returns a double. You can use 
>   std::bind(&Functions::InterpolatedTensorProductGridData<dim>::value, 
>             &interpolator) 
> as this argument, or maybe more modern, write 
>   [&interpolator] (const Point<dim> &p) { return interpolator.value(p); } 
> in place of the first constructor argument to interpolator_object. 
>
> Best 
>   W. 
> -- 
> ------------------------------------------------------------------------ 
> Wolfgang Bangerth          email:                 bang...@colostate.edu 
> <javascript:> 
>                             www: http://www.math.colostate.edu/~bangerth/ 
>

-- 
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/ee9ae696-96f3-484b-bed1-fd7261f4655b%40googlegroups.com.

Reply via email to