Skip to content

Commit e99a77d

Browse files
committed
Pylauncher OpenSees doc
1 parent b81c6ca commit e99a77d

5 files changed

Lines changed: 118 additions & 94 deletions

File tree

docs/examples.md

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,16 @@ Discover and manage applications on DesignSafe.
77

88
---
99

10-
### Material Point Method (MPM) Jobs
10+
### Database Queries
11+
Access DesignSafe research databases (NGL, Earthquake Recovery, Vp).
12+
13+
[![Try on DesignSafe](https://raw.githubusercontent.com/DesignSafe-CI/dapi/main/DesignSafe-Badge.svg)](https://jupyter.designsafe-ci.org/hub/user-redirect/lab/tree/CommunityData/dapi/db.ipynb)
14+
15+
[Full documentation](examples/database.md)
16+
17+
---
18+
19+
### Material Point Method (MPM)
1120
Submit and monitor MPM simulations.
1221

1322
[![Try on DesignSafe](https://raw.githubusercontent.com/DesignSafe-CI/dapi/main/DesignSafe-Badge.svg)](https://jupyter.designsafe-ci.org/hub/user-redirect/lab/tree/CommunityData/dapi/mpm/mpm-minimal.ipynb)
@@ -16,12 +25,12 @@ Submit and monitor MPM simulations.
1625

1726
---
1827

19-
### PyLauncher Parameter Sweeps
20-
Run many independent tasks within a single SLURM allocation.
28+
### OpenFOAM CFD
29+
Computational fluid dynamics with OpenFOAM.
2130

22-
[![Try on DesignSafe](https://raw.githubusercontent.com/DesignSafe-CI/dapi/main/DesignSafe-Badge.svg)](https://jupyter.designsafe-ci.org/hub/user-redirect/lab/tree/CommunityData/dapi/pylauncher/pylauncher_sweep.ipynb)
31+
[![Try on DesignSafe](https://raw.githubusercontent.com/DesignSafe-CI/dapi/main/DesignSafe-Badge.svg)](https://jupyter.designsafe-ci.org/hub/user-redirect/lab/tree/CommunityData/dapi/openfoam/openfoam-minimal.ipynb)
2332

24-
[Full documentation](examples/pylauncher.md)
33+
[Full documentation](examples/openfoam.md)
2534

2635
---
2736

@@ -34,28 +43,16 @@ Earthquake engineering simulations with OpenSees.
3443

3544
---
3645

37-
### OpenFOAM CFD
38-
39-
Computational fluid dynamics with OpenFOAM.
40-
41-
[![Try on DesignSafe](https://raw.githubusercontent.com/DesignSafe-CI/dapi/main/DesignSafe-Badge.svg)](https://jupyter.designsafe-ci.org/hub/user-redirect/lab/tree/CommunityData/dapi/openfoam/openfoam-minimal.ipynb)
42-
43-
[Full documentation](examples/openfoam.md)
44-
45-
---
46-
47-
### Database Queries
48-
49-
Access DesignSafe research databases (NGL, Earthquake Recovery, Vp).
46+
### PyLauncher Parameter Sweeps
47+
Run many independent tasks within a single SLURM allocation.
5048

51-
[![Try on DesignSafe](https://raw.githubusercontent.com/DesignSafe-CI/dapi/main/DesignSafe-Badge.svg)](https://jupyter.designsafe-ci.org/hub/user-redirect/lab/tree/CommunityData/dapi/db.ipynb)
49+
[![Try on DesignSafe](https://raw.githubusercontent.com/DesignSafe-CI/dapi/main/DesignSafe-Badge.svg)](https://jupyter.designsafe-ci.org/hub/user-redirect/lab/tree/CommunityData/dapi/pylauncher/pylauncher_sweep.ipynb)
5250

53-
[Full documentation](examples/database.md)
51+
[Full documentation](examples/pylauncher.md)
5452

5553
---
5654

5755
### TMS Credentials
58-
5956
Manage SSH credentials on TACC execution systems.
6057

6158
[![Try on DesignSafe](https://raw.githubusercontent.com/DesignSafe-CI/dapi/main/DesignSafe-Badge.svg)](https://jupyter.designsafe-ci.org/hub/user-redirect/lab/tree/CommunityData/dapi/tms_credentials.ipynb)

docs/examples/pylauncher.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Two styles are supported for command templates:
8787

8888
## OpenSees Example
8989

90-
A parameter sweep for a cantilever pushover analysis:
90+
A parameter sweep for a cantilever pushover analysis. See the full notebook: [![Try on DesignSafe](https://raw.githubusercontent.com/DesignSafe-CI/dapi/main/DesignSafe-Badge.svg)](https://jupyter.designsafe-ci.org/hub/user-redirect/lab/tree/CommunityData/dapi/pylauncher/pylauncher_opensees.ipynb)
9191

9292
```python
9393
sweep = {
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# PyLauncher: OpenSees Cantilever Sweep
2+
3+
A parameter sweep over a 2D cantilever pushover analysis using PyLauncher.
4+
5+
[![Try on DesignSafe](https://raw.githubusercontent.com/DesignSafe-CI/dapi/main/DesignSafe-Badge.svg)](https://jupyter.designsafe-ci.org/hub/user-redirect/lab/tree/CommunityData/dapi/pylauncher/pylauncher_opensees.ipynb)
6+
7+
For PyLauncher basics, see [PyLauncher Parameter Sweeps](pylauncher.md).
8+
9+
## The model
10+
11+
```
12+
^Y
13+
|
14+
2 __
15+
| |
16+
| |
17+
| |
18+
(1) LCol
19+
| |
20+
| |
21+
| |
22+
=1= ---- -------->X
23+
```
24+
25+
- Node 1: fixed base
26+
- Node 2: free top with `NodalMass`
27+
- Elastic beam-column element (A=3.6e9, E=4227, I=1.08e6)
28+
- Gravity load (2000 kip down) then lateral pushover (displacement-controlled, 1000 steps)
29+
30+
## Sweep parameters
31+
32+
5 nodal masses x 3 column lengths = 15 independent runs.
33+
34+
```python
35+
sweep = {
36+
"NODAL_MASS": [4.19, 4.39, 4.59, 4.79, 4.99],
37+
"LCOL": [100, 200, 300],
38+
}
39+
```
40+
41+
## Preview
42+
43+
```python
44+
ds.jobs.parametric_sweep.generate(
45+
"python3 cantilever.py --NodalMass NODAL_MASS --LCol LCOL --outDir out_NODAL_MASS_LCOL",
46+
sweep,
47+
preview=True,
48+
)
49+
```
50+
51+
## Generate and submit
52+
53+
```python
54+
ds.jobs.parametric_sweep.generate(
55+
"python3 cantilever.py --NodalMass NODAL_MASS --LCol LCOL --outDir out_NODAL_MASS_LCOL",
56+
sweep,
57+
"/home/jupyter/MyData/opensees_sweep/",
58+
)
59+
60+
job = ds.jobs.parametric_sweep.submit(
61+
"/MyData/opensees_sweep/",
62+
app_id="designsafe-agnostic-app",
63+
allocation="your_allocation",
64+
node_count=1,
65+
cores_per_node=48,
66+
max_minutes=30,
67+
)
68+
job.monitor()
69+
```
70+
71+
## Output
72+
73+
Each run writes to its own directory (`out_4.19_100`, `out_4.19_200`, etc.) containing:
74+
75+
- `DFree.out` — free node displacements
76+
- `RBase.out` — base reactions
77+
- `FCol.out` — column element forces

docs/installation.md

Lines changed: 18 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,47 @@
11
# Installation
22

3-
## Requirements
4-
5-
- Python 3.10+
6-
- A DesignSafe account ([register](https://www.designsafe-ci.org/account/register/))
7-
8-
## Install from PyPI
3+
## From PyPI
94

105
```bash
116
pip install dapi
127
```
138

14-
## Install Development Version
15-
16-
```bash
17-
pip install git+https://github.com/DesignSafe-CI/dapi.git@dev
18-
```
19-
20-
## Install for Development
21-
22-
```bash
23-
git clone https://github.com/DesignSafe-CI/dapi.git
24-
cd dapi
25-
26-
# Install Poetry (if not already installed)
27-
curl -sSL https://install.python-poetry.org | python3 -
28-
29-
# Install dependencies
30-
virtualenv env && source env/bin/activate
31-
poetry install
32-
```
33-
34-
Or install an editable local copy:
35-
```
36-
pip install -e .
37-
```
38-
39-
## DesignSafe Jupyter Hub
40-
41-
Install dapi in a notebook:
9+
## In a Jupyter notebook
4210

4311
```python
44-
# Remove any previous installations (optional)
45-
!pip uninstall dapi -y
46-
47-
# Install the latest version
48-
!pip install dapi --quiet
49-
50-
# Restart kernel after installation
51-
# Kernel >> Restart Kernel (in Jupyter menu)
52-
```
53-
54-
:::{tip} Kernel Restart Required
55-
After installing dapi in a Jupyter notebook, restart the kernel for changes to take effect. Go to **Kernel -> Restart Kernel**.
56-
:::
57-
58-
For a persistent installation across sessions:
59-
60-
```bash
61-
# SSH into your DesignSafe workspace terminal
62-
pip install --user dapi
12+
%pip install dapi --quiet
6313
```
6414

65-
## Verify Installation
15+
## Check version
6616

6717
```python
6818
import dapi
6919
print(dapi.__version__)
7020
```
7121

72-
## Updating
22+
## Development version
7323

7424
```bash
75-
pip install --upgrade dapi
25+
pip install git+https://github.com/DesignSafe-CI/dapi.git@dev
7626
```
7727

78-
## Troubleshooting
28+
Or in a notebook:
7929

80-
**Permission errors:**
81-
```bash
82-
pip install --user dapi
30+
```python
31+
%pip uninstall dapi --yes
32+
%pip install git+https://github.com/DesignSafe-CI/dapi.git@dev --quiet
8333
```
8434

85-
**SSL certificate errors:**
86-
```bash
87-
pip install --trusted-host pypi.org --trusted-host pypi.python.org dapi
88-
```
35+
## Local editable install
8936

90-
**Version conflicts:**
9137
```bash
92-
pip install dapi --force-reinstall
38+
git clone https://github.com/DesignSafe-CI/dapi.git
39+
cd dapi
40+
pip install -e .
9341
```
9442

95-
## Next Steps
43+
## Update
9644

97-
1. [Set up authentication](authentication.md)
98-
2. [Quick start guide](quickstart.md)
45+
```bash
46+
pip install --upgrade dapi
47+
```

myst.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,13 @@ project:
2222
children:
2323
- file: docs/examples.md
2424
- file: docs/examples/apps.md
25+
- file: docs/examples/database.md
2526
- file: docs/examples/mpm.md
26-
- file: docs/examples/opensees.md
2727
- file: docs/examples/openfoam.md
28+
- file: docs/examples/opensees.md
2829
- file: docs/examples/pylauncher.md
30+
- file: docs/examples/pylauncher_opensees.md
2931
- file: docs/examples/tms_credentials.md
30-
- file: docs/examples/database.md
3132
- url: /dapi/api/
3233
title: API Reference
3334
exclude:
@@ -40,9 +41,9 @@ project:
4041
- AUTHORS.md
4142
- LICENSE.md
4243
site:
43-
base_url: /dapi
4444
template: book-theme
4545
options:
46+
base_url: /dapi
4647
logo: docs/nheri.png
4748
favicon: docs/favicon.ico
4849
hide_footer_text: true

0 commit comments

Comments
 (0)