Fracture Networks — FracAbility 0.1.0 documentation

Skip to main content
`Ctrl`+`K`

# Fracture Networks

class fracability.Entities.FractureNetwork(gdf: GeoDataFrame | None = None)

  Fracture network base entity. Fracture networks are defined by one or more:

  > - Fracture base entities

  > - Boundary base entities

  > - Nodes base entities

  All the data is represented in the entity_df and the different objects are defined by the ‘type’ column.

  FractureNetwork objects can be created in two ways depending on how the dataset is structured.

  > 1. If fractures and boundaries and nodes are saved in different shp files then use the add_fracture,add_boundary and add_nodes methods on an empty FractureNetwork object.

  > 2. If fractures and boundaries and nodes are saved in a single shp the geopandas dataframe can be directly fed when instantiating the class. In this case a type column must be set to indicate of which type the geometries are

  activate_boundaries(group_n: list | None = None)

    Method that activates the boundary provided in the group_n list. :param group_n: List of groups to be activated

  activate_fractures(set_n: list | None = None)

    Method that activates the fractures provided in the set_n list. :param set_n: List of sets to be activated

  activate_nodes(node_type: list | None = None)

    Method that activates the nodes provided in the node_type list. :param node_type: List of node types to be activated

  add_boundaries(boundary: Boundary | None = None)

    Method used to add boundary components to the fracture network Dataframe :param boundary: Boundary object to be added

    Notes

    The boundary are added to the fracture network dataframe using the assigned group_n present in the Boundary object dataframe. If the group is already present the boundary object will be overwritten if not it will be appended

  add_fractures(fractures: Fractures | None = None)

    Method used to add fracture components to the fracture network Dataframe :param fractures: Fracture object to be added

    Notes

    The fractures are added to the fracture network dataframe using the assigned fracture_set present in the Fracture object dataframe. If the set is already present the fracture object will be overwritten if not it will be appended

  add_nodes(nodes: Nodes | None = None)

    Method used to add nodes components to the fracture network Dataframe :param nodes: Nodes object to be added

    Notes

    The nodes are added to the fracture network dataframe using the assigned node_type present in the Nodes object dataframe. If the node type is already present the node object will be overwritten if not it will be appended

  property boundaries: Boundary

    Property that returns a Boundary entity object of all the active boundary groups. :return: Boundary entity object

  boundary_object(group_n: int) → Fractures

    Method that returns the Node object of a given group_number :param group_n: Number of the group :return: Boundary object

  center_object(trans_center: array | None = None, return_center: bool = False, inplace: bool = True)

    Method used to center the center of an Entity object to a given point. If no point is specified then the object will be moved to the origin (0,0,0).

    Parameters:

      - obj (Boundary, Fractures, FractureNetwork) – A fracability entity object

      - trans_center (array) – Point to which translate the object

      - return_center (bool) – Bool flag to specify to return the translation center

      - inplace (bool) – Bool flag to specify if the operation overwrites the entity or creates a new instance

    Returns:

      - trans_center (array) – Point of translation. If trans_center is not specified in the output then this will return the center of the object

      - copy_obj (object) – Copy of the modified input object (preserves the original input)

  property centroid: ndarray

    Property used to return the centroid of the entity. Dissolve is used to aggregate each shape in a single entity. :return: 1D numpy array of the centroid

  property crs

    Property used to return the crs of the entity :return: Name of the coordinate system as a string

  deactivate_boundaries(group_n: list | None = None)

    Method that deactivates the boundary provided in the group_n list. :param group_n: List of groups to be deactivated

    Note

    If group_n is none then all boundaries groups are deactivated

  deactivate_fractures(set_n: list | None = None)

    Method that activates the fractures provided in the set_n list. :param set_n: List of sets to be activated

  deactivate_nodes(node_type: list | None = None)

    Method that activates the nodes provided in the node_type list. :param node_type: List of node types to be activated

  property entity_df

    Each entity is based on a geopandas dataframe. This property returns or sets the entity_df of the given entity.

    Getter:

      Returns the GeoDataFrame

    Setter:

      Sets the GeoDataFrame

    Type:

      GeoDataFrame

    Notes

    When set, the dataframe is modified to conform to the assigned entity structure.

  fracture_network_to_components_df() → GeoDataFrame

    Method used to return the fracture network as a single geopandas dataframe. :return: Geopandas DataFrame of the whole fracture network

  fracture_object(set_n: int) → Fractures

    Method that returns the Fracture object of a given set :param set_n: Number of the set :return: Fracture object

  property fractures: Fractures

    Property that returns a Fracture entity object of all the active fracture sets. :return: Fracture entity object

  property get_copy

    Property used to return a deep copy of the entity :return:

  is_group_active(group_n: int) → bool

    Method used to return if a given boundary group is active in the fracture network :param group_n: set to check :return: Bool value of the test

  is_set_active(set_n: int) → bool

    Method used to return if a given fracture set is active in the fracture network :param set_n: set to check :return: Bool value of the test

  is_type_active(node_type: int) → bool

    Method used to return if a given node type is active in the fracture network :param node_type: node type to check :return: Bool value of the test

  matplot(markersize=5, linewidth=[2, 2], color=['black', 'blue'], color_set=False, return_ax=False)

    Method used to plot the fracture network using matplotlib :return:

  property name

    Property used to return the name of the class (i.e. Fractures) :return: Name of the class as string

  property network_object: Graph

    Method used to return a networkx Graph representation of the fracture network :return: Graph of the fracture network

  property nodes: Nodes

    Property that returns a Node entity object of all the active nodes. :return: Nodes entity object

  nodes_object(node_type: int) → Nodes

    Method that returns the Node object of a given node_type :param node_type: Type of the node :return: Nodes object

  plot_ternary()

    Method used to plot the ternary diagram of the fracture network :return:

  save_csv(path: str, sep: str = ',', index: bool = False)

    Save the entity df as csv :param index: :type sep: object :param path: :return:

  save_shp(path: str)

    Save the entity df as shp :param path: :return:

  vtk_object(include_nodes: bool = True) → PolyData

    Method used to return a vtkPolyData representation of the fracture network :param include_nodes: Bool flag used to control if include or not the nodes in the fracture network object :return: vtkPolyData of the fracture network

  vtkplot(markersize=5, linewidth=[2, 2], color=['white', 'white'], color_set=False, return_plot=False)

    Method used to plot the fracture network using vtk :return: