Dear John,

Thank you for your kind help.

At least I got one way, just as a temporary solution:
I set a global string outside everything, namely, std::string project_var, then 
in the function
Number init_value (const Point& p,
                   const Parameters& parameters,
                   const std::string& sysname,
                   const std::string& varname)
{
Number result;
if (boost::iequals(varname, project_var))
{
  Real _time =parameters.get<Real> ("time");
  auto _func=_init_conditioner->get_func(sysname,varname);
  result=(*_func)(p, _time);
}
return result;
}

Finally in the main() code,
if(!_init_conditioner->empty())
    {
      project_var=string("u");
      system.project_solution(init_value, NULL, equation_systems.parameters);
      project_var=string("v");
      system.project_solution(init_value, NULL, equation_systems.parameters);
      project_var=string("p");
      system.project_solution(init_value, NULL, equation_systems.parameters);
        write_results(equation_systems,mesh,0,string("init_test.e"));
        std::cout<<"Solution Initialized in init_test.e"<<endl;
    }

This is not perfect, but it does work!
Probably you may have a better idea on that?

BTW, the mail server here may have some problems, if you got several copy of 
this mail.
Delete them plz. Sorry about it.

Zhenyu

------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to