Re: [deal.II] VectorTools::integrate_difference function

2016-09-20 Thread JAEKWANG KIM
Thank you for all the repliers!
All of you gave me a good advice that I may consider deeply when I write my 
code from now
I have figured out what was wrong. 
Seeing at Step 20 code, I realized that I have to select component of 
solution before going to compare the difference. 

const ComponentSelectFunction

pressure_mask (dim, dim+1);

const ComponentSelectFunction

velocity_mask(std::make_pair(0, dim), dim+1);



Solution exact_solution;

Vector cellwise_errors (triangulation.n_active_cells());

   

QTrapez<1> q_trapez;

QIterated quadrature (q_trapez, degree+2);



// With this, we can then let the library compute the errors and 
output

// them to the screen:

VectorTools::integrate_difference (dof_handler, solution, 
exact_solution,

   cellwise_errors, quadrature,

   VectorTools::L2_norm,

   &pressure_mask);

const double p_l2_error = cellwise_errors.l2_norm();



VectorTools::integrate_difference (dof_handler, solution, 
exact_solution,

   cellwise_errors, quadrature,

   VectorTools::L2_norm,

   &velocity_mask);

const double u_l2_error = cellwise_errors.l2_norm();




-- 
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.


Re: [deal.II] VectorTools::integrate_difference function

2016-09-20 Thread Wolfgang Bangerth

On 09/20/2016 09:04 AM, JAEKWANG KIM wrote:

yes...I tried that before, but I get an error message as follow..


As a general workflow, you need to
1/ make the code compile
2/ run it without any runtime error
3/ make sure the results are correct.

In your original message, you were stopped in 1 because the compiler 
complained about Solution where it should have been 
Solution. You then fixed this, and got a run time error, i.e., you 
were stopped in step 2.


This is *progress*. But you saw an error and instead went back to 
Solution. This makes no sense. A program typically has many bugs. 
You need to work on them one after the other, until you pass step 3. It 
may mean that you need to fix multiple compile errors first before you 
can run the code, and fix multiple runtime errors before you get any 
solution.


Best
 W.


--

Wolfgang Bangerth  email: bange...@colostate.edu
   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.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] VectorTools::integrate_difference function

2016-09-20 Thread Daniel Arndt
...of course I meant dof_handler.distribute_dofs(). Does the DoFhandler 
know at this point about the Trinagulation?

Best,
Daniel

Am Dienstag, 20. September 2016 17:58:02 UTC+2 schrieb Daniel Arndt:
>
> Jaekwang,
>
> This seems to be unrelated. Did you setup the Triangulation before calling 
> fe.distribute_dofs()?
>
> Best,
> Daniel
>
> Am Dienstag, 20. September 2016 17:04:02 UTC+2 schrieb JAEKWANG KIM:
>>
>> yes...I tried that before, but I get an error message as follow.. 
>>
>> As you mentioned, I first learn this function in step 7 tutorial. 
>> But the problem is that I want to integrate my vector-valued-solution to 
>> exact-vector-valued solution, while step 7 compares scalar-solution. 
>>
>> Or is there any ways to compare each solution component separately? as it 
>> did in step-7. 
>>
>> I am really thank you for your advice!
>>
>>
>> An error occurred in line <235> of file 
>>  in 
>> function
>>
>> static types::global_dof_index 
>> dealii::internal::DoFHandler::Policy::Implementation::distribute_dofs(const 
>> types::global_dof_index, const types::subdomain_id, DoFHandler> spacedim> &) [dim = 2, spacedim = 2]
>>
>> The violated condition was: 
>>
>> tria.n_levels() > 0
>>
>> The name and call sequence of the exception was:
>>
>> ExcMessage("Empty triangulation")
>>
>> Additional Information: 
>>
>> Empty triangulation
>>
>>
>> Stacktrace:
>>
>> ---
>>
>> #0  2   libdeal_II.g.8.4.1.dylib0x000104ef307c 
>> _ZN6dealii8internal10DoFHandler6Policy14Implementation15distribute_dofsILi2ELi2EEEjjjRNS_10DoFHandlerIXT_EXT0_EEE
>>  
>> + 300: 2   libdeal_II.g.8.4.1.dylib0x000104ef307c 
>> _ZN6dealii8internal10DoFHandler6Policy14Implementation15distribute_dofsILi2ELi2EEEjjjRNS_10DoFHandlerIXT_EXT0_EEE
>>  
>>
>> #1  3   libdeal_II.g.8.4.1.dylib0x000104ef2d97 
>> _ZNK6dealii8internal10DoFHandler6Policy10SequentialILi2ELi2EE15distribute_dofsERNS_10DoFHandlerILi2ELi2EEERNS1_11NumberCacheE
>>  
>> + 39: 3   libdeal_II.g.8.4.1.dylib0x000104ef2d97 
>> _ZNK6dealii8internal10DoFHandler6Policy10SequentialILi2ELi2EE15distribute_dofsERNS_10DoFHandlerILi2ELi2EEERNS1_11NumberCacheE
>>  
>>
>> #2  4   libdeal_II.g.8.4.1.dylib0x000104eb6797 
>> _ZN6dealii10DoFHandlerILi2ELi2EE15distribute_dofsERKNS_13FiniteElementILi2ELi2EEE
>>  
>> + 135: 4   libdeal_II.g.8.4.1.dylib0x000104eb6797 
>> _ZN6dealii10DoFHandlerILi2ELi2EE15distribute_dofsERKNS_13FiniteElementILi2ELi2EEE
>>  
>>
>> #3  5   mystokes0x000101350e7d 
>> _ZN8MyStokes13StokesProblemILi2EE10setup_dofsEv + 397: 5   mystokes
>> 0x000101350e7d 
>> _ZN8MyStokes13StokesProblemILi2EE10setup_dofsEv 
>>
>> #4  6   mystokes0x000101341a52 
>> _ZN8MyStokes13StokesProblemILi2EE3runEv + 386: 6   mystokes
>> 0x000101341a52 _ZN8MyStokes13StokesProblemILi2EE3runEv 
>>
>> #5  7   mystokes0x000101340aa5 main + 69: 
>> 7   mystokes0x000101340aa5 main 
>>
>> #6  8   libdyld.dylib   0x7fff95b575ad start + 1: 
>> 8   libdyld.dylib   0x7fff95b575ad start 
>>
>> #7  9   ??? 0x0001 0x0 + 1: 9 
>>   ??? 0x0001 0x0 
>>
>>

