Skip to main content

Physics-based Modeling to Structural Geology and Seismology

Project description

fem2geo

tests Docs codecov PyPI - Version PyPI - Python Version DOI

Physics-Based Modeling to Structural Geology and Seismology

A Python library for structural geology and seismology analyses on outputs from finite element (FEM) or boundary element (BEM) models. fem2geo bridges numerical simulations and field observations: it loads model outputs, extracts regions of interest, computes geomechanical variables, and produces publication-quality stereonet figures.

Key capabilities:

  • Load and normalise FEM/BEM outputs (VTK/VTU)
  • Extract spatial subsets from large models
  • Reconstruct stress tensors; compute volume-weighted averages, principal directions, and stress invariants
  • Compare fracture and fault orientation data with model stress predictions
  • Slip tendency, dilation tendency, and combined reactivation tendency on stereonets
  • Resolved shear stress analysis: compare observed and predicted fault slip
  • Kostrov summed moment tensor from fault populations, compared with model kinematics
  • Run any analysis from a single YAML config file

Table of Contents


Installation

From source

sudo apt install git python3-pip python3-venv
git clone https://github.com/pabloitu/fem2geo
cd fem2geo
python3 -m venv venv
source venv/bin/activate
pip install -e .

From PyPI

python3 -m venv venv
source venv/bin/activate
pip install fem2geo

Tutorials are not bundled in the PyPI package. Download them separately after installing:

fem2geo download-tutorials

This fetches the tutorials bundle from the latest GitHub release and extracts it into ./tutorials.


Run

Jobs are run by pointing fem2geo at a YAML config file:

fem2geo config.yaml
fem2geo config_advanced.yaml --verbose

The job key in the config selects the analysis. All other keys are job-specific — see each tutorial for a documented example.

Supported jobs:

Job Description
principal_directions Average and per-cell principal stress directions for one or more models
tendency Slip, dilation, or combined tendency fields with principal directions overlaid
fracture_analysis Fracture pole data overlaid on model principal stress directions
resolved_shear Observed vs predicted slip directions (Wallace-Bott) for each fault plane
kostrov Kostrov summed moment tensor compared with model average strain or stress axes

Tutorials

Each tutorial folder contains a minimal config.yaml and a fully annotated config_advanced.yaml. Run either with fem2geo config.yaml from inside the folder.

# Folder Job Description
1 1_principal_directions principal_directions Probe the average stress state at a point in a single model
2 2_model_comparison principal_directions Compare principal stress directions across multiple models
3 3_fracture_analysis fracture_analysis Overlay fracture orientation measurements on model stress predictions
4 4_tendency tendency Slip and dilation tendency fields with optional fracture data
5 5_resolved_shear resolved_shear Test Wallace-Bott consistency between model stress and observed fault kinematics
6 6_kostrov kostrov Compare Kostrov bulk kinematics with model strain or deviatoric stress axes

Roadmap

  • Borehole module: sample model variables along a borehole trajectory
  • Seismic catalog module: import focal mechanisms and compare with model stress orientations
  • Raster module: compare model plan-view outputs with surface observations
  • Inversion module: find the model configuration that best fits a structural dataset
  • Schema: add a lithostatic flag to distinguish outputs with and without lithostatic pressure

Contributing

Bug reports, feature requests, and pull requests are welcome at github.com/pabloitu/fem2geo.


License

See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fem2geo-0.2.0.tar.gz (64.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fem2geo-0.2.0-py3-none-any.whl (55.0 kB view details)

Uploaded Python 3

File details

Details for the file fem2geo-0.2.0.tar.gz.

File metadata

  • Download URL: fem2geo-0.2.0.tar.gz
  • Upload date:
  • Size: 64.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for fem2geo-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4f30479b3d1a778817787a38b08cd98ad15875ed8a529114457bce64a5c572c6
MD5 8e86bc12b7c9fa7a768566bea3fe61f6
BLAKE2b-256 2e76c7a59c2804a78b38ae5bc66769ec4d4c6ac6046e5853a970015ccde20bb7

See more details on using hashes here.

Provenance

The following attestation bundles were made for fem2geo-0.2.0.tar.gz:

Publisher: publish-pypi.yml on pabloitu/fem2geo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fem2geo-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: fem2geo-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 55.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for fem2geo-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9e0e78abadc84c8249c196b2f2963e921ad0178639f0f5df495450347d21447a
MD5 c4da43567722241ee7e79a570d5f1de7
BLAKE2b-256 1489b75ac80d77a2be6d33c173b6a585458ea6a1093067f9d8252e194bf2513e

See more details on using hashes here.

Provenance

The following attestation bundles were made for fem2geo-0.2.0-py3-none-any.whl:

Publisher: publish-pypi.yml on pabloitu/fem2geo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page