Liang wrote: > Hi Developers and Users, > > I am using 'exact_solution' function to set the initial condition for > variables u and v respectively in my 2D model, but the > system.project_solution function always assign the same value to both > variables, how can I set the various initial conditions for 2 variables? > ex8/9/10 contains only one variable u, I really have no idea on > this thing, is it helpful I dig into the source code > system_projection.C ? thanks!
If you have a look in the function project_solution in $LIBMESH_DIR/include/systems/system.h you'll see that the function pointers that project_solution accepts take a string argument "unknown_name." This is the name of the variable that is being assigned by project_solution, so, looking at ex9, you would modify "exact_solution" so it accepts an extra string argument and pass "unknown_name" to "exact_solution" in "exact_value." Then you just need to check the value of unknown_name in your exact_solution function and return the appropriate value. - Dave ------------------------------------------------------------------------------ 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
