On Sun, Mar 14, 2010 at 10:07 AM, liang cheng <[email protected]> wrote:
>
>
>
> Number exact_value (const Point& p,
>                         const Parameters& parameters,
>                         const std::string&,
>                         const std::string& unknown_name) // fptr
> {
>    unknown_name =
> "n2";                                                             //can't
> pass the compiling!!!!!!!

unknown_name is declared constant, you can't change it within this function.

Basically you just need the if-statements in exact_value(), the System
will use this function to set the initial condition for *all* the
variables in the system.

Check out the code of 'System::ProjectSolution::operator()' in
src/systems/system_projection.C.  This is what actually gets called
internally to System::project_solution.

It loops over all variables and calls your exact solution function
with each variable name in turn to set the values.  That is, the
library is responsible for setting the current unknown_name, not the
user.  The user code must simply be able to return an exact value for
any of the unknowns that make up the system, which your simple example
looks like it is already doing.

-- 
John

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to