Re: [Libmesh-users] segmentation fault after projection solution

2015-04-20 Thread Zhang
Furthermore, Finally I also found the real reason of the crash in the first email. It is my own fault: the last variable, lambda, as the Lagrange multiplier is also required with a branch in init_value(). Since there is a call to a function pointer to lambda, definitely there is an error. This

Re: [Libmesh-users] segmentation fault after projection solution

2015-04-20 Thread Zhang
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, co

Re: [Libmesh-users] segmentation fault after projection solution

2015-04-20 Thread John Peterson
On Mon, Apr 20, 2015 at 11:32 AM, Zhenyu Zhang wrote: > Here I tried to add an if block in init_value(), > if (boost::iequals(varname, string("p"))) > { > ... // calculate the return value like before > } > > Then the setting of initial values worked. > > Since the above code only work for one va

Re: [Libmesh-users] segmentation fault after projection solution

2015-04-20 Thread Zhenyu Zhang
PM To: "Zhenyu Zhang"; Cc: "libmesh-users"; Subject: Re: [Libmesh-users] segmentation fault after projection solution On Mon, Apr 20, 2015 at 8:04 AM, grandrabbit wrote: Hello, I wrote a class for set up initial values and called it by system.attach_in

Re: [Libmesh-users] segmentation fault after projection solution

2015-04-20 Thread grandrabbit
nal -- From: "John Peterson";; Send time: Monday, Apr 20, 2015 10:37 PM To: "grandrabbit"; Cc: "libmesh-users"; Subject: Re: [Libmesh-users] segmentation fault after projection solution On Mon, Apr 20, 2015 at 8:04 AM, grandrabbit wrote: Hel

Re: [Libmesh-users] segmentation fault after projection solution

2015-04-20 Thread John Peterson
On Mon, Apr 20, 2015 at 8:04 AM, grandrabbit wrote: > Hello, > > I wrote a class for set up initial values and called it by > system.attach_init_function (init_sys); > > Here is the part of init_sys > > void init_sys(EquationSystems& es,const std::string& system_name) > { > Syst

[Libmesh-users] segmentation fault after projection solution

2015-04-20 Thread grandrabbit
Hello, I wrote a class for set up initial values and called it by system.attach_init_function (init_sys); Here is the part of init_sys void init_sys(EquationSystems& es,const std::string& system_name) { System & system = es.get_system(system_name); vector< string >