A simple library that aims to perform traditional structural geology analyses on data from finite element models (FEM) or boundary element models (BEM).
Current features are:
- Visualizing stress orientations in stereo-plots
- Creating slip/dilation tendency analysis.
The currently supported inputs aare .vtk
or .vtu
files from the Adeli 3D FEM program.
The code consists in two parts:
-
Parse and handle
vtk
files, as well as extracting from region of interests (e.g., a sphere, a box within the model). -
Post-process the scalar/vector/tensor data and visualize structural-geology variables of interests.
-
Installing basic dependencies (Linux):
The package requires a
python
version >= 3.9 and the following dependencies:sudo apt install git python3-pip python3-virtualenv
-
Clone (or download) package and access its directory
git clone https://github.com/pabloitu/fem2geo cd fem2geo
(Update the package to the newest version with
git pull
) -
Create a virtual environment
python3 -m venv venv
This creates a
venv
folder that contains the environment's local packages, etc. -
Activate the environment with:
source venv/bin/activate
- Note: To deactivate virtual environment when desired, type
deactivate
- Note: To deactivate virtual environment when desired, type
-
Install
fem2geo
package and its dependencies with:pip install -e .
-
Run an example from the
examples
folder with:cd examples python3 A_principal_directions.py
-
[Optional] To run the codes with a python IDE, try spyder (install with
sudo apt install spyder
and typespyder
in the console when inside the virtual environment) or the PyCharm community edition.
-
Install a
conda
distribution. Anaconda is recommended if you use Windows and want to have a GUI/IDE for python with spyder, but Miniforge is recommended for a lightweight Linux installation. -
Create conda environment:
If Anaconda was installed:
conda create -n fem2geo python=3.12 conda activate fem2geo
If Miniforge was installed, replace
conda
bymamba
-
Clone and install
fem2geo
packagegit clone https://github.com/pabloitu/fem2geo cd fem2geo pip install -e .
-
Run example
python examples/A_principal_directions.py