> 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. > > very clear explaination, I greatly appreciate you experts help. Now I am succeed in setting different variables' initial conditions! Thanks!
Liang ------------------------------------------------------------------------------ Download Intel® 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
