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.7.tar.gz (254.3 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.7-cp313-cp313-win_amd64.whl (17.7 MB view details)

Uploaded CPython 3.13Windows x86-64

compas_lmgc90-0.1.7-cp313-cp313-manylinux_2_28_x86_64.whl (14.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

compas_lmgc90-0.1.7-cp312-cp312-win_amd64.whl (17.7 MB view details)

Uploaded CPython 3.12Windows x86-64

compas_lmgc90-0.1.7-cp312-cp312-manylinux_2_28_x86_64.whl (14.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

compas_lmgc90-0.1.7-cp311-cp311-win_amd64.whl (17.7 MB view details)

Uploaded CPython 3.11Windows x86-64

compas_lmgc90-0.1.7-cp311-cp311-manylinux_2_28_x86_64.whl (14.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

compas_lmgc90-0.1.7-cp310-cp310-win_amd64.whl (17.7 MB view details)

Uploaded CPython 3.10Windows x86-64

compas_lmgc90-0.1.7-cp310-cp310-manylinux_2_28_x86_64.whl (14.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

compas_lmgc90-0.1.7-cp39-cp39-win_amd64.whl (17.7 MB view details)

Uploaded CPython 3.9Windows x86-64

compas_lmgc90-0.1.7-cp39-cp39-manylinux_2_28_x86_64.whl (14.4 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

File details

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

File metadata

  • Download URL: compas_lmgc90-0.1.7.tar.gz
  • Upload date:
  • Size: 254.3 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.7.tar.gz
Algorithm Hash digest
SHA256 2b35fd9170e0255b18c7c3ac089b91f07c50e2d7c0fb331135903e9e0b7aad7a
MD5 63ec5f247cdf2e363518e58208b69985
BLAKE2b-256 593840c5a23958d768f31ca9c06db10e6850af1715a254b62f75dd3d323f0409

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_lmgc90-0.1.7.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.7-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for compas_lmgc90-0.1.7-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 5e0ef7ba50c3bb32bb0ca3395e6ca56770ea947372d3693196a11bc9ae0ebdc0
MD5 a4f0c942faf54a893f8be3df9117cf1d
BLAKE2b-256 23bead8d77f6042c8e6f0a9c7a856a815644ee86e9da05c71aa85e8201d51ad0

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_lmgc90-0.1.7-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.7-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for compas_lmgc90-0.1.7-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fa48d7a86f94765fbb98b72bab18c3ce611894e8c98be1afdea58f4b585abd35
MD5 e20898ba5dd1b34000bdd6a4ec07f2a1
BLAKE2b-256 7e1eee4c53780c61405bbbc4a1766d3b0f6df53978161c602d67aab4f7059428

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_lmgc90-0.1.7-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.7-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for compas_lmgc90-0.1.7-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 2a9909254e9a6c67f289d6221c4247db6d4a1a51285d7df8965066bdeac6eda3
MD5 719cfa5140c3286dccc264ffdaffc45a
BLAKE2b-256 2c39d7f941d66101680016930ce8ef5a790c60ead8f87f11cec09009c8dd76ca

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_lmgc90-0.1.7-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.7-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for compas_lmgc90-0.1.7-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1c69b280310d43094b34bcc5a11eb751a62b8fd6b503bd37e6ef52f69c38cd58
MD5 fe08994f7e8e8af33d3d5ad1588a1887
BLAKE2b-256 e951375cc628ab45f44bd6d94fd6dd89a109bde1e4661784228a1189eca4aa37

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_lmgc90-0.1.7-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.7-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for compas_lmgc90-0.1.7-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 22997bc9f8be17255efe3e88920c8b8541cc5a30b978917427f90d7900e3128f
MD5 60affdc6707699ba8685311866b1e505
BLAKE2b-256 8c68834764c7d41f59b08d602aa0a691c9494381b143f21cc26fcdc199d74c68

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_lmgc90-0.1.7-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.7-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for compas_lmgc90-0.1.7-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 81f466b5be21ae912647ac925ab9d4ca117d7c2aa2d87948adf440b6066aa185
MD5 37a4aacf3ea160a8846f9af0644fa02b
BLAKE2b-256 09b96d653a73a0e265ba7e346baa034a51fd5b25c0cf5a535d7769ae69b19f5b

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_lmgc90-0.1.7-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.7-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for compas_lmgc90-0.1.7-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 9daa907a21aa01f953c29f3fa87efce0a4384c73ab65eb342af4206e5a33b165
MD5 d44b415814f19c4c0d1c019babbd1988
BLAKE2b-256 882e0869743ac57461b9cf179c1b1e32d7ca2dc9ab19a276e0f82bba049e51ba

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_lmgc90-0.1.7-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.7-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for compas_lmgc90-0.1.7-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f6954a26cee92820aeb24796ed58f8a9697605f5957ca03fcf792bcef9742534
MD5 c8d80f53d916f805d0d6797a8ba3ace0
BLAKE2b-256 10ff2372214e1246dfdf66b9ebf41ec2b6b92f61ef0ab66c86770496dd19e37a

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_lmgc90-0.1.7-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.7-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for compas_lmgc90-0.1.7-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 b49475c87de6c15f8a08b0c04f6bbe480bb3f9f54e23996e78812b523d61de3e
MD5 0f1e4bb56a465b4485fc13d037363694
BLAKE2b-256 b3792237530a1310bf44bcd53f77ebf44066be9f647d43e1fcd75985b274d362

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_lmgc90-0.1.7-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.7-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for compas_lmgc90-0.1.7-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 651d7efe4f479b18075d062e2be7125b3ecf4c7febff6d1926c507f8716d410d
MD5 7394585f1f6a1c32017c816f84e7da3a
BLAKE2b-256 dd48710167442aa1c2f026470e3eeea3f837fd0eacbd5db0ef90562239a6700e

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_lmgc90-0.1.7-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.

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