Metadata-Version: 2.4
Name: compas_3dec
Version: 0.2.0
Summary: A COMPAS integration for rigid-block analysis with Itasca 3DEC.
Author: Petras Vestartas
Author-email: Alessandro Dell'Endice <dellendice@arch.ethz.ch>
License-Expression: MIT
Project-URL: Homepage, https://blockresearchgroup.github.io/compas_3dec
Project-URL: Documentation, https://blockresearchgroup.github.io/compas_3dec
Project-URL: Repository, https://github.com/BlockResearchGroup/compas_3dec.git
Project-URL: Changelog, https://github.com/BlockResearchGroup/compas_3dec/blob/main/CHANGELOG.md
Keywords: compas,3dec,dem,masonry,rigid-block
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: AUTHORS.md
Requires-Dist: compas>=2.0
Provides-Extra: dem
Requires-Dist: compas_dem>0.5.0; extra == "dem"
Requires-Dist: compas_model; extra == "dem"
Provides-Extra: dev
Requires-Dist: build; extra == "dev"
Requires-Dist: bump-my-version; extra == "dev"
Requires-Dist: compas_invocations2; extra == "dev"
Requires-Dist: compas_model; extra == "dev"
Requires-Dist: invoke>=0.14; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: twine; extra == "dev"
Requires-Dist: wheel; extra == "dev"
Provides-Extra: docs
Requires-Dist: mkdocs>=1.6; extra == "docs"
Requires-Dist: mkdocs-material>=9.5; extra == "docs"
Requires-Dist: mkdocstrings[python]; extra == "docs"
Dynamic: license-file

# compas_3dec

`compas_3dec` is a COMPAS integration for preparing, running, and
post-processing rigid-block analyses with 3DEC by Itasca Consulting Group.

## Installation

```bash
pip install compas_3dec
```

Install COMPAS DEM interoperability support with:

```bash
pip install "compas_3dec[dem]"
```

For local development, clone the repository and install the development and
documentation dependencies with:

```bash
pip install "compas_dem @ git+https://github.com/BlockResearchGroup/compas_dem.git@main"
pip install -e ".[dev,docs]"
```

The 3DEC executable is proprietary and must be installed separately.

## Usage

```python
from compas_3dec import ThreeDECAnalysisBuilder, ThreeDECSolver

builder = ThreeDECAnalysisBuilder.from_meshes(meshes, name="Arch gravity")
builder.set_material(density=2500, young_modulus=25e9, poisson_ratio=0.2)
builder.set_supports([0, 9])
builder.set_contact_properties()
builder.add_gravity()

analysis = builder.build()
results = ThreeDECSolver(workspace=r"C:\path\to\runs").solve(analysis)
```

Inputs can also be translated from a `compas_dem` problem with
`ThreeDECAnalysisBuilder.from_dem_problem`.

Native results can be processed selectively or converted to the limited
`compas_dem.Results` contract:

```python
contacts = results.postprocess_contacts(analysis)
failure = results.postprocess_failure(analysis)
dem_results = results.to_compas_dem_results(analysis)
```

## Development

```bash
pytest
ruff check .
ruff format .
mkdocs serve
```

Automated tests live in `tests/`. Executable analysis and visualisation
scripts live in `scripts/`. Generated solver runs should be stored outside the
repository or in an ignored `runs/` directory.
