Skip to main content

A Python C extension for calculating displacement, stress and strian based on rectangular and triangular dislocation elements (RDE and TDE) in elastic half space.

Project description

Dislocations

Calculating deformation, stress and strain from rectangular dislocation elements (RDE) and triangular dislocation elements (TDE) sources in elements half space.

Mind the unit: recommend the International System of Units. Though strain is a dimensionless quantity, specifying dislocation unit same with fault parameters would help avoid further transformation.

Requirments:

  • Numpy

Point source model codes have not been tested yet, use them at your own risk.

Improvement:

Mehdi's codes is recommended because of numerical instabilities and no artefact singularities, even though I also included Meade's codes in the package. I integrated and improved Mehdi's code to ensure that the normal vectors of triangular elements are always upward, regardless of the vertex order, making it more user-friendly.

Unified the strike-slip, dip-slip, and tensile coordinate systems for special faults (vertical faults, horizontal faults)

1. Compile and Install

By Pypi

The easiest of building and installing the package is by Pypi:

pip install Dislocations

On MacOS platform it works pretty well, while it is not tested on Win and Linux platforms, though it is also supposed to work. In case of not working, please try below using CMake building from the source code directly:

Build and install from the source codes

# In the projrct directory, and strongly recommend executing under a python virtual env
mkdir -p build
cd build
cmake .. 
make install

Then a shared library named dislocations.so should generated in your build and also your current python site-packages directories (In fact you may copy the library to your python site-packages directory and then you are supposed to import it to python).

Compile (by shared library/dynamic link library, dll)

Using setup.py file, building shared library in current directory otherwise in ./build

python setup.py build --build-lib ./

or, equivalently using gcc or clang compiler, -undefined dynamic_lookup is essential for undefined symbols:

gcc/clang src/dislocation.c src/okada_dc3d.c src/okada_disloc3d.c -fPIC -O2 -I<NumPy_core_include_path> -I<Python_include_path>/python3.XX -shared -undefined dynamic_lookup -o dislocation.so

Then you can copy the shared library .so file to your site-packages folder of your current python environment, or to your working directory. Then you could import the module successfully.

2. Todo

  • Reduce singularities of triangular elements with Nikkhoo and Walter GJI algorithms ...
  • Install with Pypi

2. Reference:

  • Okada, Y., 1992, Internal deformation due to shear and tensile faults in a half-space, Bull. Seism. Soc. Am., 82, 1018-1040.

  • Brendan J. Meade, 2007, Algorithms for the calculation of exact displacements, strains, and stresses for triangular dislocation elements in a uniform elastic half space, Computer & Geosciences, 33, 1064-1075.

  • Nikkhoo, M., Walter, T. R., 2015, Triangular dislocation: an analytical, artefact-free solution. Geophysical Journal International, 201, 2, 1119-1141.

More Useful Resources:

Codes:
okada_wrapper
okada4py
dc3d from stanford

Zelong Guo, Potsdam
zelong.guo@outlook.com

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

dislocs-0.1.0.tar.gz (134.9 kB view details)

Uploaded Source

Built Distribution

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

dislocs-0.1.0-cp311-cp311-macosx_15_0_arm64.whl (88.5 kB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

File details

Details for the file dislocs-0.1.0.tar.gz.

File metadata

  • Download URL: dislocs-0.1.0.tar.gz
  • Upload date:
  • Size: 134.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for dislocs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 05b39fa224783c293cd35b727062a7d4344305b6db74826d3db83bfe0c2a311a
MD5 4a2978cc77b983bb4c1cc5bfc0aa53bb
BLAKE2b-256 7843133858f161fb3325b0af013f78dee10993276d7d90f645dbf41f5cb27a4b

See more details on using hashes here.

File details

Details for the file dislocs-0.1.0-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for dislocs-0.1.0-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 bef7a2e32a3e4c6ef7545b3078478fb430e4b421b404574b20bc2e1e48ee7670
MD5 54f1679abc3338af35f52a82935046eb
BLAKE2b-256 58cfe980d0ab503b056bcec831926d84b3d2df6aad7ee225b8b375468953ed94

See more details on using hashes here.

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