Good day,
I have just run another calculation cycle of my API code and I have the feeling that each new load case created and calculated requires more computation time (the program iteratively calculates new load cases → evaluates → creates new load case → calculates it…).
My theory: due to the incredible amount of result data, computing resources such as memory etc. are being used, which beyond a certain number of load cases affects the subsequent calculations.
Since I automatically save the key results with their respective effects and parameters in an Excel file via Python, it would therefore be wise to simply delete the results after each calculation => unfortunately, it seems to me that currently it is only possible to delete the entire load case, which I would be reluctant to do, as it is quite practical to be able to review certain configurations again later on (not just automated by the code) and to recalculate them individually in the model and evaluate them through the GUI.
Is there a way, via the API, to delete only the results of the last calculated load case without deleting the load case itself?
Best regards
Nick
Hi DeflectionPerfection,
unfortunately, the desired function is not yet available in the API. As always in such cases, I have submitted a request to the developers (RUS ID 6232).
Until then, you can manage by making a change that automatically deletes the results. For example:
from dlubal.api import rfem
with rfem.Application(port=9000) as rfem_app:
delete_value=999.0
original_value=750.0
rfem_app.update_object(
rfem.loads.SurfaceLoad(
no=1,
load_case=1,
uniform_magnitude=delete_value,
),
)
rfem_app.update_object(
rfem.loads.SurfaceLoad(
no=1,
load_case=1,
uniform_magnitude=original_value,
),
)
rfem_app.calculate_specific(
loadings=[
rfem.ObjectId(
no=1,
object_type=rfem.OBJECT_TYPE_LOAD_COMBINATION
)
],
skip_warnings=True,
)
Of course, these are two requests, but you do not have to delete the results after every iteration.
Unfortunately, there is currently a bug in the method 'calculate_specific', which will be fixed in the next version. So you will have to be patient until next week to use this workaround.
I hope this helps you.
Best regards
Robert Milrath
1 Like
Thank you very much!
That really is a clever option that I could have thought of myself.
Best regards, Nick
Hi DeflectionPerfection,
with version 2.14.3, calculate_specific should also work again as usual.
Best regards
Robert Milrath