Skip to main content

Binding for LMGC90.

Project description

compas_lmgc90

Python bindings for LMGC90 discrete element solver.

Installation

Conda

With conda alreay installed, create a conda environment from the yaml file

conda env create -f environment.yml

Then activate it and install the module inside it:

conda activate compas_lmgc90-dev
python -m pip install .

Linux

# Install dependencies
sudo apt update
sudo apt install -y gfortran libopenblas-dev liblapack-dev cmake

# Clone and install
git clone https://github.com/BlockResearchGroup/compas_lmgc90.git
cd compas_lmgc90
conda create -n lmgc90 python=3.12 -y
conda activate lmgc90
conda install -c conda-forge libstdcxx-ng=14
pip install -r requirements-dev.txt
pip install --no-build-isolation -ve .

Note: The libstdcxx-ng=14 is required because the module is compiled with GCC 13.3+ and needs GLIBCXX_3.4.32.

macOS

# Install dependencies
brew install gcc openblas cmake

# Clone and install
git clone https://github.com/BlockResearchGroup/compas_lmgc90.git
cd compas_lmgc90
conda create -n lmgc90 python=3.12 -y
conda activate lmgc90
pip install -r requirements-dev.txt
pip install --no-build-isolation -ve .

Note: CMake will auto-detect Homebrew GCC/gfortran. If detection fails, set compilers manually:

export FC=$(brew --prefix gcc)/bin/gfortran-14
export CC=$(brew --prefix gcc)/bin/gcc-14  
export CXX=$(brew --prefix gcc)/bin/g++-14

Windows

Windows is not currently supported. The package requires Fortran compilers and POSIX-style build tools.

Usage

from compas_dem.models import BlockModel
from compas_dem.templates import ArchTemplate
from compas_lmgc90.solver import Solver

# Create model
template = ArchTemplate(rise=3, span=10, thickness=0.5, depth=0.5, n=20)
model = BlockModel.from_boxes(template.blocks())

# Run simulation
solver = Solver(model)
solver.set_supports(z_threshold=0.4)
solver.preprocess()
solver.run(nb_steps=100)
solver.finalize()

Examples

python temp/dem_of_an_arch.py
python temp/dem_of_a_wall.py
python temp/dem_of_a_dome.py
python temp/contacts.py

Troubleshooting

ImportError: libmatlib.so not found

Make sure you installed the package with pip install -e . in the correct conda environment. The LMGC90 libraries are bundled during installation.

GLIBCXX version error (Linux)

Install the required libstdc++:

conda install -c conda-forge libstdcxx-ng=14

macOS: Compiler not found

If CMake can't find gfortran, manually set the compilers before building:

export FC=$(brew --prefix gcc)/bin/gfortran-14
export CC=$(brew --prefix gcc)/bin/gcc-14
export CXX=$(brew --prefix gcc)/bin/g++-14
pip install --no-build-isolation -ve .

macOS: Compiler not found

If CMake can't find gfortran, manually set the compilers before building:

export FC=$(brew --prefix gcc)/bin/gfortran-14
export CC=$(brew --prefix gcc)/bin/gcc-14
export CXX=$(brew --prefix gcc)/bin/g++-14
pip install --no-build-isolation -ve .

Contributing

Testing a Pull Request

# Fetch the PR branch (replace PR_NUMBER with the actual number)
git fetch upstream pull/PR_NUMBER/head:pr-branch-name
git checkout pr-branch-name

# Build and test
pip install --no-build-isolation -ve .
python temp/contacts.py

Pushing changes to a PR

# Add the PR author's fork as a remote
git remote add author https://github.com/AUTHOR/compas_lmgc90.git

# Push your changes to their branch
git push author branch-name

Note: This requires the PR author to have enabled "Allow edits from maintainers" on their PR.

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

compas_lmgc90-0.1.8.tar.gz (262.2 kB view details)

Uploaded Source

Built Distributions

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

compas_lmgc90-0.1.8-cp313-cp313-win_amd64.whl (17.8 MB view details)

Uploaded CPython 3.13Windows x86-64

