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 morning I changed the code of accessing the function pointers
from initcondition* to boost::shared_ptr<initcondition>. Then
in the error message, it shows,
icaruslm: /usr/include/boost/smart_ptr/shared_ptr.hpp:653: typename
boost::detail::sp_member_access<T>::type boost::shared_ptr<T>::operator->()
const [with T = Icarus::InitConditionItem; typename
boost::detail::sp_member_access<T>::type = Icarus::InitConditionItem*]:
Assertion `px != 0' failed.
which is much more readable and makes it easier to locate this reason.
BTW, I also notice a problem when I output variable information to cout:
in the old code, I write follows to screen,
1: std::cout<<sysname<<"."<<varname<<": ----";
2: _func=...
3: result=(*_func)(p,time);
4: std::cout<<<<"("<<p(0)<<","<<p(1)<<","<<p(2)<<"), "
5: <<"t= "<<_time
6: <<", ipoint="<<ipoint<<"---------";
7: cout<<", value= "<<result<<endl;
If there's anything wrong with _func, then the whole message from line 1 to 7
will not flush to cout. Then no error, unless I added endl() exactly before
calling _func.
Anyway, thank you very much for you help.
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