Function
Interface through the custom function in the study, such as water retention curves, hydraulic function, custom boundary conditions or reinforcements.
To print and select a function defined in the GeoStudio study geofile:
geofile.showFunctions()
krel = geofile.getFunctionByName("Silty clay K function")
Function can be also assessed directly from a material object:
mat = geofile.getMaterialByName("Dam fill")
krel = mat["KFn"]
Details of Function class:
- class PyGeoStudio.Function(prop=None)
- Parameters:
ID (int) – ID of the function (must not be changed)
Name (str) – Name of the function
Points (numpy array) – XY points to be interpolated and that defined the function
Function –
Estimate –
Types (list of str) – Type of function. For example, for a function defining a water retention curve of a material, function type is
["Material", "Hydraulic", "VolWCFun"].
- getXData()
Helper method to extract the X data of the Points attribute.
- Returns:
The X datapoints of the function
- Return type:
numpy array
- getYData()
Helper to extract the Y data of the Points attribute.
- Returns:
The Y datapoints of the function
- Return type:
numpy array
- plot()
Plot the function data using matplotlib
- resizeXYData(n)
Resize the function XY data and fill it with zeros.
- Parameters:
n (int) – New size of the X and Y data array
- setXData(values)
Helper method to set the X data of the Points attribute. Size must match the actual X data.
- Parameters:
values (numpy array or list) – The new X data
- setYData(values)
Helper method to set the Y data of the Points attribute. Size must match the actual Y data.
- Parameters:
values (numpy array or list) – The new Y data