Krishna,

I tried using the VectorTools::project idea from step-25. However, my code fails to compile, and I could not decipher the errors and do not know how to fix this problem (have been stuck for a while).

The attached code tries to implement Step-52 (but for 1D), with homogenous dirichelet BC  at the left edge and homogenous Neumann BC at the right edge, with an initial value of 4/5*x*(1 - x/5) (a simple quadratic function). I am also attaching the CMakeLists.txt (adapted from Step-52 suitably).

I'd appreciate help (from you and others here on the forum) to solve this issue.

You really need to learn how to read error messages because this is really a rather simple case. The error you get is this:

/home/bangerth/p/deal.II/1/install/examples/step-1/step-1.cc:362:26: error: ‘Step52::InitialValues’ is not a template
                          InitialValues<1>(1, time),
                          ^~~~~~~~~~~~~
/home/bangerth/p/deal.II/1/install/examples/step-1/step-1.cc:362:50: error: no matching function for call to ‘Step52::InitialValues::InitialValues(int, time_t (&)(time_t*) throw ())’
                          InitialValues<1>(1, time),
                                                  ^

So you already know exactly what the line in question may be. There aren't all that many possibilities for what could be wrong. The issue in your case is that the 'time' variable doesn't exist in the function where you have the code in question. The obscurity of the actual error message comes from the fact that there is a global time() function. But in the end, this is a case where you could have found the solution yourself.

So just replace time->0 if you want the initial values and everything should 
work.

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/86f05575-28b3-80f3-cfa2-4dc89247f923%40colostate.edu.

Reply via email to