-- 
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.


Re: [deal.II] VectorTools::integrate_difference function

2016-09-20 Thread Daniel Arndt
Jaekwang,

This seems to be unrelated. Did you setup the Triangulation before calling 
fe.distribute_dofs()?

Best,
Daniel

Am Dienstag, 20. September 2016 17:04:02 UTC+2 schrieb JAEKWANG KIM:
>
> yes...I tried that before, but I get an error message as follow.. 
>
> As you mentioned, I first learn this function in step 7 tutorial. 
> But the problem is that I want to integrate my vector-valued-solution to 
> exact-vector-valued solution, while step 7 compares scalar-solution. 
>
> Or is there any ways to compare each solution component separately? as it 
> did in step-7. 
>
> I am really thank you for your advice!
>
>
> An error occurred in line <235> of file 
>  in 
> function
>
> static types::global_dof_index 
> dealii::internal::DoFHandler::Policy::Implementation::distribute_dofs(const 
> types::global_dof_index, const types::subdomain_id, DoFHandler spacedim> &) [dim = 2, spacedim = 2]
>
> The violated condition was: 
>
> tria.n_levels() > 0
>
> The name and call sequence of the exception was:
>
> ExcMessage("Empty triangulation")
>
> Additional Information: 
>
> Empty triangulation
>
>
> Stacktrace:
>
> ---
>
> #0  2   libdeal_II.g.8.4.1.dylib0x000104ef307c 
> _ZN6dealii8internal10DoFHandler6Policy14Implementation15distribute_dofsILi2ELi2EEEjjjRNS_10DoFHandlerIXT_EXT0_EEE
>  
> + 300: 2   libdeal_II.g.8.4.1.dylib0x000104ef307c 
> _ZN6dealii8internal10DoFHandler6Policy14Implementation15distribute_dofsILi2ELi2EEEjjjRNS_10DoFHandlerIXT_EXT0_EEE
>  
>
> #1  3   libdeal_II.g.8.4.1.dylib0x000104ef2d97 
> _ZNK6dealii8internal10DoFHandler6Policy10SequentialILi2ELi2EE15distribute_dofsERNS_10DoFHandlerILi2ELi2EEERNS1_11NumberCacheE
>  
> + 39: 3   libdeal_II.g.8.4.1.dylib0x000104ef2d97 
> _ZNK6dealii8internal10DoFHandler6Policy10SequentialILi2ELi2EE15distribute_dofsERNS_10DoFHandlerILi2ELi2EEERNS1_11NumberCacheE
>  
>
> #2  4   libdeal_II.g.8.4.1.dylib0x000104eb6797 
> _ZN6dealii10DoFHandlerILi2ELi2EE15distribute_dofsERKNS_13FiniteElementILi2ELi2EEE
>  
> + 135: 4   libdeal_II.g.8.4.1.dylib0x000104eb6797 
> _ZN6dealii10DoFHandlerILi2ELi2EE15distribute_dofsERKNS_13FiniteElementILi2ELi2EEE
>  
>
> #3  5   mystokes0x000101350e7d 
> _ZN8MyStokes13StokesProblemILi2EE10setup_dofsEv + 397: 5   mystokes
> 0x000101350e7d 
> _ZN8MyStokes13StokesProblemILi2EE10setup_dofsEv 
>
> #4  6   mystokes0x000101341a52 
> _ZN8MyStokes13StokesProblemILi2EE3runEv + 386: 6   mystokes
> 0x000101341a52 _ZN8MyStokes13StokesProblemILi2EE3runEv 
>
> #5  7   mystokes0x000101340aa5 main + 69: 
> 7   mystokes0x000101340aa5 main 
>
> #6  8   libdyld.dylib   0x7fff95b575ad start + 1: 
> 8   libdyld.dylib   0x7fff95b575ad start 
>
> #7  9   ??? 0x0001 0x0 + 1: 9 
>   ??? 0x0001 0x0 
>
>

