4. slices

Module for defining the class related to the slices and their structure.

class slices.MaterialParameters(cohesion, frictAngle, unitWeight, blocksUnitWeight=None, wtUnitWeight=None)[source]

Bases: object

Creates an instance of an object that defines the structure of the material where the stabilibity analysis is performed.

MaterialParameters(cohesion, frictAngle, unitWeight,
                   blocksUnitWeight=None, wtUnitWeight=None)

Contains the strength parameters (Mohr-Coulomb failure criterion) and the different unit weigths.

cohesion

Intercept of the Mohr-Coulomb envelope.

Type:int or float
frictAngle

Angle of the Mohr-Coulomb envelope.

Type:int or float
unitWeight

Unit weight of the soil or the matrix in the case of a Blocks-in-Matrix material.

Type:int or float
blocksUnitWeight

Unit weight of the blocks in the case of a Blocks-in-Matrix material. None is the default value that means there are no blocks.

Type:int or float
wtUnitWeight

Unit weight of the water. None is the default value that means there are no water table, or it is located under the base of a specific slice.

Type:int or float

Examples

>>> from pybimstab.slices import MaterialParameters
>>> material = MaterialParameters(
>>>     cohesion=15, frictAngle=23, unitWeight=17, blocksUnitWeight=21,
>>>     wtUnitWeight=9.8)
>>> material.__dict__
{'blocksUnitWeight': 21,
 'cohesion': 15,
 'frictAngle': 23,
 'mtxUnitWeight': 17,
 'wtUnitWeight': 9.8}
class slices.SliceStr(material, terrainLS, slipSurfLS, watertabLS=None, bim=None)[source]

Bases: object

Creates an instance of an object that defines the structure of a slice of the soil mass above the slip surface.

SliceStr(material, terrainLS, slipSurfLS, watertabLS=None, bim=None)

The structure contains the required data for performing the slope stability assessment by the limit equilibrium method.

material

object with the parameters of the material that composes the slice.

Type:MaterialParameters object
terrainLS

Top of the slice that coincides with the terrain surface.

Type:shapely.geometry.linestring.LineString
slipSurfLS

Bottom of the slice that coincides with the slip surface.

Type:shapely.geometry.linestring.LineString
watertabLS

Polyline that coincides with the water table. It could be located below or crossing the base of the slice, between the bottom and the top or absent. None is the default value.

Type:shapely.geometry.linestring.LineString
bim

object with the structure of the slope made of the Blocks-in-Matrix material. None is the default value and means that there is not a BIM structure

Type:BimStructure object

Note

The class SliceStr requires copy, numpy, matplotlib and shapely.

Examples

>>> from shapely.geometry import LineString
>>> from pybimstab.slices import MaterialParameters, SliceStr
>>> material = MaterialParameters(cohesion=15, frictAngle=23,
>>>                               unitWeight=17)
>>> terrainLS = LineString([(6, 8), (7, 6.5)])
>>> slipSurfLS = LineString([(6, 3.395), (7, 2.837)])
>>> watertabLS = LineString([(6, 5), (7, 4)])
>>> slice_ = SliceStr(material, terrainLS, slipSurfLS, watertabLS,
>>>                   bim=None)
>>> slice_.__dict__.keys()
dict_keys(['material', 'terrainLS', 'slipSurfLS', 'watertabLS', 'bim',
           'terrainCoords', 'slipSurfCoords', 'watertabCoords',
           'sliceLS', 'coords', 'xMin', 'xMax', 'yMin', 'yMax', 'area',
           'width', 'baseSlope', 'alpha', 'baseLength', 'l',
           'topLength', 'topSlope', 'topInclinatDeg', 'midHeight',
           'midWatTabHeight'])
defineStructure()[source]

Method for defining the geometric structure of the slice including the variables required to perform the slope stability assessment by the limit equilibrium method.

Returns:Coordinates of the slice boundary. First row contains the abscises and the second one contains the ordinates.
Return type:((2, n) numpy.ndarray)

Examples

>>> from shapely.geometry import LineString
>>> from pybimstab.slices import MaterialParameters, SliceStr
>>> material = MaterialParameters(cohesion=15, frictAngle=23,
>>>                               unitWeight=17)
>>> terrainLS = LineString([(6, 8), (7, 6.5)])
>>> slipSurfLS = LineString([(6, 3.395), (7, 2.837)])
>>> watertabLS = LineString([(6, 5), (7, 4)])
>>> slice_ = SliceStr(material, terrainLS, slipSurfLS, watertabLS,
>>>                   bim=None)
>>> slice_.defineStructure()
array([[6.   , 7.   , 7.   , 6.   , 6.   ],
       [8.   , 6.5  , 2.837, 3.395, 8.   ]])
