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.9.tar.gz (262.5 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.9-cp313-cp313-win_amd64.whl (17.8 MB view details)

Uploaded CPython 3.13Windows x86-64

compas_lmgc90-0.1.9-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.9-cp313-cp313-macosx_14_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

compas_lmgc90-0.1.9-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.9-cp312-cp312-macosx_14_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

compas_lmgc90-0.1.9-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.9-cp311-cp311-macosx_14_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

compas_lmgc90-0.1.9-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.9-cp310-cp310-macosx_14_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

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

Uploaded CPython 3.9Windows x86-64

compas_lmgc90-0.1.9-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.9-cp39-cp39-macosx_14_0_arm64.whl (4.1 MB view details)

Uploaded CPython 3.9macOS 14.0+ ARM64

File details

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

File metadata

  • Download URL: compas_lmgc90-0.1.9.tar.gz
  • Upload date:
  • Size: 262.5 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.9.tar.gz
Algorithm Hash digest
SHA256 885acc94d3a56f77c9a7cd84236777b5e4815534f936953f4602341ad0e4e468
MD5 de87094f4106ade68f71de219b65a5a9
BLAKE2b-256 d4b0ddc99285c72c46dfa80136423dd90868b053f4d5c0fa39e7a75b14d2ce0a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for compas_lmgc90-0.1.9-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 158570a29fde36fa14ddd918b4d81c246bbfa499fb08e1eb6f8929c11c604a6a
MD5 c34ce369e6206af9a23af6a7b50efb7e
BLAKE2b-256 b470f6db9d210c99ef572b44c00e4d13a107e2965fc7b7f6d79bfcb83c6e326c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for compas_lmgc90-0.1.9-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d52c1d226c809c99e691198d1555b26b6f69edfd89cffce1b9ea8d7a1f05bb25
MD5 8115129b8077593c4549e4d0d4639d8f
BLAKE2b-256 81edb0b3f9e2260469c5147c1d62542bdec10db85f926cc20e6094c77f673369

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_lmgc90-0.1.9-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.9-cp313-cp313-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for compas_lmgc90-0.1.9-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 751d834e4c622b1242fff2e7a26219fa6d2c7cc6e6bdc56ccdc6357a8621fe7b
MD5 60143ca11ed3cb8854f413f2e077c145
BLAKE2b-256 92b7676924285f21270ab4ecf11ed0be1cc056cecb02484e0cb511b73c8af3b2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for compas_lmgc90-0.1.9-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 bfc15347ba0e981dfbf1aafb036143dd142cf621f1e51c11e16635d7c0619cb2
MD5 d49c0b75e42ef4c30265a3d6001724d9
BLAKE2b-256 83055888f74cb837aa8cadc2b1cf02a714f67ff5892ca54a22ef5d88173d086c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for compas_lmgc90-0.1.9-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 87b8ba978cf098690367048db7d92ac054d72e6d9fe2834c2d391e5d326d77fe
MD5 ec1f604909e903037f3344e4352ca468
BLAKE2b-256 c308bdd6555a4cf113993804c80f8eba0177ddf8902094512af5c19c66ffd05f

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_lmgc90-0.1.9-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.9-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for compas_lmgc90-0.1.9-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 8c1d7357ca4e39a708f6fcee8e70a4c7f06974ffc0771c21a0088ad131609af2
MD5 abbc6d89713dc60d40bcacefda046b6c
BLAKE2b-256 39760e153040a387c880d7fad9bd359169b17934970d2251568d49151e3849d7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for compas_lmgc90-0.1.9-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 bfba592bae4668ef11168d19d16909199dd07bba66ec60a1f89f0fccf04d88cc
MD5 da1a95623c4057b7bd9145199531ba17
BLAKE2b-256 d5b8863ae5d723e2e5facb281e294c1b2798d1360952b23f67fb33635dd95502

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for compas_lmgc90-0.1.9-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 305343b26ef1ee41162d2292210e48ee414514e5c6afcbaafc211b0566290222
MD5 bab29b1484a669a1c85739eca70f7659
BLAKE2b-256 2f1f5585210853d8d6d8947b29e6a213dec69f0c627180b35ca9f1eb31da7f65

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_lmgc90-0.1.9-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.9-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for compas_lmgc90-0.1.9-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 da012ad1147c67bcc2a91872c911310e0e18d6f5370c5b222470947a419db0d8
MD5 317bfd46e76edebc03b327c1ec9d1d59
BLAKE2b-256 f446fd08ae546af28646e3b13c0661699e2b14602051c3d7164fbb5d89904fed

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for compas_lmgc90-0.1.9-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 9645118690c383d46368ed6417855c5536e3f03fae95271a55213e0c474bfc2c
MD5 1c02a026a15acf609b3d807478800fe7
BLAKE2b-256 2654c42e1ebe1f13dc2680d68b03322e1520b1bc5d6cd439c95dac1410b1d8b9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for compas_lmgc90-0.1.9-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c1891b63d00f02f8e7c3168d530d49826c1193586e203782626034ff351944e3
MD5 062de484afd7c70599a81d50437719e4
BLAKE2b-256 e6f5b6ec9095fc2589c5c573d5b8eb9f9b5c9f48793ce703e49850bb31141136

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_lmgc90-0.1.9-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.9-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for compas_lmgc90-0.1.9-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 f86d540d29ffc9c36037cdaa945a0f077a66561c97445f6518b3356ec2ab9a86
MD5 3fcd6d0d93ca7fc4ab95dec3a9835b37
BLAKE2b-256 b290129cb5fd01cc9e6b9f2364897d4f2adc70c2d8f881f293b55423fd5807eb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for compas_lmgc90-0.1.9-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 0ae20d09eb82f991630038e342012a9c1ac5fe2b22250999b462f23c6adf3393
MD5 c509829ba5545cf74a53200191af7662
BLAKE2b-256 a626aaca1a17d257fc4dbd35d2f7c5e8f8de24d45375a1a431322a2fac6ab9cf

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for compas_lmgc90-0.1.9-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 408f00b759aa94b4031c590b09d6919bafe9a3db366df62e56e2b196ec7deda2
MD5 1907e6b03e0481462cdb7ced80ef49f7
BLAKE2b-256 45183fbebaf1b326a082010433b74bc6603c17fbfdafae3f55d96bb7afbd5fb2

See more details on using hashes here.

Provenance

The following attestation bundles were made for compas_lmgc90-0.1.9-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.9-cp39-cp39-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for compas_lmgc90-0.1.9-cp39-cp39-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 83e2305f26c8203878ba0756f5a174cca856d76f3f4336a87bae9dc9903dcd91
MD5 d5539412af50cf2e1f236ab11517a12c
BLAKE2b-256 e5449bdff55821b7ae73c45367179edf13cb8c7bc5e69817711154b6edd7418e

See more details on using hashes here.

Provenance

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