-- 
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.


Re: [deal.II] VectorTools::integrate_difference function

2016-09-20 Thread JAEKWANG KIM
yes...I tried that before, but I get an error message as follow.. 

As you mentioned, I first learn this function in step 7 tutorial. 
But the problem is that I want to integrate my vector-valued-solution to 
exact-vector-valued solution, while step 7 compares scalar-solution. 

Or is there any ways to compare each solution component separately? as it 
did in step-7. 

I am really thank you for your advice!


An error occurred in line <235> of file 
 in 
function

static types::global_dof_index 
dealii::internal::DoFHandler::Policy::Implementation::distribute_dofs(const 
types::global_dof_index, const types::subdomain_id, DoFHandler &) [dim = 2, spacedim = 2]

The violated condition was: 

tria.n_levels() > 0

The name and call sequence of the exception was:

ExcMessage("Empty triangulation")

Additional Information: 

Empty triangulation


Stacktrace:

---

#0  2   libdeal_II.g.8.4.1.dylib0x000104ef307c 
_ZN6dealii8internal10DoFHandler6Policy14Implementation15distribute_dofsILi2ELi2EEEjjjRNS_10DoFHandlerIXT_EXT0_EEE
 
+ 300: 2   libdeal_II.g.8.4.1.dylib0x000104ef307c 
_ZN6dealii8internal10DoFHandler6Policy14Implementation15distribute_dofsILi2ELi2EEEjjjRNS_10DoFHandlerIXT_EXT0_EEE
 

#1  3   libdeal_II.g.8.4.1.dylib0x000104ef2d97 
_ZNK6dealii8internal10DoFHandler6Policy10SequentialILi2ELi2EE15distribute_dofsERNS_10DoFHandlerILi2ELi2EEERNS1_11NumberCacheE
 
+ 39: 3   libdeal_II.g.8.4.1.dylib0x000104ef2d97 
_ZNK6dealii8internal10DoFHandler6Policy10SequentialILi2ELi2EE15distribute_dofsERNS_10DoFHandlerILi2ELi2EEERNS1_11NumberCacheE
 

#2  4   libdeal_II.g.8.4.1.dylib0x000104eb6797 
_ZN6dealii10DoFHandlerILi2ELi2EE15distribute_dofsERKNS_13FiniteElementILi2ELi2EEE
 
+ 135: 4   libdeal_II.g.8.4.1.dylib0x000104eb6797 
_ZN6dealii10DoFHandlerILi2ELi2EE15distribute_dofsERKNS_13FiniteElementILi2ELi2EEE
 

#3  5   mystokes0x000101350e7d 
_ZN8MyStokes13StokesProblemILi2EE10setup_dofsEv + 397: 5   mystokes
0x000101350e7d 
_ZN8MyStokes13StokesProblemILi2EE10setup_dofsEv 

#4  6   mystokes0x000101341a52 
_ZN8MyStokes13StokesProblemILi2EE3runEv + 386: 6   mystokes
0x000101341a52 _ZN8MyStokes13StokesProblemILi2EE3runEv 

#5  7   mystokes0x000101340aa5 main + 69: 7 
  mystokes0x000101340aa5 main 

#6  8   libdyld.dylib   0x7fff95b575ad start + 1: 8 
  libdyld.dylib   0x7fff95b575ad start 

#7  9   ??? 0x0001 0x0 + 1: 9   
??? 0x0001 0x0 

-- 
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.


Re: [deal.II] VectorTools::integrate_difference function