extractBim()[source]

Returns an object from the class bim.BlocksInMatrix where is stored the structure of the local Blocks-In-Matrix material inside the slice.

Examples

>>> from shapely.geometry import LineString
>>> from pybimstab.slope import AnthropicSlope
>>> from pybimstab.bim import BlocksInMatrix
>>> from pybimstab.slices import MaterialParameters, SliceStr
>>> material = MaterialParameters(cohesion=15, frictAngle=23,
>>>                               unitWeight=17)
>>> slope = AnthropicSlope(slopeHeight=7.5, slopeDip=[1, 1.5],
>>>                        crownDist=5, toeDist=5, depth=2)
>>> bim = BlocksInMatrix(slopeCoords=slope.coords, blockProp=0.2,
>>>                      tileSize=0.5, seed=123)
>>> terrainLS = LineString([(6, 8), (7, 6.5)])
>>> slipSurfLS = LineString([(6, 3.395), (7, 2.837)])
>>> watertabLS = LineString([(6, 5), (7, 4)])
>>> slice_ = SliceStr(material, terrainLS, slipSurfLS, watertabLS,
>>>                   bim=bim)
>>> localBIM = slice_.extractBim()
>>> localBIM.__dict__.keys()
dict_keys(['slopeCoords', 'blockProp', 'tileSize', 'seed', 'grid',
           'xCells', 'yCells'])
plot()[source]

Method for plotting the slice.

Examples

>>> from shapely.geometry import LineString
>>> from pybimstab.slices import MaterialParameters, SliceStr
>>> material = MaterialParameters(cohesion=15, frictAngle=23,
>>>                               unitWeight=17)
>>> terrainLS = LineString([(6, 8), (7, 6.5)])
>>> slipSurfLS = LineString([(6, 3.395), (7, 2.837)])
>>> watertabLS = LineString([(6, 5), (7, 4)])
>>> slice_ = SliceStr(material, terrainLS, slipSurfLS, watertabLS,
>>>                   bim=None)
>>> fig = slice_.plot()
slices_SliceStr_example1

example script.

>>> from shapely.geometry import LineString
>>> from pybimstab.slope import AnthropicSlope
>>> from pybimstab.bim import BlocksInMatrix
>>> from pybimstab.slices import MaterialParameters, SliceStr
>>> material = MaterialParameters(cohesion=15, frictAngle=23,
>>>                               unitWeight=17)
>>> slope = AnthropicSlope(slopeHeight=7.5, slopeDip=[1, 1.5],
>>>                        crownDist=5, toeDist=5, depth=2)
>>> bim = BlocksInMatrix(slopeCoords=slope.coords, blockProp=0.2,
>>>                      tileSize=0.5, seed=123)
>>> terrainLS = LineString([(6, 8), (7, 6.5)])
>>> slipSurfLS = LineString([(6, 3.395), (7, 2.837)])
>>> watertabLS = LineString([(6, 5), (7, 4)])
>>> slice_ = SliceStr(material, terrainLS, slipSurfLS, watertabLS,
>>>                   bim=bim)
>>> fig = slice_.plot()
slices_SliceStr_example2

example script.

class slices.Slices(material, slipSurfCoords, slopeCoords, numSlices=20, watertabCoords=None, bim=None)[source]

Bases: object

Creates an instance of an object that defines the structure of the slices that the soil mass above the slip surface is divided.

Slices(material, slipSurfCoords, slopeCoords, numSlices=20,
       watertabCoords=None, bim=None)
slipSurfCoords

Absolute coordinates of the vertices of the polyline which defines the slip surface. First row contains the abcsises and the second row contains the ordinates.

Type:(2, n) numpy.ndarray
slopeCoords

Absolute coordinates of the vertices of the polyline which defines the slip surface. First column contains the abcsises and the second one contains the ordinates.

Type:(n, 2) numpy.ndarray
material

object with the parameters of the material that composes the slope.

Type:MaterialParameters object
numSlices

Number of slices in which the soil above the slip surface is going to be divided. 20 is the default value.

Type:int
watertabCoords

Absolute coordinates of the vertices of the polyline which defines the water table. First row contains the abcsises and the second row contains the ordinates. It is like an optional argument and if there is not a water table, set it as None, which is the default value.

Type:(2, n) numpy.ndarray
bim

object with the structure of the slope made of the BIM-material. It is like an optional argument and if there is not a BIM structure, set it as None, which is the default value.

