User-defined material SLOW analysis
Moderators: silvia, selimgunay, Moderators
User-defined material SLOW analysis
I am running nonlinear time history analysis with a model that includes a user-defined material, compiled in C++. Compared to the same model using only elements from the OpenSees library, the analysis is substantially slower. Is this typical? Any tips to improve this problem?
Re: User-defined material SLOW analysis
I've used a user defined element,and the analysis became slow (20% of original speed) when I added a bunch of calculations in the element itself.A trick I used to speed it up was to alter some existing methods (eg corrdinate transformation) to do there some of the calculations,without having to overwrite variables again and again.Things went faster,but again...slower than the original.
So the impression I got,is that it really depends on the amount of calculations you do.And dynamic memmory allocation perhaps.But I don't know much about the second.
So the impression I got,is that it really depends on the amount of calculations you do.And dynamic memmory allocation perhaps.But I don't know much about the second.
Re: User-defined material SLOW analysis
i never looked to see if there was any slowdown associated with the .dll approach. it could be due to a number of reasons:
1) a penalty due to invoking the methods in a .dll: a somewhat easy fix, you need to build the .exe with your code included.
2) make sure you are building the release version of the .dll and not a debug version
3) your code is slow. other than time sent in the solver, the next big hog of time for fiber based models is in the material. you may need to rewrite your
code if 1) and 2) above do not solve your problem.
1) a penalty due to invoking the methods in a .dll: a somewhat easy fix, you need to build the .exe with your code included.
2) make sure you are building the release version of the .dll and not a debug version
3) your code is slow. other than time sent in the solver, the next big hog of time for fiber based models is in the material. you may need to rewrite your
code if 1) and 2) above do not solve your problem.
Re: User-defined material SLOW analysis
1) is not the problem, the .exe was built with the code. I need to check 2) I didn't write the code, a colleague did.
Thank you for the response, Frank.
Thank you for the response, Frank.
Re: User-defined material SLOW analysis
Frank, turns out #2 was the issue. We built the release version and now the analysis runs at normal Opensees speed. Thanks for your help!