weac
A Python implementation of the 2phi Weak Layer Anticrack Nucleation Model
Science Score: 77.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 24 DOI reference(s) in README -
✓Academic publication links
Links to: zenodo.org -
✓Committers with academic emails
2 of 5 committers (40.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (9.3%) to scientific vocabulary
Keywords
Repository
A Python implementation of the 2phi Weak Layer Anticrack Nucleation Model
Basic Info
- Host: GitHub
- Owner: 2phi
- License: other
- Language: Python
- Default Branch: main
- Homepage: https://2phi.github.io/weac/
- Size: 22.3 MB
Statistics
- Stars: 9
- Watchers: 0
- Forks: 2
- Open Issues: 4
- Releases: 25
Topics
Metadata Files
README.md
WEAC
Weak Layer Anticrack Nucleation Model
Implementation of closed-form analytical models for the analysis of dry-snow slab avalanche release.
View the demo ·
Report a bug ·
Request a feature ·
Read the docs ·
Cite the software
Contents
About the project
WEAC implements closed-form analytical models for the mechanical analysis of dry-snow slabs on compliant weak layers, the prediction of anticrack onset, and, in particular, allows for the analysis of stratified snow covers. The model covers propagation saw tests (a), and uncracked (b) or cracked (c) skier-loaded buried weak layers.

Cite the repository as:
Rosendahl, P. L., Schneider, J., & Weissgraeber, P. (2022). Weak Layer Anticrack Nucleation Model (WEAC). Zenodo. https://doi.org/10.5281/zenodo.5773113
Read the 📄 white paper for model derivations, illustrations, dimensions, material properties, and kinematics:
- Weißgraeber, P. & Rosendahl, P. L. (2023). A closed-form model for layered snow slabs. The Cryosphere, 17(4), 1475–1496. https://doi.org/10.5194/tc-17-1475-2023
For more background info, please refer to the companion papers:
- Rosendahl, P. L. & Weißgraeber, P. (2020). Modeling snow slab avalanches caused by weak-layer failure – Part 1: Slabs on compliant and collapsible weak layers. The Cryosphere, 14(1), 115–130. https://doi.org/10.5194/tc-14-115-2020
- Rosendahl, P. L. & Weißgraeber, P. (2020). Modeling snow slab avalanches caused by weak-layer failure – Part 2: Coupled mixed-mode criterion for skier-triggered anticracks. The Cryosphere, 14(1), 131–145. https://doi.org/10.5194/tc-14-131-2020
Written in 🐍 Python and built with 💻 Visual Studio Code, 🐙 GitKraken, and 🪐 Jupyter. Note that release v1.0 was written and built in 🌋 MATLAB.
Installation
Install globally using the pip Package Installer for Python
sh
pip install -U weac
or clone the repo
sh
git clone https://github.com/2phi/weac
for local use.
Needs (runtime dependencies are declared in pyproject.toml):
Usage
The following describes the basic usage of WEAC. Please refer to the demo for more examples and read the documentation for details.
Load the module.
python
import weac
Choose a snow profile from the preconfigured profiles (see dummy_profiles in demo) or create your own using the Layer Pydantic class. One row corresponds to one layer counted from top (below surface) to bottom (above weak layer).
```python from weac.components import Layer
layers = [ Layer(rho=170, h=100), # (1) surface layer Layer(rho=190, h=40), # (2) Layer(rho=230, h=130), # : Layer(rho=250, h=20), Layer(rho=210, h=70), Layer(rho=380, h=20), # : Layer(rho=280, h=100) # (N) last slab layer above weak layer ] ```
Create a WeakLayer instance that lies underneath the slab.
```python from weac.components import WeakLayer
weak_layer = WeakLayer(rho=125, h=20) ```
Create a Scenario that defines the environment and setup that the slab and weak layer will be evaluated in.
```python from weac.components import ScenarioConfig, Segment
Example 1: SKIER
skierconfig = ScenarioConfig( systemtype='skier', phi=30, ) skiersegments = [ Segment(length=5000, hasfoundation=True, m=0), Segment(length=0, hasfoundation=False, m=80), Segment(length=0, hasfoundation=False, m=0), Segment(length=5000, has_foundation=True, m=0), ] # Scenario is a skier of 80 kg standing on a 10 meter long slab at a 30 degree angle
Exampel 2: PST
pstconfig = ScenarioConfig( systemtype='pst-', # Downslope cut phi=30, # (counterclockwise positive) cutlength=300, ) pstsegments = [ Segment(length=5000, hasfoundation=True, m=0), Segment(length=300, hasfoundation=False, m=0), # Crack Segment ] # Scenario is Downslope PST with a 300mm cut ```
Create a SystemModel instance that combines the inputs and handles system solving and field-quantity extraction.
```python from weac.components import Config, ModelInput from weac.core.system_model import SystemModel
Example: build a model for the skier scenario defined above
modelinput = ModelInput( weaklayer=weaklayer, scenarioconfig=skierconfig, layers=customlayers, segments=skiersegments, ) systemconfig = Config( touchdown=True ) skiersystem = SystemModel( modelinput=modelinput, config=systemconfig, ) ```
Unknown constants are cachedproperties; calling `skiersystem.unknown_constants` solves the system of linear equations and extracts the constants.
python
C = skier_system.unknown_constants
Analyzer handles rasterization + computation of involved slab and weak-layer properties Sxx, Sxz, etc.
Prepare the output by rasterizing the solution vector at all horizontal positions xsl (slab). The result is returned in the form of the ndarray z. We also get xwl (weak layer) that only contains x-coordinates that are supported by a foundation.
```python from weac.analysis.analyzer import Analyzer
skieranalyzer = Analyzer(skiersystem) xslskier, zskier, xwlskier = skieranalyzer.rasterizesolution(mode="cracked") Gdif, GdifI, GdifII = skieranalyzer.differentialERR() Ginc, GincI, GincII = skieranalyzer.incremental_ERR()
and Sxx, Sxz, Tzz, principal stress, incremental_potential, ...
```
Visualize the results.
```python from weac.analysis.plotter import Plotter
plotter = Plotter()
Visualize slab profile
fig = plotter.plotslabprofile( weaklayers=weaklayer, slabs=skier_system.slab, )
Visualize deformations as a contour plot
fig = plotter.plotdeformed( xslskier, xwlskier, zskier, skier_analyzer, scale=200, window=200, aspect=2, field="Sxx" )
Plot slab displacements (using x-coordinates of all segments, xsl)
plotter.plotdisplacements(skieranalyzer, x=xslskier, z=zskier)
Plot weak-layer stresses (using only x-coordinates of bedded segments, xwl)
plotter.plotstresses(skieranalyzer, x=xwlskier, z=zskier) ```
Compute output/field quantities for exporting or plotting.
```python
Compute stresses in kPa in the weaklayer
tau = skiersystem.fq.tau(Z=zskier, unit='kPa') sig = skiersystem.fq.sig(Z=zskier, unit='kPa')
w = skiersystem.fq.w(Z=zskier, unit='um')
Example evaluation vertical displacement at top/mid/bottom of the slab
utop = skiersystem.fq.u(Z=zskier, h0=top, unit='um') umid = skiersystem.fq.u(Z=zskier, h0=mid, unit='um') ubot = skiersystem.fq.u(Z=zskier, h0=bot, unit='um') psi = skiersystem.fq.psi(Z=z_skier, unit='deg') ```
Roadmap
See the open issues for a list of proposed features and known issues.
v4.0
- [ ] Change to scenario & scenario_config: InfEnd/Cut/Segment/Weight
v3.2
- [ ] Complex terrain through the addition of out-of-plane tilt
- [ ] Up, down, and cross-slope cracks
v3.1
- [ ] Improved CriteriaEvaluator Optimization (x2 time reduction)
Release history
v3.0
- Refactored the codebase for improved structure and maintainability
- Added property caching for improved efficiency
- Added input validation
- Adopted a new, modular, and object-oriented design
v2.6
- Introduced test suite
- Mitraged from
setup.cfgtopyproject.toml - Added parametrization for collaps heights
v2.5
- Analyze slab touchdown in PST experiments by setting
touchdown=True - Completely redesigned and significantly improved API documentation
v2.4
- Choose between slope-normal (
'-pst','pst-') or vertical ('-vpst','vpst-') PST boundary conditions
v2.3
- Stress plots on deformed contours
- PSTs now account for slab touchdown
v2.2
- Sign of inclination
phiconsistent with the coordinate system (positive counterclockwise) - Dimension arguments to field-quantity methods added
- Improved aspect ratio of profile views and contour plots
- Improved plot labels
- Convenience methods for the export of weak-layer stresses and slab deformations provided
- Wrapper for (re)calculation of the fundamental system added
- Now allows for distributed surface loads
v2.1
- Consistent use of coordinate system with downward pointing z-axis
- Consitent top-to-bottom numbering of slab layers
- Implementation of PSTs cut from either left or right side
v2.0
- Completely rewritten in 🐍 Python
- Coupled bending-extension ODE solver implemented
- Stress analysis of arbitrarily layered snow slabs
- FEM validation of
- displacements
- weak-layer stresses
- energy release rates in weak layers
- Documentation
- Demo and examples
v1.0
- Written in 🌋 MATLAB
- Deformation analysis of homogeneous snow labs
- Weak-layer stress prediction
- Energy release rates of cracks in weak layers
- Finite fracture mechanics implementation
- Prediction of anticrack nucleation
How to contribute
- Fork the project
Initialize submodules
bash git submodule update --init --recursiveCreate your feature branch (
git checkout -b feature/amazingfeature)Commit your changes (
git commit -m 'Add some amazing feature')Push to the branch (
git push origin feature/amazingfeature)Open a pull request
Workflows
License
WEAC is licensed under CC BY-NC-SA 4.0
You are free to:
- Share — copy and redistribute the material in any medium or format
- Adapt — remix, transform, and build upon the material for any purpose, even commercially.
Under the following terms:
Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
NonCommercial — You may not use the material for commercial purposes.
ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.
Contact
E-mail: mail@2phi.de · Web: https://2phi.de · Project Link: https://github.com/2phi/weac · Project DOI: http://dx.doi.org/10.5281/zenodo.5773113
Owner
- Name: 2phi GbR
- Login: 2phi
- Kind: organization
- Location: Darmstadt, Germany
- Website: https://2phi.de
- Repositories: 2
- Profile: https://github.com/2phi
Citation (CITATION.cff)
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
title: "Weak Layer Anticrack Nucleation Model (WEAC)"
authors:
- family-names: "Rosendahl"
given-names: "Philipp Laurens"
orcid: "https://orcid.org/0000-0002-6587-875X"
- family-names: "Weissgraeber"
given-names: "Philipp"
orcid: "https://orcid.org/0000-0001-8320-8672"
version: 3.0.1
date-released: 2021-12-30
identifiers:
- description: Collection of archived snapshots of all versions of WEAC
type: doi
value: 10.5281/zenodo.5773113
- description: Release v2.5 with the implementation of slab touchdown in PST experiments
type: doi
value: 10.5281/zenodo.11121171
- description: Release v2.4 for the analysis of slope-normal and vertical PST boundary conditions
type: doi
value: 10.5281/zenodo.10555144
- description: Release v2.2 with consistent coordinate systems
type: doi
value: 10.5281/zenodo.5907134
- description: Release v2.1 for the analysis of layered slabs written in Python
type: doi
value: 10.5281/zenodo.5802058
- description: Release v1.0 for the analysis of homogeneous slabs written in MATLAB
type: doi
value: 10.5281/zenodo.5773114
url: "https://github.com/2phi/weac"
preferred-citation:
type: article
authors:
- family-names: "Weißgraeber"
given-names: "Philipp"
orcid: "https://orcid.org/0000-0001-8320-8672"
- family-names: "Rosendahl"
given-names: "Philipp Laurens"
orcid: "https://orcid.org/0000-0002-6587-875X"
doi: "10.5194/tc-17-1475-2023"
journal: "The Cryosphere"
start: 1475 # First page number
end: 1496 # Last page number
title: "A closed-form model for layered snow slabs"
issue: 4
volume: 17
year: 2023
GitHub Events
Total
- Create event: 24
- Issues event: 1
- Release event: 5
- Watch event: 2
- Delete event: 20
- Member event: 1
- Issue comment event: 25
- Push event: 146
- Pull request review comment event: 150
- Pull request review event: 64
- Pull request event: 37
- Fork event: 1
Last Year
- Create event: 24
- Issues event: 1
- Release event: 5
- Watch event: 2
- Delete event: 20
- Member event: 1
- Issue comment event: 25
- Push event: 146
- Pull request review comment event: 150
- Pull request review event: 64
- Pull request event: 37
- Fork event: 1
Committers
Last synced: about 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Philipp Rosendahl | z****c@l****e | 113 |
| JohannesSchneider27 | j****r@i****e | 13 |
| Rosendahl | r****l@f****e | 2 |
| Philipp Weissgraeber | p****p@w****o | 1 |
| 2phi | 5****i | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 2
- Total pull requests: 29
- Average time to close issues: almost 3 years
- Average time to close pull requests: about 15 hours
- Total issue authors: 2
- Total pull request authors: 4
- Average comments per issue: 0.5
- Average comments per pull request: 0.9
- Merged pull requests: 18
- Bot issues: 0
- Bot pull requests: 2
Past Year
- Issues: 1
- Pull requests: 29
- Average time to close issues: N/A
- Average time to close pull requests: about 15 hours
- Issue authors: 1
- Pull request authors: 4
- Average comments per issue: 0.0
- Average comments per pull request: 0.9
- Merged pull requests: 18
- Bot issues: 0
- Bot pull requests: 2
Top Authors
Issue Authors
- pillowbeast (1)
- tgoelles (1)
Pull Request Authors
- zacczakk (22)
- pillowbeast (3)
- carlwn (2)
- coderabbitai[bot] (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 97 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 22
- Total maintainers: 1
pypi.org: weac
Weak layer anticrack nucleation model
- Homepage: https://github.com/2phi/weac
- Documentation: https://2phi.github.io/weac
- License: Proprietary
-
Latest release: 3.0.0
published 6 months ago
Rankings
Maintainers (1)
Dependencies
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v4 composite
- actions/setup-python v5 composite