Type:BimStructure object

Note

The class Slices requires numpy, scipy, matplotlib and shapely.

Examples

>>> from numpy import array
>>> from pybimstab.slope import AnthropicSlope
>>> from pybimstab.slipsurface import CircularSurface
>>> from pybimstab.slices import MaterialParameters, Slices
>>> slope = AnthropicSlope(slopeHeight=7.5, slopeDip=[1, 1.5],
>>>                        crownDist=5, toeDist=5)
>>> surface = CircularSurface(slopeCoords=slope.coords,
>>>                           dist1=2, dist2=10, radius=9)
>>> material = MaterialParameters(
>>>     cohesion=15, frictAngle=23, unitWeight=17,
>>>     blocksUnitWeight=21, wtUnitWeight=9.8)
>>> slices = Slices(
>>>     material=material, slipSurfCoords=surface.coords,
>>>     slopeCoords=slope.coords, numSlices=10,
>>>     watertabCoords=None, bim=None)
>>> slices.__dict__.keys()
dict_keys(['material', 'numSlices', 'slipSurfCoords', 'slopeCoords',
           'watertabCoords', 'bim', 'rotationPt', 'slices'])
fitCircle()[source]

Method for adjusting a circumference to a cloud of points.

Returns:Dictionary with the radius and coordinates of center.
Return type:(dict)

Examples

>>> from numpy import array
>>> from pybimstab.slope import AnthropicSlope
>>> from pybimstab.slipsurface import CircularSurface
>>> from pybimstab.slices import MaterialParameters, Slices
>>> slope = AnthropicSlope(slopeHeight=7.5, slopeDip=[1, 1.5],
>>>                        crownDist=5, toeDist=5)
>>> surface = CircularSurface(slopeCoords=slope.coords,
>>>                           dist1=2, dist2=10, radius=9)
>>> material = MaterialParameters(
>>>     cohesion=15, frictAngle=23, unitWeight=17,
>>>     blocksUnitWeight=21, wtUnitWeight=9.8)
>>> slices = Slices(
>>>     material=material, slipSurfCoords=surface.coords,
>>>     slopeCoords=slope.coords, numSlices=10,
>>>     watertabCoords=None, bim=None)
>>> slices.fitCircle()
{'center': array([10.88132286, 10.83174439]),
 'radius': 9.000000000000002,
 'dist1': 2.009892716098348,
 'dist2': 11.761811095385543}
createSlices()[source]

Method for defining the structure of all the slices in which the soil mass above the slip surface is divided.

Returns:List of object instanced from the class SliceStr that defines the structure of an individual slice.
Return type:(list)

Examples

>>> from numpy import array
>>> from pybimstab.slope import AnthropicSlope
>>> from pybimstab.slipsurface import CircularSurface
>>> from pybimstab.slices import MaterialParameters, Slices
>>> slope = AnthropicSlope(slopeHeight=7.5, slopeDip=[1, 1.5],
>>>                        crownDist=5, toeDist=5)
>>> surface = CircularSurface(slopeCoords=slope.coords,
>>>                           dist1=2, dist2=10, radius=9)
>>> material = MaterialParameters(
>>>     cohesion=15, frictAngle=23, unitWeight=17,
>>>     blocksUnitWeight=21, wtUnitWeight=9.8)
>>> slices = Slices(
>>>     material=material, slipSurfCoords=surface.coords,
>>>     slopeCoords=slope.coords, numSlices=10,
>>>     watertabCoords=None, bim=None)
>>> slicesList = slices.createSlices()
>>> slicesList[0].__dict__.keys()
dict_keys(['material', 'terrainLS', 'slipSurfLS', 'watertabLS',
           'bim', 'terrainCoords', 'slipSurfCoords',
           'watertabCoords', 'sliceLS', 'coords', 'xMin', 'xMax',
           'yMin', 'yMax', 'area', 'width', 'baseSlope', 'alpha',
           'baseLength', 'l', 'topLength', 'topSlope',
           'topInclinatDeg', 'midHeight', 'midWatTabHeight'])
setExtLoads(extL=[{'load': 0, 'angle': 0}])[source]

Method for setting the external loads to the slices.

Parameters:extL (list) –

list that stores the information of the external loads in dictionaries. Each dictionary has the value of the external force (at the slope surface) and its inclination in degrees as the following structure {'load': 0, 'angle': 0}. There are three possibilities to define the structure:

  • Unitary list means that the input is constant for all the slices. {'load': 0, 'angle': 0} is the default value.
  • If the length of the list is as long as the number of slices, each slice is coupled with the input list.
  • If the length of the list is \(l>1\) and lower than the number of slices, then only the \(l\) fisrt slices are coupled with the external loads.

