Results

Results of an analysis are accessed through under the Results property of the Analysis class: To select a material nammed Toe drain for example:

#geofile is a GeoStudioFile instance
geofile.showAnalysisTree()
analysis1 = geofile.getAnalysisByID(1)
results1 = analysis1["Results"]

This will return an instance of the Results class which handle permit to import the results in Python. Detail of the methods available are below:

class PyGeoStudio.Results(f_src, analysis, mesh=None)
exportAllResultsVTU(path)

Export all the results of the analysis for post-processing with Paraview software. Export is handle by MeshIO.

Parameters:

path (str) – Path to the output file

getOutputTimes()

Return the timestep saved

Returns:

The timestep

Return type:

list

getOutputVariables()

Return a list of the output variables in the results

Returns:

the list

Return type:

list

getSnapshot(variable, time=None)

Extract the variable on the whole domain but at one particular time.

Parameters:
  • variable (str) – Name of variable desired (must match the name from getOutputVariables)

  • time (float) – Time at which to retrieve variable value (required for transient analysis)

Returns:

Variable values ordered by node ID

Return type:

numpy.array

getVariablesVsTime(variable, locations)

Extract the variable at the locations given against all timestep.

Parameters:
  • variable (str) – Name of variable desired (must match the name from getOutputVariables)

  • locations (list) – Location at which to retrive variable value

Returns:

Time and variable values at different location and all times

Return type:

numpy.array, numpy.array

For example, to get the pore water pressure against time:

results1.getOutputVariables() #show available output variables
locations = [[25,2],[23,1]] #get PWP at x=25,y=2 and x=23,y=1
T,PWP = results1.getVariablesVsTime("PoreWaterPressure", locations=locations)
fig,ax = plt.subplots()
ax.plot(
  T, PWP,
  label=["x=25,y=2","x=23,y=1"]
)
ax.grid()
ax.legend()
ax.set_ylabel("PoreWaterPressure")
ax.set_xlabel("Time (s)")
plt.tight_layout()
plt.show()