Mohr’s Circle Package
This package includes utilities to compute and plot Mohr’s Circles using the Python View from Paraview.
geos.pv.utils.mohrCircles.functionsMohrCircle module
The functionsMohrCircle module provides a set of utilities to instantiate Mohr’s circles and Mohr-Coulomb failure envelope.
- class geos.pv.utils.mohrCircles.functionsMohrCircle.StressConventionEnum(value)[source]
Bases:
EnumUtility Enum to define the effective stress convention used for compression.
The usual convention considers the compression as positive. With GEOS convention, the compression is considered negative.
- COMMON_STRESS_CONVENTION = 1.0
- GEOS_STRESS_CONVENTION = -1.0
- geos.pv.utils.mohrCircles.functionsMohrCircle.buildPythonViewScript(dirpath, mohrCircles, rockCohesion, frictionAngle, userChoices)[source]
Builds the Python script used to launch the Python View.
The script is returned as a string to be then injected in the Python View.
- Parameters:
dirpath (str) – Root directory path for the script creation.
mohrCircles (list[MohrCircle]) – List of MohrCircle objects.
rockCohesion (float) – Rock cohesion (Pa).
frictionAngle (float) – Friction angle (rad).
userChoices (dict[str, Any]) – Dictionary of user plot parameters.
- Returns:
Complete Python View script.
- Return type:
str
- geos.pv.utils.mohrCircles.functionsMohrCircle.createMohrCircleAtTimeStep(stressArray, cellIds, timeStep, convention)[source]
Create MohrCircle object(s) at a given time step for all cell ids.
- Parameters:
stressArray (npt.NDArray[np.float64]) – Stress numpy array
cellIds (list[str]) – List of cell ids
timeStep (str) – Time step
convention (StressConventionEnum) – Convention used for compression.
- Raises:
ValueError – Stress array must consists of 6 components.
- Returns:
Set of MohrCircle objects.
- Return type:
set[MohrCircle]
- geos.pv.utils.mohrCircles.functionsMohrCircle.createMohrCirclesFromPrincipalComponents(mohrCircleParams)[source]
Create Mohr’s circle objects from principal components.
- Parameters:
mohrCircleParams (list[tuple[str, float, float, float]]) – List of Mohr’s circle parameters
- Returns:
List of Mohr’s circle objects.
- Return type:
list[MohrCircle]
- geos.pv.utils.mohrCircles.functionsMohrCircle.createMohrCoulombEnvelope(rockCohesion, frictionAngle)[source]
Create MohrCoulomb object from user parameters.
- Parameters:
rockCohesion (float) – Rock cohesion (Pa).
frictionAngle (float) – Friction angle in radian.
- Returns:
MohrCoulomb object.
- Return type:
- geos.pv.utils.mohrCircles.functionsMohrCircle.findAnnotateTuples(mohrCircle)[source]
Get the values and location of min and max normal stress or Mohr’s circle.
- Parameters:
mohrCircle (MohrCircle) – Mohr’s circle to consider.
maxTau (float) – Max shear stress.
- Returns:
- Labels and
location of labels.
- Return type:
tuple[str, str, tuple[float, float], tuple[float, float]]
geos.pv.utils.mohrCircles.plotMohrCircles module
plotMohrCircles module provides a set of functions to plot multiple Mohr’s circles and a failure envelope from a list of MohrCircle and MohrCoulomb objects respectively.
- geos.pv.utils.mohrCircles.plotMohrCircles.createMohrCirclesFigure(mohrCircles, mohrCoulomb, userChoices)[source]
Create Mohr’s circle figure.
- Parameters:
mohrCircles (list[MohrCircle]) – List of MohrCircle objects.
mohrCoulomb (MohrCoulomb) – MohrCoulomb object defining the failure envelope.
userChoices (dict[str, Any]) – Dictionnary to define figure properties.
- Returns:
Figure object
- Return type:
Figure