PeriDEM 0.3.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
Loading...
Searching...
No Matches
run.py
Go to the documentation of this file.
1#!/usr/bin/env python3
2# -------------------------------------------
3# Copyright (c) 2021 - 2026 Prashant K. Jha
4# -------------------------------------------
5# PeriDEM https://github.com/prashjha/PeriDEM
6#
7# Distributed under the Boost Software License, Version 1.0. (See accompanying
8# file LICENSE)
9
10"""Run this example in-process from Python.
11
12``problem.py`` next to this file sets up the problem: geometry, materials,
13contact, boundary conditions and particle placement, through the ``peridem``
14interface. Run ``./problem.py --help`` for its arguments.
15
16To run the same problem through the C++ executable instead, hand it the deck:
17
18 ./problem.py --write-deck /tmp/input.json
19 <build>/bin/PeriDEM -i /tmp/input.json -nThreads 4
20"""
21
22from __future__ import annotations
23
24import sys
25from pathlib import Path
26
27sys.path.insert(0, str(Path(__file__).resolve().parent))
28
29from problem import main # noqa: E402
30
31if __name__ == "__main__":
32 raise SystemExit(main())