compas_lmgc90-0.1.8-cp313-cp313-manylinux_2_28_x86_64.whl (14.5 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

compas_lmgc90-0.1.8-cp313-cp313-macosx_14_0_arm64.whl (12.9 MB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

compas_lmgc90-0.1.8-cp312-cp312-win_amd64.whl (17.8 MB view details)

Uploaded CPython 3.12Windows x86-64

compas_lmgc90-0.1.8-cp312-cp312-manylinux_2_28_x86_64.whl (14.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

compas_lmgc90-0.1.8-cp312-cp312-macosx_14_0_arm64.whl (12.9 MB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

compas_lmgc90-0.1.8-cp311-cp311-win_amd64.whl (17.8 MB view details)

Uploaded CPython 3.11Windows x86-64

compas_lmgc90-0.1.8-cp311-cp311-manylinux_2_28_x86_64.whl (14.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

compas_lmgc90-0.1.8-cp311-cp311-macosx_14_0_arm64.whl (12.9 MB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

compas_lmgc90-0.1.8-cp310-cp310-win_amd64.whl (17.8 MB view details)

Uploaded CPython 3.10Windows x86-64

compas_lmgc90-0.1.8-cp310-cp310-manylinux_2_28_x86_64.whl (14.5 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

compas_lmgc90-0.1.8-cp310-cp310-macosx_14_0_arm64.whl (12.9 MB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

compas_lmgc90-0.1.8-cp39-cp39-win_amd64.whl (17.8 MB view details)

Uploaded CPython 3.9Windows x86-64

compas_lmgc90-0.1.8-cp39-cp39-manylinux_2_28_x86_64.whl (14.5 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

compas_lmgc90-0.1.8-cp39-cp39-macosx_14_0_arm64.whl (12.9 MB view details)

Uploaded CPython 3.9macOS 14.0+ ARM64

File details

Details for the file compas_lmgc90-0.1.8.tar.gz.

File metadata

  • Download URL: compas_lmgc90-0.1.8.tar.gz
  • Upload date:
  • Size: 262.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for compas_lmgc90-0.1.8.tar.gz
Algorithm Hash digest
SHA256 0699403ad90889ce1a9231b873a47df8d4b47e5c71bbb29a15439882b7c758d1
MD5 a9d8fd2df98aed13a01f608c1b6f8fb5
BLAKE2b-256 236ded1628dd5a8b8b73c6f94c73ebc07d66572e18135fd4f5bed116ffa5cad6

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_lmgc90-0.1.8.tar.gz:

Publisher: release.yml on BlockResearchGroup/compas_lmgc90

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

File details

Details for the file compas_lmgc90-0.1.8-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for compas_lmgc90-0.1.8-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 838eac15ae26eb76773e0a85a1822dd69302214bc12375bfbba1c2336699e046
MD5 71aa0a9934026a3041c5ef454fb3d7ea
BLAKE2b-256 ec51090b00682239530878e9380c638ae0e49c3e1f2d7a0461ced0f015618d08

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_lmgc90-0.1.8-cp313-cp313-win_amd64.whl:

Publisher: release.yml on BlockResearchGroup/compas_lmgc90

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

File details

Details for the file compas_lmgc90-0.1.8-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for compas_lmgc90-0.1.8-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b00edbbca59cd5a18fe5ad88f53103c7542acfb0de3f8d4d217958442223191c
MD5 8500e5aaf6a55a1ac47464f6240b37c8
BLAKE2b-256 b28dadd087ff74a79894c060ad0828f5e2acf49deb9f537c895a6d0c8ba07ce2

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_lmgc90-0.1.8-cp313-cp313-manylinux_2_28_x86_64.whl:

Publisher: release.yml on BlockResearchGroup/compas_lmgc90

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

File details

Details for the file compas_lmgc90-0.1.8-cp313-cp313-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for compas_lmgc90-0.1.8-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 74afe3252c559c69f25bfb6a3390d751dad1b91bdab9712f911c24f41e72df8f
MD5 03aad82878bfc2b3680882ab006d74fd
BLAKE2b-256 100201213e19c0a3e41fcb5d928d118c9930306bf95fc726002828b9387a2ce8

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_lmgc90-0.1.8-cp313-cp313-macosx_14_0_arm64.whl:

Publisher: release.yml on BlockResearchGroup/compas_lmgc90

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

File details

Details for the file compas_lmgc90-0.1.8-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for compas_lmgc90-0.1.8-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 f9af8c613db64f94e0113ca05312772496403ad372e8a20ae63e745d88d155c5
MD5 089a4313e1e4d00e9bcf430e490fe429
BLAKE2b-256 ed751a83fe4f2460ce99aa52703595715f794200e1708086cb8a10829d12abf7

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_lmgc90-0.1.8-cp312-cp312-win_amd64.whl:

Publisher: release.yml on BlockResearchGroup/compas_lmgc90

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

File details

Details for the file compas_lmgc90-0.1.8-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for compas_lmgc90-0.1.8-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 56e228762a16162a50984a274ac44ff55b99a003d1116fc93f7de2d6f6198fbb
MD5 2b17dda63a38ddfc56bb5878e5155fb8
BLAKE2b-256 1655af15e8e2a782d569df8f2523e5ccb81159725d55d51bf814db3cc43f604a

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_lmgc90-0.1.8-cp312-cp312-manylinux_2_28_x86_64.whl:

Publisher: release.yml on BlockResearchGroup/compas_lmgc90

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

File details

Details for the file compas_lmgc90-0.1.8-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for compas_lmgc90-0.1.8-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 61110f9ad2c4b9d9a3ef5232a89e89f6c91e6634740101af3e9d0bed576e4754
MD5 516c7eb8b58436ad026a492f0eff3435
BLAKE2b-256 df9c547b87e77ef74d4898858d7022446db90a064ee490df2ce8631f23cb79ca

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_lmgc90-0.1.8-cp312-cp312-macosx_14_0_arm64.whl:

Publisher: release.yml on BlockResearchGroup/compas_lmgc90

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

File details

Details for the file compas_lmgc90-0.1.8-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for compas_lmgc90-0.1.8-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 811a4b0481417ac40b0442c705e840f1772df81a6091c9ab7b37a8a1ff2075bf
MD5 404c8a181c0622384f6ec5742dbfec47
BLAKE2b-256 bd2fd077485b44b7d11ff79602cbbd2eabf7526cbadba166661861c1688a716d

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_lmgc90-0.1.8-cp311-cp311-win_amd64.whl:

Publisher: release.yml on BlockResearchGroup/compas_lmgc90

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

File details

Details for the file compas_lmgc90-0.1.8-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for compas_lmgc90-0.1.8-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1f4bdaa428d32f3aaefcb5a544657b020b95de78c701616c57909fbb3120a54e
MD5 a3274313b8462645a57779e7099e2387
BLAKE2b-256 e30e2606905259fd73ee54615a9c011ec27386591bba91023708ef2e7ddf5fed

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_lmgc90-0.1.8-cp311-cp311-manylinux_2_28_x86_64.whl:

Publisher: release.yml on BlockResearchGroup/compas_lmgc90

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

File details

Details for the file compas_lmgc90-0.1.8-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for compas_lmgc90-0.1.8-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 d5c1e3c4036ef800ee81ad950f0e195726b30f07250f8ad735885008f1b91ad8
MD5 74f2284cc0dd650dac1000d6d48199d2
BLAKE2b-256 a461b78a3e3adc00c50d8bef83d5f898d81b6faade229f0a56556117e07d4485

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_lmgc90-0.1.8-cp311-cp311-macosx_14_0_arm64.whl:

Publisher: release.yml on BlockResearchGroup/compas_lmgc90

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

File details

Details for the file compas_lmgc90-0.1.8-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for compas_lmgc90-0.1.8-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 805eeff6bc442290057257fd18c76c12a73e05f0deb2b6a02ea4e9c088920c0e
MD5 428f09f52c5a81ea8d526e5c43d8296c
BLAKE2b-256 660b4e2901e24248b9720826a6c3ab2e3140edddf0f0c01e602fb692a1471c8c

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_lmgc90-0.1.8-cp310-cp310-win_amd64.whl:

Publisher: release.yml on BlockResearchGroup/compas_lmgc90

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

File details

Details for the file compas_lmgc90-0.1.8-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for compas_lmgc90-0.1.8-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6009851c4d26ae2d260e27609bb2238521fe7d633d0cf37877dd60157622fa3d
MD5 b3b5eed8645981f2aa2a7608d3601f13
BLAKE2b-256 daf6066a3e56cc3f40d0e242546b1e2e5d51ccdb32c9ac734bc99d0204de9792

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_lmgc90-0.1.8-cp310-cp310-manylinux_2_28_x86_64.whl:

Publisher: release.yml on BlockResearchGroup/compas_lmgc90

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

File details

Details for the file compas_lmgc90-0.1.8-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for compas_lmgc90-0.1.8-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 70281f148d953f5bcd2aeaccff79402df615a16283d29f3c1234d96b09e071a3
MD5 fd31d82affc96bc50b7dcb82f4c471ed
BLAKE2b-256 978dfc725c8973cacc8bfbec2bb875db37dee62c67637e66607a8a23eef8ad18

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_lmgc90-0.1.8-cp310-cp310-macosx_14_0_arm64.whl:

Publisher: release.yml on BlockResearchGroup/compas_lmgc90

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

File details

Details for the file compas_lmgc90-0.1.8-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for compas_lmgc90-0.1.8-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 ff29e03b0a1bc9462bb57f3793624369bfab73a5086c3bf740f2312aedd19d15
MD5 21197da7371fc6e7415a2fe14ab02040
BLAKE2b-256 d0c7c8706b7e44c167c0f1fe0d85ccb6a9a4afa81b9a773dd7867017437ec347

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_lmgc90-0.1.8-cp39-cp39-win_amd64.whl:

Publisher: release.yml on BlockResearchGroup/compas_lmgc90

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

File details

Details for the file compas_lmgc90-0.1.8-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for compas_lmgc90-0.1.8-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 adc014bfc102781e47fe80c3538bf5c18d3d110cb952496c28d7c1f2b6a6311d
MD5 cc1579738ba3ef8915ae471ef74ac75a
BLAKE2b-256 02c5d9f938cc5b12b9fad5f9fe07834df27e193afb51d7f04ebf3333471ae429

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_lmgc90-0.1.8-cp39-cp39-manylinux_2_28_x86_64.whl:

Publisher: release.yml on BlockResearchGroup/compas_lmgc90

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

File details

Details for the file compas_lmgc90-0.1.8-cp39-cp39-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for compas_lmgc90-0.1.8-cp39-cp39-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 7ec57d21beae6b5ab9c26af9ee3e13b5ec7f59da8cca3964d18b7812307450a1
MD5 dbb8bb554e10ceae80b6b379c7a3fe9e
BLAKE2b-256 f624728420b65f1bb8f2cb77a09ce2e0e953beb9dd523ba3b343c2d90e25f076

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_lmgc90-0.1.8-cp39-cp39-macosx_14_0_arm64.whl:

Publisher: release.yml on BlockResearchGroup/compas_lmgc90

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