Hi,
I am trying to change the parameters of some objects in my model during integration of the equations. Following is a snippet of the code I am using. After time t=1, I change the properties of HuntCrossley force and then re-initialize the model so the new values assume after that.
My problem is that the integration aborts at the line 'si = osimModel.initSystem();' with a generic error message that reads in part: "(process 14144) exited with code -1073741819." Am I doing this wrongly? Could someone give me guidance on the correct way to do this?
Thanks.
Re-initializing Model:
- Dimitar Stanev
- Posts: 1096
- Joined: Fri Jan 31, 2014 5:14 am
Re: Re-initializing Model:
You can enclose your code into a try and catch statement, print the exception (if any) and pause the execution.
Code: Select all
#include <cstdio>
int main(int argc, char *argv[]) {
try {
// your code
}
catch (exception &e) {
cout << e.what() << endl;
getc();
return -1;
}
return 0;
}
- Ayman Habib
- Posts: 2244
- Joined: Fri Apr 01, 2005 12:24 pm
Re: Re-initializing Model:
Hello,
Can you give an example of what you mean by changing the parameters of the model "during integration"? Basically the integrator does not expect the layout of the State to be modified underneath it. Based on how entries in the State are created/allocated, you may need to recreate the State entirely.
-Ayman
Can you give an example of what you mean by changing the parameters of the model "during integration"? Basically the integrator does not expect the layout of the State to be modified underneath it. Based on how entries in the State are created/allocated, you may need to recreate the State entirely.
-Ayman