Oh, now I see: You should write "Solution<dim>", not "Solution<dim+1>".
The template parameters gives the space dimension of the function, not
the number of components. The latter is specified in the constructor of
your class Solution through the argument (dim+1) to Function.

Best,
Martin


On 09/20/2016 04:54 PM, JAEKWANG KIM wrote:
> thanks!! Full error message is as follow 
>
>
> */Users/jaekwangjk/repos/trial/sphere-deal.ii/mystokes.cc:1258:7:
> **error: **no*
>
> *      matching function for call to 'integrate_difference'*
>
>       VectorTools::integrate_difference (dof_handler,
>
> *      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*
>
> */Users/jaekwangjk/repos/trial/sphere-deal.ii/mystokes.cc:1220:7:
> note: *in
>
>       instantiation of member function
>
>       'MyStokes::StokesProblem<2>::process_solution' requested here
>
>       process_solution ();
>
> *      ^*
>
> */Users/jaekwangjk/repos/trial/sphere-deal.ii/mystokes.cc:1298:21:
> note: *in
>
>       instantiation of member function 'MyStokes::StokesProblem<2>::run'
>
>       requested here
>
>        flow_problem.run ();
>
> *                    ^*
>
> */Users/jaekwangjk/Programs/dealii/include/deal.II/numerics/vector_tools.h:1940:8:
> note: *
>
>       candidate template ignored: could not match 'Function' against
> 'Solution'
>
>   void integrate_difference (const DoFHandler<dim,spacedim> &dof,
>
> *       ^*
>
> */Users/jaekwangjk/Programs/dealii/include/deal.II/numerics/vector_tools.h:1968:8:
> note: *
>
>       candidate template ignored: could not match 'dealii::hp::DoFHandler'
>
>       against 'dealii::DoFHandler'
>
>   void integrate_difference (const hp::DoFHandler<dim,spacedim> &dof,
>
> *       ^*
>
> */Users/jaekwangjk/Programs/dealii/include/deal.II/numerics/vector_tools.h:1925:8:
> note: *
>
>       candidate function template not viable: requires at least 7
> arguments, but
>
>       6 were provided
>
>   void integrate_difference (const Mapping<dim,spacedim>    &mapping,
>
> *       ^*
>
> */Users/jaekwangjk/Programs/dealii/include/deal.II/numerics/vector_tools.h:1953:8:
> note: *
>
>       candidate function template not viable: requires at least 7
> arguments, but
>
>       6 were provided
>
>   void integrate_difference (const hp::MappingCollection<dim,spacedim>
> &mapping,
>
>
>
>
> I will check the mapping as you advised for my other questions.!!!!!!
>
>
> 2016년 9월 20일 화요일 오전 9시 51분 13초 UTC-5, Martin Kronbichler 님의
> 말:
>
>     Jaekwang,
>
>     can you post the full error message? To me the call looks
>     reasonable (this is a copy from step-7) and the function
>     definition looks good as well.
>
>     Ah, and in case you want to use this in the context of your other
>     question regarding high order methods: Put a "mapping" as first
>     argument to this call and make sure to use
>     QGauss<dim>(fe.degree+2) or so, which increases the order of
>     quadrature as the element order gets higher.
>
>     Best,
>     Martin
>
>
>     On 09/20/2016 04:46 PM, JAEKWANG KIM wrote:
>>
>>      
>>
>>     I wanted to evaluate Vectortool::integrate_difference to estimate
>>     my error. 
>>
>>
>>
>>     but I couldn't figure out what I need to enter for the third
>>     component. (I marked it as red) 
>>
>>
>>
>>
>>          VectorTools::integrate_difference (dof_handler,
>>
>>                                              solution,
>>
>>                                              _Solution<dim+__1__>()_,
>>
>>                                              difference_per_cell,
>>
>>                                              QGauss<dim>(3),
>>
>>                                              VectorTools::L2_norm);
>>
>>
>>     I have solution vector over my domain,(by the way I am solving
>>     vector valued problems...)  
>>
>>     I want to compare this with continuous exact function, "May be
>>     Solution<dim+1>" , I have generated it as follow. 
>>
>>     However, I got a error message that 
>>
>>
>>     */Users/jaekwangjk/repos/trial/sphere-deal.ii/mystokes.cc:1258:7:
>>     **error: **no*
>>
>>     *      matching function for call to 'integrate_difference'*
>>
>>     *
>>     *
>>
>>     What's might be wrong with my code......
>>
>>
>>      template<intdim>
>>
>>         classSolution : publicFunction<dim>
>>
>>         {
>>
>>         public:
>>
>>         
>>
>>             Solution () : Function<dim>(dim+1) {}
>>
>>             
>>
>>             //const unsigned int b_id;
>>
>>             virtualdoublevalue (constPoint<dim>   &p,
>>
>>                                   constunsignedintcomponent = 0) const;
>>
>>             
>>
>>             virtualvoidvector_value (constPoint<dim> &p,
>>
>>                                        Vector<double>   &value) const;
>>
>>             
>>
>>         };
>>
>>         
>>
>>         
>>
>>         template<intdim>
>>
>>         double
>>
>>         Solution<dim>::value (constPoint<dim>  &p,
>>
>>                                     constunsignedintcomponent) const
>>
>>         {
>>
>>             Assert (component < this->n_components,
>>
>>                     ExcIndexRange (component, 0, this->n_components));
>>
>>             
>>
>>             doubleU=-1.; //inflow velocity
>>
>>             doubleobj_rad=0.2; //Object Radius
>>
>>             doubler_sph = sqrt( pow(p[0],2) + pow(p[1],2) );
>>
>>             doublephi = (-1) * acos(p[1]/r_sph);
>>
>>             
>>
>>             doubleq_r_sph=U*cos(phi)*( 1+
>>     0.5*pow(obj_rad,3)/pow(r_sph,3)-1.5*obj_rad/r_sph );
>>
>>             doubleq_phi=(-1)*
>>     U*sin(phi)*(1-0.25*pow(obj_rad,3)/pow(r_sph,3)-0.75*obj_rad/r_sph);
>>
>>             
>>
>>             doubleq_x=q_r_sph*sin(phi)+q_phi*cos(phi);
>>
>>             doubleq_y=(-1)*q_r_sph*cos(phi)+q_phi*sin(phi);
>>
>>             
>>
>>             
>>
>>             if(component == 0)
>>
>>                 returnq_x; 
>>
>>             if(component == 1)
>>
>>                 returnq_y;
>>
>>             else
>>
>>                 return0;  //
>>
>>             
>>
>>             
>>
>>         }
>>
>>
>>         template<intdim>
>>
>>         void
>>
>>         Solution<dim>::vector_value (constPoint<dim> &p,
>>
>>                                            Vector<double>   &values)
>>     const
>>
>>         {
>>
>>             for(unsignedintc=0; c<this->n_components; ++c)
>>
>>                 values(c) = Solution<dim>::value (p, c);
>>
>>         }
>>
>>
>>     -- 
>>     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
>>     <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 <javascript:>.
>>     For more options, visit https://groups.google.com/d/optout
>>     <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
> <mailto:dealii+unsubscr...@googlegroups.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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to