Examples

>>> from numpy import array
>>> from pybimstab.slope import AnthropicSlope
>>> from pybimstab.slipsurface import CircularSurface
>>> from pybimstab.slices import MaterialParameters, Slices
>>> slope = AnthropicSlope(slopeHeight=7.5, slopeDip=[1, 1.5],
>>>                        crownDist=5, toeDist=5)
>>> surface = CircularSurface(slopeCoords=slope.coords,
>>>                           dist1=2, dist2=10, radius=9)
>>> material = MaterialParameters(
>>>     cohesion=15, frictAngle=23, unitWeight=17,
>>>     blocksUnitWeight=21, wtUnitWeight=9.8)
>>> slices = Slices(
>>>     material=material, slipSurfCoords=surface.coords,
>>>     slopeCoords=slope.coords, numSlices=10,
>>>     watertabCoords=None, bim=None)
>>> slices.setExtLoads(extL=[{'load': 200, 'angle': 30}])
>>> slices.slices[0].extL, slices.slices[0].w
(200, 30)
plot(plotFittedCirc=False)[source]

Method for generating a graphic of the slope stability model when is possible to watch the slices in the soil mass above the slip surface.

Returns:object with the matplotlib structure of the plot. You might use it to save the figure for example.
Return type:(matplotlib.figure.Figure)

Examples

>>> from numpy import array
>>> from pybimstab.slope import AnthropicSlope
>>> from pybimstab.slipsurface import CircularSurface
>>> from pybimstab.slices import MaterialParameters, Slices
>>> slope = AnthropicSlope(slopeHeight=7.5, slopeDip=[1, 1.5],
>>>                        crownDist=5, toeDist=5)
>>> surface = CircularSurface(slopeCoords=slope.coords,
>>>                           dist1=2, dist2=10, radius=9)
>>> material = MaterialParameters(
>>>     cohesion=15, frictAngle=23, unitWeight=17,
>>>     blocksUnitWeight=21, wtUnitWeight=9.8)
>>> slices = Slices(
>>>     material=material, slipSurfCoords=surface.coords,
>>>     slopeCoords=slope.coords, numSlices=10,
>>>     watertabCoords=None, bim=None)
>>> fig = slices.plot()
slices_Slices_example1

example script.

>>> from numpy import array
>>> from pybimstab.slope import NaturalSlope
>>> from pybimstab.watertable import WaterTable
>>> from pybimstab.bim import BlocksInMatrix
>>> from pybimstab.slipsurface import CircularSurface
>>> from pybimstab.slipsurface import TortuousSurface
>>> from pybimstab.slices import MaterialParameters, Slices
>>> terrainCoords = array(
>>>     [[-2.49, 0.1, 1.7, 3.89, 5.9, 8.12, 9.87, 13.29, 20.29,
>>>       21.43, 22.28, 23.48, 24.65, 25.17],
>>>      [18.16, 17.88, 17.28, 15.73, 14.31, 13.58, 13, 3.61, 3.61,
>>>       3.32, 2.71, 2.23, 1.21, 0.25]])
>>> slope = NaturalSlope(terrainCoords)
>>> bim = BlocksInMatrix(slopeCoords=slope.coords, blockProp=0.3,
>>>                      tileSize=0.35, seed=123)
>>> watertabDepths = array([[0, 5, 10, 15],
>>>                         [8, 7, 3, 0]])
>>> watertable = WaterTable(slopeCoords=slope.coords,
>>>                         watertabDepths=watertabDepths,
>>>                         smoothFactor=3)
>>> preferredPath = CircularSurface(
>>>     slopeCoords=slope.coords, dist1=5, dist2=15.78, radius=20)
>>> surface = TortuousSurface(
>>>     bim, dist1=4, dist2=15.78, heuristic='euclidean',
>>>     reverseLeft=False, reverseUp=False, smoothFactor=2,
>>>     preferredPath=preferredPath.coords, prefPathFact=2)
>>> material = MaterialParameters(
>>>     cohesion=15, frictAngle=23, unitWeight=17,
>>>     blocksUnitWeight=21, wtUnitWeight=9.8)
>>> slices = Slices(
>>>     material=material, slipSurfCoords=surface.coords,
>>>     slopeCoords=slope.coords, numSlices=10,
>>>     watertabCoords=watertable.coords, bim=bim)
>>> fig = slices.plot()
slices_Slices_example2

example script.