I'm trying to extract total stresses for a dynamic analysis on all my stress points using python. Compared to getting data form the curves manager, this method incredibly slow as the getcurveresults command is executed from the command line incredibly slowly. Is there a way to speed this process up or an alternative approach to directly interact with the curves manager? I want to replicate what I can get from the curves manager with a dynamic time vs stress plot. Code is below.
with open('data.csv', 'w') as f: write = csv.writer(f) write.writerow(['Stresspoint', 'Phase', 'Step', 'Dynamic Time', 'SigXX', 'SigYY', 'SigXY']) # look into all stresspoints, all phases, all steps: for node in g_o.CurvePoints.StressPoints[:]: for phase in g_o.Phases[:]: for step in phase.Steps.value: # get the required stresses sigXs= g_o.getcurveresults(node, step, g_o.ResultTypes.Soil.SigxxT) sigYs=g_o.getcurveresults(node, step, g_o.ResultTypes.Soil.SigyyT) sigXYs=g_o.getcurveresults(node, step, g_o.ResultTypes.Soil.Sigxy) # make sure step info on time is available, then add it: timevalue = "-" if hasattr(step, 'Reached'): if hasattr(step.Reached, 'Time'): timevalue = step.Reached.DynamicTime.value # creates a data row for values write.writerow([node.Number.value,phase.Name.value,int(step.Name.value.replace("Step_", "")),timevalue,sigXs,sigYs,sigXYs])
Dear Stephen,
A similar question was posted here: https://communities.bentley.com/products/geotech-analysis/f/plaxis-soilvision-forum/206692/automated-evaluation-and-data-export-takes-a-very-long-time
To save you a click here's our comment on this:
You are right that currently the performance when trying to retrieve the results of multipliers or in general the .Reached object per step is quite poor. We are working on a solution for this that will improve the overall performance when retrieving results for both normal Output experience but also via scripting (i.e. via command line).
I have added your feedback to our report so that this is considered.
My approach would be to try and narrow down to the process that takes the longest and find an alternative, e.g. for the DynamicTime, I guess that for a dynamic analysis the time step would be well defined in Input and easy to compute with Python and not rely on PLAXIS to report it.
In the end, having an automation do the job is better than having to do it manually, but ,of course, we acknowledge the performance issue here and we are working in the direction of improving that.