Skip to content

Commit 0e8df57

Browse files
committed
analysis script from json
1 parent ab384a6 commit 0e8df57

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

scripts/dem_json_cra.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import pathlib
2+
3+
import compas
4+
5+
from compas_dem.analysis.cra import cra_penalty_solve
6+
from compas_dem.models import BlockModel
7+
from compas_dem.viewer import DEMViewer
8+
9+
# =============================================================================
10+
# Import
11+
# =============================================================================
12+
13+
model: BlockModel = compas.json_load(pathlib.Path(__file__).parent / "Masonry_DEM.json") # type: ignore
14+
15+
# =============================================================================
16+
# Contacts
17+
# =============================================================================
18+
19+
model.compute_contacts(tolerance=0.001)
20+
21+
# =============================================================================
22+
# Supports
23+
# =============================================================================
24+
25+
# =============================================================================
26+
# Equilibrium
27+
# =============================================================================
28+
29+
cra_penalty_solve(model)
30+
31+
# =============================================================================
32+
# Viz
33+
# =============================================================================
34+
35+
viewer = DEMViewer(model)
36+
viewer.setup()
37+
viewer.show()

0 commit comments

Comments
 (0)