2016-09-20 Thread Martin Kronbichler
Oh, now I see: You should write "Solution", not "Solution".
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 &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 &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&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
> &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(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()_,
>>
>>  difference_per_cell,
>>
>>  QGauss(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" , 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
>>
>> classSolution : publicFunction
>>
>> {
>>
>> public:
>>
>> 
>>
>> Solution () : Function(dim+1) {}
>>
>> 
>>
>> //const unsigned int b_id;
>>
>> virtualdoublevalue (constPoint   &p,
>>
>>   constunsignedintcomponent = 0) const;
>>
>> 
>>
>> virtualvoidvector_value (constPoint &p,
>>
>>Vector   &value) const;
>>
>> 
>>
>> };
>>
>> 
>>
>> 
>>
>> template
>>
>> double
>>
>> Solution::value (constPoint  &p,
>>
>> constunsignedintcomponent) const
>>
>> {
>>
>> Assert (component < this->n_components,
>>
>> ExcIndexRange (component, 0, this->n_components)

Re: [deal.II] VectorTools::integrate_difference function

2016-09-20 Thread 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(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()_,
>
>  difference_per_cell,
>
>  QGauss(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" , 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
>
> classSolution : publicFunction
>
> {
>
> public:
>
> 
>
> Solution () : Function(dim+1) {}
>
> 
>
> //const unsigned int b_id;
>
> virtualdoublevalue (constPoint   &p,
>
>   constunsignedintcomponent = 0) const;
>
> 
>
> virtualvoidvector_value (constPoint &p,
>
>Vector   &value) const;
>
> 
>
> };
>
> 
>
> 
>
> template
>
> double
>
> Solution::value (constPoint  &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
>
> void
>
> Solution::vector_value (constPoint &p,
>
>Vector   &values) const
>
> {
>
> for(unsignedintc=0; cn_components; ++c)
>
> values(c) = Solution::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
> ---
> 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.

-- 
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.


Re: [deal.II] VectorTools::integrate_difference function

2016-09-20 Thread JAEKWANG KIM
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 &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 &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&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 
&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(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()*,
>
>  difference_per_cell,
>
>  QGauss(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" , 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 
>
> class Solution : public Function
>
> {
>
> public:
>
> 
>
> Solution () : Function(dim+1) {}
>
> 
>
> //const unsigned int b_id;
>
> virtual double value (const Point   &p,
>
>   const unsigned int component = 0) const;
>
> 
>
> virtual void vector_value (const Point &p,
>
>Vector   &value) const;
>
> 
>
> };
>
> 
>
> 
>
> template 
>
> double
>
> Solution::value (const Point  &p,
>
> const unsigned int component) const
>
> {
>
> Assert (component < this->n_components,
>
> ExcIndexRange (component, 0, this->n_components));
>
> 
>
> double U=-1.; //inflow velocity
>
> double obj_rad=0.2; //Object Radius
>
> double r_sph = sqrt( pow(p[0],2) + pow(p[1],2) );
>
> double phi = (-1) * acos(p[1]/r_sph);
>
> 
>
> double q_r_sph=U*cos(phi)*( 1+ 
> 0.5*pow(obj_rad,3)/pow(r_sph,3)-1.5*obj_rad/r_sph 
> );
>
> double q_phi=(-1)* U*sin(phi)*(1 -0.25 *pow(obj_rad,3)/pow(r_sph,3
> )-0.75*obj_rad/r_sph);
>
> 
>
> double q_x=q_r_sph*sin(phi)+q_phi*cos(phi);
>
> double q_y=(-1)*q_r_sph*cos(phi)+q_phi*sin(phi);
>
> 
>
> 
>
> if (component == 0)
>
> return q_x; 
>
> if (component == 1)
>
> return q_y;
>
> else
>
> return 0;  

[deal.II] VectorTools::integrate_difference function

2016-09-20 Thread JAEKWANG KIM


 

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()*,

 difference_per_cell,

 QGauss(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" , 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 

class Solution : public Function

{

public:



Solution () : Function(dim+1) {}



//const unsigned int b_id;

virtual double value (const Point   &p,

  const unsigned int component = 0) const;



virtual void vector_value (const Point &p,

   Vector   &value) const;



};





template 

double

Solution::value (const Point  &p,

const unsigned int component) const

{

Assert (component < this->n_components,

ExcIndexRange (component, 0, this->n_components));



double U=-1.; //inflow velocity

double obj_rad=0.2; //Object Radius

double r_sph = sqrt( pow(p[0],2) + pow(p[1],2) );

double phi = (-1) * acos(p[1]/r_sph);



double q_r_sph=U*cos(phi)*( 1+ 
0.5*pow(obj_rad,3)/pow(r_sph,3)-1.5*obj_rad/r_sph 
);

double q_phi=(-1)* U*sin(phi)*(1 -0.25 *pow(obj_rad,3)/pow(r_sph,3)-
0.75*obj_rad/r_sph);



double q_x=q_r_sph*sin(phi)+q_phi*cos(phi);

double q_y=(-1)*q_r_sph*cos(phi)+q_phi*sin(phi);





if (component == 0)

return q_x; 

if (component == 1)

return q_y;

else

return 0;  //





}


template 

void

Solution::vector_value (const Point &p,

   Vector   &values) const

{

for (unsigned int c=0; cn_components; ++c)

values(c) = Solution::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
--- 
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.