You are projecting a function called 'exact_value' but modifying a function called 'exact_solution'??
-Ben ----- Original Message ----- From: liang cheng <[email protected]> To: David Knezevic <[email protected]> Cc: libmesh-users <[email protected]> Sent: Sat Mar 13 20:38:54 2010 Subject: Re: [Libmesh-users] initial condition for 2 variables Hi David, Developers and users, I did something on the input code, but still can't assign the initial values to the specific variable. My goal is setting two variables' initials. To simplify the case now, I only set the 'n2' parameter and leave 'n1' be zero, but it looks both 'n1' and 'n2' are assigned initial values. The bond font represents the added. I am not good at c++, would you please tell me anything wrong below? Thanks! Liang =========================================================== Real exact_solution (const Real x, const Real y, const Real t, *const std::string n_i*); Number exact_value (const Point& p, const Parameters& parameters, const std::string&, const std::string& *n_i*) { return exact_solution(p(0), p(1), parameters.get<Real> ("time") *,"n2"*); } .......... void init_lc (EquationSystems& es, const std::string& system_name) { libmesh_assert (system_name == "hw8-2d"); TransientLinearImplicitSystem & system = es.get_system<TransientLinearImplicitSystem>("hw8-2d"); es.parameters.set<Real> ("time") = 0; system.project_solution(exact_value, NULL, es.parameters); } Real exact_solution (const Real x, const Real y, const Real t, *const std::string n_i*) { if (n_i == "n1") return 111.111; else if (n_i == "n2") return 222.222; } ============ output ====================== Variables=x,y,z,n1,n2 Zone f=fepoint, n=441, e=400, et=quadrilateral, c=black 0.00000 0.00000 0.00000 222.222 222.222 0.100000 0.00000 0.00000 222.222 222.222 0.100000 0.100000 0.00000 222.222 222.222 0.00000 0.100000 0.00000 222.222 222.222 0.0500000 0.00000 0.00000 222.222 222.222 ------------------------------------------------------------------------------ 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 ------------------------------------------------------------------------------ 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
