lythossettle 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- lythossettle-0.1.0/LICENSE +21 -0
- lythossettle-0.1.0/PKG-INFO +224 -0
- lythossettle-0.1.0/README.md +180 -0
- lythossettle-0.1.0/lythossettle/__init__.py +45 -0
- lythossettle-0.1.0/lythossettle/__main__.py +6 -0
- lythossettle-0.1.0/lythossettle/cli.py +137 -0
- lythossettle-0.1.0/lythossettle/config.py +116 -0
- lythossettle-0.1.0/lythossettle/consolidation.py +100 -0
- lythossettle-0.1.0/lythossettle/engine.py +619 -0
- lythossettle-0.1.0/lythossettle/forms.py +418 -0
- lythossettle-0.1.0/lythossettle/i18n.py +374 -0
- lythossettle-0.1.0/lythossettle/pdf.py +322 -0
- lythossettle-0.1.0/lythossettle/plot_style.py +61 -0
- lythossettle-0.1.0/lythossettle/plotting.py +367 -0
- lythossettle-0.1.0/lythossettle/render.py +77 -0
- lythossettle-0.1.0/lythossettle/report.py +609 -0
- lythossettle-0.1.0/lythossettle/stress.py +317 -0
- lythossettle-0.1.0/lythossettle/study.py +364 -0
- lythossettle-0.1.0/lythossettle/study_plots.py +208 -0
- lythossettle-0.1.0/lythossettle/summary.py +181 -0
- lythossettle-0.1.0/lythossettle/web/__init__.py +4 -0
- lythossettle-0.1.0/lythossettle/web/server.py +201 -0
- lythossettle-0.1.0/lythossettle/web/session.py +303 -0
- lythossettle-0.1.0/lythossettle/web/static/app.js +711 -0
- lythossettle-0.1.0/lythossettle/web/static/index.html +106 -0
- lythossettle-0.1.0/lythossettle/web/static/style.css +303 -0
- lythossettle-0.1.0/lythossettle/web/strings.py +69 -0
- lythossettle-0.1.0/lythossettle.egg-info/PKG-INFO +224 -0
- lythossettle-0.1.0/lythossettle.egg-info/SOURCES.txt +44 -0
- lythossettle-0.1.0/lythossettle.egg-info/dependency_links.txt +1 -0
- lythossettle-0.1.0/lythossettle.egg-info/entry_points.txt +2 -0
- lythossettle-0.1.0/lythossettle.egg-info/requires.txt +17 -0
- lythossettle-0.1.0/lythossettle.egg-info/top_level.txt +1 -0
- lythossettle-0.1.0/pyproject.toml +81 -0
- lythossettle-0.1.0/setup.cfg +4 -0
- lythossettle-0.1.0/tests/test_consolidation.py +62 -0
- lythossettle-0.1.0/tests/test_embankment.py +194 -0
- lythossettle-0.1.0/tests/test_engine.py +246 -0
- lythossettle-0.1.0/tests/test_forms.py +77 -0
- lythossettle-0.1.0/tests/test_i18n.py +34 -0
- lythossettle-0.1.0/tests/test_packaging.py +118 -0
- lythossettle-0.1.0/tests/test_pdf.py +42 -0
- lythossettle-0.1.0/tests/test_report.py +78 -0
- lythossettle-0.1.0/tests/test_stress.py +160 -0
- lythossettle-0.1.0/tests/test_study.py +158 -0
- lythossettle-0.1.0/tests/test_web.py +272 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Hasan Deniz Altuntaş
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: lythossettle
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Settlement analysis of shallow foundations and embankments: Boussinesq / 2:1 stress distribution, immediate settlement (Steinbrenner, Schmertmann), primary consolidation and secondary compression, Terzaghi time–settlement, and parametric / reliability studies with PDF reporting.
|
|
5
|
+
Author-email: Hasan Deniz Altuntaş <lythosfea@gmail.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/hdaltuntas/lythos-settle
|
|
8
|
+
Project-URL: Repository, https://github.com/hdaltuntas/lythos-settle
|
|
9
|
+
Project-URL: Issues, https://github.com/hdaltuntas/lythos-settle/issues
|
|
10
|
+
Project-URL: Releasing, https://github.com/hdaltuntas/lythos-settle/blob/main/docs/releasing.md
|
|
11
|
+
Keywords: geotechnical,settlement,foundation,shallow foundation,raft,footing,consolidation,terzaghi,boussinesq,steinbrenner,schmertmann,secondary compression,angular distortion,reliability,monte carlo,civil engineering
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Environment :: Web Environment
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: Intended Audience :: Education
|
|
16
|
+
Classifier: Natural Language :: English
|
|
17
|
+
Classifier: Natural Language :: Turkish
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
24
|
+
Classifier: Topic :: Scientific/Engineering
|
|
25
|
+
Classifier: Topic :: Scientific/Engineering :: Visualization
|
|
26
|
+
Requires-Python: >=3.10
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
License-File: LICENSE
|
|
29
|
+
Requires-Dist: numpy>=1.24
|
|
30
|
+
Requires-Dist: matplotlib>=3.7
|
|
31
|
+
Requires-Dist: reportlab>=4.0
|
|
32
|
+
Provides-Extra: docx
|
|
33
|
+
Requires-Dist: python-docx>=0.8; extra == "docx"
|
|
34
|
+
Provides-Extra: xlsx
|
|
35
|
+
Requires-Dist: openpyxl>=3.0; extra == "xlsx"
|
|
36
|
+
Provides-Extra: dev
|
|
37
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
38
|
+
Requires-Dist: ruff>=0.4; extra == "dev"
|
|
39
|
+
Requires-Dist: build>=1.0; extra == "dev"
|
|
40
|
+
Requires-Dist: twine>=5.0; extra == "dev"
|
|
41
|
+
Requires-Dist: python-docx>=0.8; extra == "dev"
|
|
42
|
+
Requires-Dist: openpyxl>=3.0; extra == "dev"
|
|
43
|
+
Dynamic: license-file
|
|
44
|
+
|
|
45
|
+
**English** | [Türkçe](https://github.com/hdaltuntas/lythos-settle/blob/main/README.tr.md)
|
|
46
|
+
|
|
47
|
+
# Lythos Settle
|
|
48
|
+
|
|
49
|
+
[](https://github.com/hdaltuntas/lythos-settle/actions/workflows/tests.yml)
|
|
50
|
+
|
|
51
|
+
Settlement analysis of shallow foundations and embankments, driven from your browser. A
|
|
52
|
+
rectangular, strip or circular foundation — or an embankment given by its crest width,
|
|
53
|
+
height and slope angles — on a layered soil profile is analysed for **how much** it settles
|
|
54
|
+
and **how fast**:
|
|
55
|
+
|
|
56
|
+
1. **Stresses** — in-situ σv0, u0, σ'v0 and σ'p; the stress increase beneath the foundation
|
|
57
|
+
by Boussinesq (Newmark's rectangle, the strip and the circle solutions) or by the 2:1
|
|
58
|
+
spread, at the centre, the characteristic point, the middle of the long edge and the corner;
|
|
59
|
+
under an embankment, exactly for its trapezoidal load, at the crest centre, the crest edge,
|
|
60
|
+
the middle of the slope and the toe.
|
|
61
|
+
2. **Immediate settlement** — layered elastic (Steinbrenner) in every layer, or
|
|
62
|
+
Schmertmann (1978) in the granular layers.
|
|
63
|
+
3. **Consolidation** — primary settlement of the clay layers from Cc, Cr, e0 and σ'p, and
|
|
64
|
+
secondary compression from Cα up to the design life.
|
|
65
|
+
4. **Time** — Terzaghi's one-dimensional consolidation, each clay layer draining on its own;
|
|
66
|
+
t50, t90 and the time–settlement curve.
|
|
67
|
+
5. **Checks** — total settlement and angular distortion against their allowable values.
|
|
68
|
+
|
|
69
|
+
On top of it, a **parametric or reliability study** sweeps any input — a range, or a
|
|
70
|
+
distribution — and reports sensitivities and the probability of exceeding the allowable
|
|
71
|
+
settlement or distortion, with a confidence interval and the reliability index β.
|
|
72
|
+
|
|
73
|
+
The whole program — every label, result text, figure and report — is bilingual in
|
|
74
|
+
**English and Turkish**, switchable while it runs.
|
|
75
|
+
|
|
76
|
+
The interface is a small HTTP server on your own machine, driven from a browser. That
|
|
77
|
+
keeps the program usable over a remote session or inside a container, where a desktop
|
|
78
|
+
toolkit would need a display it does not have, and it costs no dependency beyond the
|
|
79
|
+
standard library.
|
|
80
|
+
|
|
81
|
+
> This is the sibling of [LythosFEA](https://github.com/hdaltuntas/lythos),
|
|
82
|
+
> [Lythos Kinematic](https://github.com/hdaltuntas/lythoskinematic),
|
|
83
|
+
> [Lythos SPWA](https://github.com/hdaltuntas/lythosspwa) and
|
|
84
|
+
> [LythosLE](https://github.com/hdaltuntas/lythosle), and follows the same architecture.
|
|
85
|
+
|
|
86
|
+
## Screenshots
|
|
87
|
+
|
|
88
|
+
| Results summary | Time–settlement |
|
|
89
|
+
|---|---|
|
|
90
|
+
|  |  |
|
|
91
|
+
|
|
92
|
+
| Reliability study | Settlement with depth, dark theme, Turkish |
|
|
93
|
+
|---|---|
|
|
94
|
+
|  |  |
|
|
95
|
+
|
|
96
|
+
| Embankment on soft clay | Settlement across the embankment |
|
|
97
|
+
|---|---|
|
|
98
|
+
|  |  |
|
|
99
|
+
|
|
100
|
+
## Install & run
|
|
101
|
+
|
|
102
|
+
From a clone, with nothing installed but the scientific stack:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
pip install numpy matplotlib reportlab
|
|
106
|
+
python main.py
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
or install it and use the command:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
pip install .
|
|
113
|
+
lythos-settle # opens the interface in your browser
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
`main.py` puts its own directory first on the import path, so the clone's code is what
|
|
117
|
+
runs even when `lythossettle` is also installed.
|
|
118
|
+
|
|
119
|
+
Python 3.10+ is required. Word reports need `python-docx` and the spreadsheet export of a
|
|
120
|
+
study needs `openpyxl`; both are extras (`pip install ".[docx,xlsx]"`).
|
|
121
|
+
|
|
122
|
+
## Command line
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
lythos-settle # web interface (the default)
|
|
126
|
+
lythos-settle web --port 9000 --lang tr --no-browser
|
|
127
|
+
lythos-settle example -o project.settle # a starter project file
|
|
128
|
+
lythos-settle run project.settle -o report.pdf # analyse, print the results, write a report
|
|
129
|
+
lythos-settle study project.settle -o samples.csv
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
`run` and `study` read the same `.settle` file the interface saves, so a case set up in
|
|
133
|
+
the browser can be re-run unattended.
|
|
134
|
+
|
|
135
|
+
## Inputs
|
|
136
|
+
|
|
137
|
+
* **Foundation:** shape (rectangle, strip, circle), B (diameter of a circle), L, depth Df,
|
|
138
|
+
gross bearing pressure q; optionally the excavated overburden is deducted
|
|
139
|
+
(q_net = q − σv0(Df)).
|
|
140
|
+
* **Embankment** (shape "embankment"): crest width, height H, left and right slope angles
|
|
141
|
+
from the horizontal, unit weight of the fill γ; the load is γ·H under the crest, falling
|
|
142
|
+
linearly to zero at the toes.
|
|
143
|
+
* **Groundwater:** depth of the water table, γw.
|
|
144
|
+
* **Soil profile**, from the surface down, one row per layer: thickness, granular or
|
|
145
|
+
cohesive, γ, γsat, E, ν, and for the clays Cc, Cr, e0, OCR, cv, Cα and single / double
|
|
146
|
+
drainage. E is the drained modulus of a sand and the undrained modulus of a clay.
|
|
147
|
+
* **Options:** stress distribution, immediate-settlement method, flexible or rigid
|
|
148
|
+
foundation, sublayer thickness, influence-depth ratio Δσ/σ'v0, design life, Schmertmann's
|
|
149
|
+
creep factor.
|
|
150
|
+
* **Criteria:** allowable total settlement and angular distortion (1/x).
|
|
151
|
+
|
|
152
|
+
## What it computes
|
|
153
|
+
|
|
154
|
+
| quantity | method |
|
|
155
|
+
|---|---|
|
|
156
|
+
| Δσ under a rectangle | Newmark's integration of Boussinesq, superposed for any point |
|
|
157
|
+
| Δσ under a strip / circle | closed form / exact one-dimensional integral over the polar angle |
|
|
158
|
+
| Δσ under an embankment | exact: Flamant's line load integrated over the piecewise-linear (trapezoidal) load |
|
|
159
|
+
| Δσ, approximate | 2:1 spread |
|
|
160
|
+
| embankment, immediate | Steinbrenner in plane strain, the crest as one strip and each slope as 16 slices |
|
|
161
|
+
| immediate settlement | Steinbrenner F1, F2 on each layer (layered elastic), or Schmertmann (1978) with C1, C2 and the L/B-interpolated influence diagram |
|
|
162
|
+
| primary consolidation | Cr up to σ'p = OCR·σ'v0, Cc beyond it, sublayer by sublayer at each point |
|
|
163
|
+
| secondary compression | Cα/(1+e0)·H·log(t/t_p) from U = 95 % to the design life; Cα·Cr/Cc where the clay stays over-consolidated |
|
|
164
|
+
| time | Terzaghi U(Tv), per clay layer, H_dr = H/2 or H |
|
|
165
|
+
| rigid foundation | settlement of the characteristic point (0.74·B/2, 0.74·L/2; 0.845·R) |
|
|
166
|
+
| angular distortion | (s_centre − s_edge) / (B/2) |
|
|
167
|
+
|
|
168
|
+
The derivations and their limits are in [docs/theory.md](https://github.com/hdaltuntas/lythos-settle/blob/main/docs/theory.md).
|
|
169
|
+
|
|
170
|
+
## Figures
|
|
171
|
+
|
|
172
|
+
Section with the Boussinesq stress bulb · stresses with depth (σ'v0, σ'v0 + Δσ, σ'p and the
|
|
173
|
+
influence-depth criterion) · influence factors at each point with Schmertmann's Iz ·
|
|
174
|
+
cumulative settlement with depth · time–settlement curve · settlement components at each
|
|
175
|
+
point · settlement across the section (the settlement trough under a footing or a fill). Study figures: one-at-a-time sweep, histogram, scatter, tornado.
|
|
176
|
+
|
|
177
|
+
## Reports
|
|
178
|
+
|
|
179
|
+
Choose PDF, self-contained HTML or Word in the header and press *Export report…*. The
|
|
180
|
+
report carries the inputs, the stresses, the settlement at each point and in each layer,
|
|
181
|
+
the Schmertmann factors, the consolidation times, the checks, the figures, the warnings,
|
|
182
|
+
the method notes and — if one was run — the study, in whichever language the interface is
|
|
183
|
+
in. All three formats are assembled from one place, so they say the same thing.
|
|
184
|
+
|
|
185
|
+
## Project files (`.settle`)
|
|
186
|
+
|
|
187
|
+
JSON. *Save* writes the inputs and the study definition; *Open…* reads them back. Missing
|
|
188
|
+
entries keep their defaults.
|
|
189
|
+
|
|
190
|
+
## Modules
|
|
191
|
+
|
|
192
|
+
| file | content |
|
|
193
|
+
|---|---|
|
|
194
|
+
| `lythossettle/stress.py` | Boussinesq (rectangle, strip, circle), 2:1, Steinbrenner |
|
|
195
|
+
| `lythossettle/consolidation.py` | Terzaghi U(Tv) and its inverse, compression of clay, secondary compression |
|
|
196
|
+
| `lythossettle/engine.py` | The settlement analysis: profile, sublayers, points, checks, time curve |
|
|
197
|
+
| `lythossettle/study.py`, `study_plots.py` | Parametric (one at a time) and reliability (LHS / Monte Carlo) studies, statistics, P of exceedance with 95 % CI and β, Spearman sensitivities, CSV / XLSX |
|
|
198
|
+
| `lythossettle/plotting.py`, `plot_style.py`, `render.py` | Matplotlib figures, theme-aware, off-screen |
|
|
199
|
+
| `lythossettle/report.py`, `pdf.py` | Calculation report: one HTML assembly, exported as PDF (reportlab), HTML or DOCX |
|
|
200
|
+
| `lythossettle/forms.py` | Input schema and readers; converts between the interface's flat values and the engine's configuration |
|
|
201
|
+
| `lythossettle/summary.py` | The results as cards and as text, for the browser and the command line alike |
|
|
202
|
+
| `lythossettle/i18n.py` | Every text, English and Turkish, written side by side |
|
|
203
|
+
| `lythossettle/web/` | The local HTTP server, the session, and the browser interface |
|
|
204
|
+
|
|
205
|
+
## Development
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
pip install -e ".[dev]"
|
|
209
|
+
pytest -q # engine against hand calculations, stresses against tables, study, report, web, packaging
|
|
210
|
+
ruff check .
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
The tests check the stress solutions against published values and brute-force integrals,
|
|
214
|
+
the engine against closed-form cases (a square on an elastic half-space, a one-dimensional
|
|
215
|
+
clay layer, Schmertmann by hand), the report in all three formats, the input schema and its
|
|
216
|
+
file round-trips, and the interface itself — the session and the HTTP layer both, so the
|
|
217
|
+
browser is exercised without a browser.
|
|
218
|
+
|
|
219
|
+
Releasing to PyPI is described in [docs/releasing.md](https://github.com/hdaltuntas/lythos-settle/blob/main/docs/releasing.md);
|
|
220
|
+
`tools/upload_to_pypi.py` does it from an editor, without a terminal.
|
|
221
|
+
|
|
222
|
+
## License
|
|
223
|
+
|
|
224
|
+
[MIT](https://github.com/hdaltuntas/lythos-settle/blob/main/LICENSE) © 2026 Hasan Deniz Altuntaş
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
**English** | [Türkçe](https://github.com/hdaltuntas/lythos-settle/blob/main/README.tr.md)
|
|
2
|
+
|
|
3
|
+
# Lythos Settle
|
|
4
|
+
|
|
5
|
+
[](https://github.com/hdaltuntas/lythos-settle/actions/workflows/tests.yml)
|
|
6
|
+
|
|
7
|
+
Settlement analysis of shallow foundations and embankments, driven from your browser. A
|
|
8
|
+
rectangular, strip or circular foundation — or an embankment given by its crest width,
|
|
9
|
+
height and slope angles — on a layered soil profile is analysed for **how much** it settles
|
|
10
|
+
and **how fast**:
|
|
11
|
+
|
|
12
|
+
1. **Stresses** — in-situ σv0, u0, σ'v0 and σ'p; the stress increase beneath the foundation
|
|
13
|
+
by Boussinesq (Newmark's rectangle, the strip and the circle solutions) or by the 2:1
|
|
14
|
+
spread, at the centre, the characteristic point, the middle of the long edge and the corner;
|
|
15
|
+
under an embankment, exactly for its trapezoidal load, at the crest centre, the crest edge,
|
|
16
|
+
the middle of the slope and the toe.
|
|
17
|
+
2. **Immediate settlement** — layered elastic (Steinbrenner) in every layer, or
|
|
18
|
+
Schmertmann (1978) in the granular layers.
|
|
19
|
+
3. **Consolidation** — primary settlement of the clay layers from Cc, Cr, e0 and σ'p, and
|
|
20
|
+
secondary compression from Cα up to the design life.
|
|
21
|
+
4. **Time** — Terzaghi's one-dimensional consolidation, each clay layer draining on its own;
|
|
22
|
+
t50, t90 and the time–settlement curve.
|
|
23
|
+
5. **Checks** — total settlement and angular distortion against their allowable values.
|
|
24
|
+
|
|
25
|
+
On top of it, a **parametric or reliability study** sweeps any input — a range, or a
|
|
26
|
+
distribution — and reports sensitivities and the probability of exceeding the allowable
|
|
27
|
+
settlement or distortion, with a confidence interval and the reliability index β.
|
|
28
|
+
|
|
29
|
+
The whole program — every label, result text, figure and report — is bilingual in
|
|
30
|
+
**English and Turkish**, switchable while it runs.
|
|
31
|
+
|
|
32
|
+
The interface is a small HTTP server on your own machine, driven from a browser. That
|
|
33
|
+
keeps the program usable over a remote session or inside a container, where a desktop
|
|
34
|
+
toolkit would need a display it does not have, and it costs no dependency beyond the
|
|
35
|
+
standard library.
|
|
36
|
+
|
|
37
|
+
> This is the sibling of [LythosFEA](https://github.com/hdaltuntas/lythos),
|
|
38
|
+
> [Lythos Kinematic](https://github.com/hdaltuntas/lythoskinematic),
|
|
39
|
+
> [Lythos SPWA](https://github.com/hdaltuntas/lythosspwa) and
|
|
40
|
+
> [LythosLE](https://github.com/hdaltuntas/lythosle), and follows the same architecture.
|
|
41
|
+
|
|
42
|
+
## Screenshots
|
|
43
|
+
|
|
44
|
+
| Results summary | Time–settlement |
|
|
45
|
+
|---|---|
|
|
46
|
+
|  |  |
|
|
47
|
+
|
|
48
|
+
| Reliability study | Settlement with depth, dark theme, Turkish |
|
|
49
|
+
|---|---|
|
|
50
|
+
|  |  |
|
|
51
|
+
|
|
52
|
+
| Embankment on soft clay | Settlement across the embankment |
|
|
53
|
+
|---|---|
|
|
54
|
+
|  |  |
|
|
55
|
+
|
|
56
|
+
## Install & run
|
|
57
|
+
|
|
58
|
+
From a clone, with nothing installed but the scientific stack:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
pip install numpy matplotlib reportlab
|
|
62
|
+
python main.py
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
or install it and use the command:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
pip install .
|
|
69
|
+
lythos-settle # opens the interface in your browser
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
`main.py` puts its own directory first on the import path, so the clone's code is what
|
|
73
|
+
runs even when `lythossettle` is also installed.
|
|
74
|
+
|
|
75
|
+
Python 3.10+ is required. Word reports need `python-docx` and the spreadsheet export of a
|
|
76
|
+
study needs `openpyxl`; both are extras (`pip install ".[docx,xlsx]"`).
|
|
77
|
+
|
|
78
|
+
## Command line
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
lythos-settle # web interface (the default)
|
|
82
|
+
lythos-settle web --port 9000 --lang tr --no-browser
|
|
83
|
+
lythos-settle example -o project.settle # a starter project file
|
|
84
|
+
lythos-settle run project.settle -o report.pdf # analyse, print the results, write a report
|
|
85
|
+
lythos-settle study project.settle -o samples.csv
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
`run` and `study` read the same `.settle` file the interface saves, so a case set up in
|
|
89
|
+
the browser can be re-run unattended.
|
|
90
|
+
|
|
91
|
+
## Inputs
|
|
92
|
+
|
|
93
|
+
* **Foundation:** shape (rectangle, strip, circle), B (diameter of a circle), L, depth Df,
|
|
94
|
+
gross bearing pressure q; optionally the excavated overburden is deducted
|
|
95
|
+
(q_net = q − σv0(Df)).
|
|
96
|
+
* **Embankment** (shape "embankment"): crest width, height H, left and right slope angles
|
|
97
|
+
from the horizontal, unit weight of the fill γ; the load is γ·H under the crest, falling
|
|
98
|
+
linearly to zero at the toes.
|
|
99
|
+
* **Groundwater:** depth of the water table, γw.
|
|
100
|
+
* **Soil profile**, from the surface down, one row per layer: thickness, granular or
|
|
101
|
+
cohesive, γ, γsat, E, ν, and for the clays Cc, Cr, e0, OCR, cv, Cα and single / double
|
|
102
|
+
drainage. E is the drained modulus of a sand and the undrained modulus of a clay.
|
|
103
|
+
* **Options:** stress distribution, immediate-settlement method, flexible or rigid
|
|
104
|
+
foundation, sublayer thickness, influence-depth ratio Δσ/σ'v0, design life, Schmertmann's
|
|
105
|
+
creep factor.
|
|
106
|
+
* **Criteria:** allowable total settlement and angular distortion (1/x).
|
|
107
|
+
|
|
108
|
+
## What it computes
|
|
109
|
+
|
|
110
|
+
| quantity | method |
|
|
111
|
+
|---|---|
|
|
112
|
+
| Δσ under a rectangle | Newmark's integration of Boussinesq, superposed for any point |
|
|
113
|
+
| Δσ under a strip / circle | closed form / exact one-dimensional integral over the polar angle |
|
|
114
|
+
| Δσ under an embankment | exact: Flamant's line load integrated over the piecewise-linear (trapezoidal) load |
|
|
115
|
+
| Δσ, approximate | 2:1 spread |
|
|
116
|
+
| embankment, immediate | Steinbrenner in plane strain, the crest as one strip and each slope as 16 slices |
|
|
117
|
+
| immediate settlement | Steinbrenner F1, F2 on each layer (layered elastic), or Schmertmann (1978) with C1, C2 and the L/B-interpolated influence diagram |
|
|
118
|
+
| primary consolidation | Cr up to σ'p = OCR·σ'v0, Cc beyond it, sublayer by sublayer at each point |
|
|
119
|
+
| secondary compression | Cα/(1+e0)·H·log(t/t_p) from U = 95 % to the design life; Cα·Cr/Cc where the clay stays over-consolidated |
|
|
120
|
+
| time | Terzaghi U(Tv), per clay layer, H_dr = H/2 or H |
|
|
121
|
+
| rigid foundation | settlement of the characteristic point (0.74·B/2, 0.74·L/2; 0.845·R) |
|
|
122
|
+
| angular distortion | (s_centre − s_edge) / (B/2) |
|
|
123
|
+
|
|
124
|
+
The derivations and their limits are in [docs/theory.md](https://github.com/hdaltuntas/lythos-settle/blob/main/docs/theory.md).
|
|
125
|
+
|
|
126
|
+
## Figures
|
|
127
|
+
|
|
128
|
+
Section with the Boussinesq stress bulb · stresses with depth (σ'v0, σ'v0 + Δσ, σ'p and the
|
|
129
|
+
influence-depth criterion) · influence factors at each point with Schmertmann's Iz ·
|
|
130
|
+
cumulative settlement with depth · time–settlement curve · settlement components at each
|
|
131
|
+
point · settlement across the section (the settlement trough under a footing or a fill). Study figures: one-at-a-time sweep, histogram, scatter, tornado.
|
|
132
|
+
|
|
133
|
+
## Reports
|
|
134
|
+
|
|
135
|
+
Choose PDF, self-contained HTML or Word in the header and press *Export report…*. The
|
|
136
|
+
report carries the inputs, the stresses, the settlement at each point and in each layer,
|
|
137
|
+
the Schmertmann factors, the consolidation times, the checks, the figures, the warnings,
|
|
138
|
+
the method notes and — if one was run — the study, in whichever language the interface is
|
|
139
|
+
in. All three formats are assembled from one place, so they say the same thing.
|
|
140
|
+
|
|
141
|
+
## Project files (`.settle`)
|
|
142
|
+
|
|
143
|
+
JSON. *Save* writes the inputs and the study definition; *Open…* reads them back. Missing
|
|
144
|
+
entries keep their defaults.
|
|
145
|
+
|
|
146
|
+
## Modules
|
|
147
|
+
|
|
148
|
+
| file | content |
|
|
149
|
+
|---|---|
|
|
150
|
+
| `lythossettle/stress.py` | Boussinesq (rectangle, strip, circle), 2:1, Steinbrenner |
|
|
151
|
+
| `lythossettle/consolidation.py` | Terzaghi U(Tv) and its inverse, compression of clay, secondary compression |
|
|
152
|
+
| `lythossettle/engine.py` | The settlement analysis: profile, sublayers, points, checks, time curve |
|
|
153
|
+
| `lythossettle/study.py`, `study_plots.py` | Parametric (one at a time) and reliability (LHS / Monte Carlo) studies, statistics, P of exceedance with 95 % CI and β, Spearman sensitivities, CSV / XLSX |
|
|
154
|
+
| `lythossettle/plotting.py`, `plot_style.py`, `render.py` | Matplotlib figures, theme-aware, off-screen |
|
|
155
|
+
| `lythossettle/report.py`, `pdf.py` | Calculation report: one HTML assembly, exported as PDF (reportlab), HTML or DOCX |
|
|
156
|
+
| `lythossettle/forms.py` | Input schema and readers; converts between the interface's flat values and the engine's configuration |
|
|
157
|
+
| `lythossettle/summary.py` | The results as cards and as text, for the browser and the command line alike |
|
|
158
|
+
| `lythossettle/i18n.py` | Every text, English and Turkish, written side by side |
|
|
159
|
+
| `lythossettle/web/` | The local HTTP server, the session, and the browser interface |
|
|
160
|
+
|
|
161
|
+
## Development
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
pip install -e ".[dev]"
|
|
165
|
+
pytest -q # engine against hand calculations, stresses against tables, study, report, web, packaging
|
|
166
|
+
ruff check .
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
The tests check the stress solutions against published values and brute-force integrals,
|
|
170
|
+
the engine against closed-form cases (a square on an elastic half-space, a one-dimensional
|
|
171
|
+
clay layer, Schmertmann by hand), the report in all three formats, the input schema and its
|
|
172
|
+
file round-trips, and the interface itself — the session and the HTTP layer both, so the
|
|
173
|
+
browser is exercised without a browser.
|
|
174
|
+
|
|
175
|
+
Releasing to PyPI is described in [docs/releasing.md](https://github.com/hdaltuntas/lythos-settle/blob/main/docs/releasing.md);
|
|
176
|
+
`tools/upload_to_pypi.py` does it from an editor, without a terminal.
|
|
177
|
+
|
|
178
|
+
## License
|
|
179
|
+
|
|
180
|
+
[MIT](https://github.com/hdaltuntas/lythos-settle/blob/main/LICENSE) © 2026 Hasan Deniz Altuntaş
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Lythos Settle — settlement analysis of shallow foundations, driven from a browser.
|
|
3
|
+
|
|
4
|
+
The program works out how much, and how fast, a shallow foundation settles on
|
|
5
|
+
a layered soil profile:
|
|
6
|
+
|
|
7
|
+
1. Stresses — in-situ σ'v0 and σ'p; the stress increase beneath the
|
|
8
|
+
foundation by Boussinesq (rectangle, strip, circle) or 2:1
|
|
9
|
+
2. Immediate — layered elastic (Steinbrenner) or Schmertmann (1978)
|
|
10
|
+
3. Consolidation — primary settlement of the clay layers from Cc, Cr, e0
|
|
11
|
+
and σ'p, and secondary compression from Cα
|
|
12
|
+
4. Time — Terzaghi's one-dimensional consolidation, per layer
|
|
13
|
+
5. Checks — total settlement and angular distortion
|
|
14
|
+
|
|
15
|
+
On top of it, a parametric or reliability study sweeps any input (a range, or
|
|
16
|
+
a distribution) and reports sensitivities and the probability of exceeding
|
|
17
|
+
the allowable settlement.
|
|
18
|
+
|
|
19
|
+
The interface is a local web server driven from the browser (standard library
|
|
20
|
+
only), so the program also runs over a remote session or inside a container,
|
|
21
|
+
where a desktop toolkit would need a display it does not have.
|
|
22
|
+
|
|
23
|
+
Package layout
|
|
24
|
+
--------------
|
|
25
|
+
lythossettle.config app identity, defaults, themes, palette
|
|
26
|
+
lythossettle.i18n every text of the program, English and Turkish
|
|
27
|
+
lythossettle.stress Boussinesq, 2:1 and Steinbrenner solutions
|
|
28
|
+
lythossettle.consolidation Terzaghi time factor, compression of clay
|
|
29
|
+
lythossettle.engine the settlement analysis
|
|
30
|
+
lythossettle.study parametric / reliability studies
|
|
31
|
+
lythossettle.plotting analysis figures
|
|
32
|
+
lythossettle.study_plots study figures
|
|
33
|
+
lythossettle.report calculation report: HTML, PDF, DOCX
|
|
34
|
+
lythossettle.forms input schema and readers (interface-independent)
|
|
35
|
+
lythossettle.web local web server and the browser interface
|
|
36
|
+
|
|
37
|
+
Run it: lythos-settle (or python -m lythossettle)
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
__version__ = "0.1.0"
|
|
41
|
+
|
|
42
|
+
APP_NAME = "Lythos Settle"
|
|
43
|
+
ORG = "Lythos"
|
|
44
|
+
|
|
45
|
+
__all__ = ["__version__", "APP_NAME", "ORG"]
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"""Command line interface."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import argparse
|
|
6
|
+
import json
|
|
7
|
+
import sys
|
|
8
|
+
|
|
9
|
+
from . import APP_NAME, __version__
|
|
10
|
+
|
|
11
|
+
#: Default port of the local interface (the family counts up from 8777)
|
|
12
|
+
PORT = 8780
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def main(argv=None) -> int:
|
|
16
|
+
parser = argparse.ArgumentParser(
|
|
17
|
+
prog="lythos-settle",
|
|
18
|
+
description="Settlement analysis of shallow foundations: stress distribution, "
|
|
19
|
+
"immediate (elastic / Schmertmann), consolidation and secondary "
|
|
20
|
+
"settlement, consolidation time, and parametric / reliability studies.")
|
|
21
|
+
parser.add_argument("--version", action="version", version=f"{APP_NAME} {__version__}")
|
|
22
|
+
# Running the program with no subcommand means "web", so the top level
|
|
23
|
+
# carries that subcommand's defaults: without them the bare `lythos-settle`
|
|
24
|
+
# would reach serve() with a Namespace that has no host, port or language.
|
|
25
|
+
parser.set_defaults(host="127.0.0.1", port=PORT, lang="en", no_browser=False)
|
|
26
|
+
sub = parser.add_subparsers(dest="command")
|
|
27
|
+
|
|
28
|
+
web = sub.add_parser("web", help="start the interface in a browser")
|
|
29
|
+
web.add_argument("--port", type=int, default=PORT)
|
|
30
|
+
web.add_argument("--host", default="127.0.0.1")
|
|
31
|
+
web.add_argument("--lang", default="en", choices=["en", "tr"])
|
|
32
|
+
web.add_argument("--no-browser", action="store_true")
|
|
33
|
+
|
|
34
|
+
run = sub.add_parser("run", help="analyse a project file and print the results")
|
|
35
|
+
run.add_argument("project", help="path to a .settle / .json project file")
|
|
36
|
+
run.add_argument("-o", "--out", default=None,
|
|
37
|
+
help="write a report here (.pdf / .html / .docx)")
|
|
38
|
+
run.add_argument("--lang", default="en", choices=["en", "tr"])
|
|
39
|
+
|
|
40
|
+
study = sub.add_parser("study", help="run the study defined in a project file")
|
|
41
|
+
study.add_argument("project", help="path to a .settle / .json project file")
|
|
42
|
+
study.add_argument("-o", "--out", default=None, help="write the samples here (.csv / .xlsx)")
|
|
43
|
+
study.add_argument("--lang", default="en", choices=["en", "tr"])
|
|
44
|
+
|
|
45
|
+
example = sub.add_parser("example", help="write a starter project file")
|
|
46
|
+
example.add_argument("-o", "--out", default="project.settle")
|
|
47
|
+
|
|
48
|
+
args = parser.parse_args(argv)
|
|
49
|
+
command = args.command or "web"
|
|
50
|
+
try:
|
|
51
|
+
return _dispatch(command, args)
|
|
52
|
+
except (ValueError, RuntimeError, OSError) as exc:
|
|
53
|
+
# The analysis refuses impossible input with a sentence worth reading
|
|
54
|
+
# (a foundation below the profile, a layer without a modulus, an
|
|
55
|
+
# unreadable project file). A traceback would bury it, so only
|
|
56
|
+
# unexpected failures keep theirs.
|
|
57
|
+
print(f"{APP_NAME}: {exc}", file=sys.stderr)
|
|
58
|
+
return 1
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def _example_study(values: dict) -> list:
|
|
62
|
+
"""Two study variables for the starter project, so `study` has something to do."""
|
|
63
|
+
return [
|
|
64
|
+
{"path": "foundation.q", "label": "Foundation · q", "mode": "dist", "dist": "normal",
|
|
65
|
+
"mean": values["q"], "cov": 0.10, "min": 0, "max": 0, "n_points": 5},
|
|
66
|
+
{"path": "soil_profile.2.Cc", "label": "Soft clay · Cc", "mode": "dist",
|
|
67
|
+
"dist": "lognormal", "mean": values["soil_profile"][2]["Cc"], "cov": 0.25,
|
|
68
|
+
"min": 0, "max": 0, "n_points": 5},
|
|
69
|
+
]
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def _dispatch(command: str, args) -> int:
|
|
73
|
+
"""Runs one command; raises on anything that goes wrong."""
|
|
74
|
+
if command == "web":
|
|
75
|
+
from .web.server import serve
|
|
76
|
+
serve(host=args.host, port=args.port, open_browser=not args.no_browser,
|
|
77
|
+
lang=args.lang)
|
|
78
|
+
return 0
|
|
79
|
+
|
|
80
|
+
from . import forms
|
|
81
|
+
|
|
82
|
+
if command == "example":
|
|
83
|
+
values = forms.defaults()
|
|
84
|
+
values["study_variables"] = _example_study(values)
|
|
85
|
+
with open(args.out, "w", encoding="utf-8") as fh:
|
|
86
|
+
json.dump(forms.project_file(values), fh, indent=2, ensure_ascii=False)
|
|
87
|
+
print(args.out)
|
|
88
|
+
return 0
|
|
89
|
+
|
|
90
|
+
with open(args.project, encoding="utf-8") as fh:
|
|
91
|
+
data = json.load(fh)
|
|
92
|
+
|
|
93
|
+
from .web.session import Session
|
|
94
|
+
session = Session(lang=args.lang)
|
|
95
|
+
values = session.load_project(data)["values"]
|
|
96
|
+
|
|
97
|
+
if command == "run":
|
|
98
|
+
result = session.analyse(values)
|
|
99
|
+
print(result["text"])
|
|
100
|
+
if args.out:
|
|
101
|
+
fmt = args.out.lower().rsplit(".", 1)[-1]
|
|
102
|
+
print(session.report(fmt if fmt in ("pdf", "html", "docx") else "pdf", args.out))
|
|
103
|
+
return 0
|
|
104
|
+
|
|
105
|
+
# A study: analyse the foundation first, so the report and the figures
|
|
106
|
+
# have something to sit beside, then sample.
|
|
107
|
+
session.analyse(values)
|
|
108
|
+
started = session.start_study(values)
|
|
109
|
+
if not started["ok"]:
|
|
110
|
+
print(started["error"], file=sys.stderr)
|
|
111
|
+
return 1
|
|
112
|
+
import time
|
|
113
|
+
last = -1
|
|
114
|
+
while session.state()["job"] == "running":
|
|
115
|
+
state = session.state()
|
|
116
|
+
if state["total"] and state["done"] != last:
|
|
117
|
+
last = state["done"]
|
|
118
|
+
print(f"\r{state['done']} / {state['total']}", end="", file=sys.stderr, flush=True)
|
|
119
|
+
time.sleep(0.2)
|
|
120
|
+
print("", file=sys.stderr)
|
|
121
|
+
state = session.state()
|
|
122
|
+
if state["job"] == "error":
|
|
123
|
+
print(state["error"], file=sys.stderr)
|
|
124
|
+
return 1
|
|
125
|
+
payload = session.study_payload()
|
|
126
|
+
if not payload["ok"]:
|
|
127
|
+
print(payload["error"], file=sys.stderr)
|
|
128
|
+
return 1
|
|
129
|
+
print(payload["text"])
|
|
130
|
+
if args.out:
|
|
131
|
+
kind = "xlsx" if args.out.lower().endswith(".xlsx") else "csv"
|
|
132
|
+
print(session.export_study(kind, args.out))
|
|
133
|
+
return 0
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
if __name__ == "__main__":
|
|
137
|
+
sys.exit(main())
|