Skip to content

Commit 4ea2a02

Browse files
committed
Add some more docstrings
1 parent 515e7ab commit 4ea2a02

2 files changed

Lines changed: 20 additions & 5 deletions

File tree

src/icepack2/model/minimization.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121

2222
def viscous_power(**kwargs):
23-
r"""Return the viscous power dissipation"""
23+
r"""Return the symbolic form of the viscous power dissipation rate"""
2424
# Get all the dynamical fields
2525
field_names = ("membrane_stress", "thickness")
2626
M, h = map(kwargs.get, field_names)
@@ -38,7 +38,7 @@ def viscous_power(**kwargs):
3838

3939

4040
def friction_power(**kwargs):
41-
r"""Return the frictional power dissipation"""
41+
r"""Return the symbolic form of the frictional power dissipation rate"""
4242
τ = kwargs["basal_stress"]
4343
parameter_names = ("sliding_coefficient", "sliding_exponent")
4444
K, m = map(kwargs.get, parameter_names)
@@ -48,7 +48,8 @@ def friction_power(**kwargs):
4848

4949

5050
def calving_terminus(**kwargs):
51-
r"""Return the power dissipation from the terminus boundary condition"""
51+
r"""Return the symbolic form of the power dissipation at the terminus
52+
of a glacier that flows into a water body"""
5253
# Get all the dynamical fields and boundary conditions
5354
u, h, s = map(kwargs.get, ("velocity", "thickness", "surface"))
5455
outflow_ids = kwargs["outflow_ids"]
@@ -67,7 +68,7 @@ def calving_terminus(**kwargs):
6768

6869

6970
def momentum_balance(**kwargs):
70-
r"""Return the momentum balance constraint"""
71+
r"""Return the symbolic form of the momentum balance constraint"""
7172
field_names = (
7273
"velocity", "membrane_stress", "basal_stress", "thickness", "surface"
7374
)
@@ -84,7 +85,8 @@ def momentum_balance(**kwargs):
8485

8586

8687
def ice_shelf_momentum_balance(**kwargs):
87-
r"""Return the momentum balance constraint for floating ice shelves
88+
r"""Return the symbolic form of the momentum balance constraint for the
89+
special case of floating ice shelves in hydrostatic balance
8890
8991
Floating ice shelves are simpler because there is no basal shear stress
9092
and we assume the ice is hydrostatic, in which case the surface

src/icepack2/model/variational.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121

2222
def flow_law(**kwargs):
23+
r"""Return the symbolic form of the flow law, i.e. the relation between the
24+
strain rate and membrane stress tensors"""
2325
field_names = ("thickness", "membrane_stress", "velocity", "test_function")
2426
h, M, u, N = map(kwargs.get, field_names)
2527
A, n = map(kwargs.get, ("flow_law_coefficient", "flow_law_exponent"))
@@ -34,6 +36,8 @@ def flow_law(**kwargs):
3436

3537

3638
def friction_law(**kwargs):
39+
r"""Return the symbolic form of the sliding law, i.e. the relation between
40+
the basal sliding velocity and the basal drag vectors"""
3741
τ, u, σ = map(kwargs.get, ("basal_stress", "velocity", "test_function"))
3842
K, m = map(kwargs.get, ("sliding_coefficient", "sliding_exponent"))
3943
τ_2 = inner(τ, τ)
@@ -42,6 +46,8 @@ def friction_law(**kwargs):
4246

4347

4448
def calving_terminus(**kwargs):
49+
r"""Return the symbolic form of the pressure exerted at the terminus of a
50+
glacier that flows into a water body"""
4551
h, s, v = map(kwargs.get, ("thickness", "surface", "test_function"))
4652
outflow_ids = kwargs["outflow_ids"]
4753

@@ -58,6 +64,7 @@ def calving_terminus(**kwargs):
5864

5965

6066
def momentum_balance(**kwargs):
67+
r"""Return the symbolic form of the constraint of momentum balance"""
6168
field_names = (
6269
"membrane_stress",
6370
"basal_stress",
@@ -78,6 +85,12 @@ def momentum_balance(**kwargs):
7885

7986

8087
def ice_shelf_momentum_balance(**kwargs):
88+
r"""Return the symbolic form of the constraint of momentum balance for the
89+
special case of floating ice shelves in hydrostatic balance
90+
91+
Floating ice shelves are simpler because there is no basal shear stress
92+
and we assume the ice is hydrostatic, in which case the surface
93+
elevation is proportional to the thickness."""
8194
field_names = ("membrane_stress", "thickness", "test_function")
8295
M, h, v = map(kwargs.get, field_names)
8396
ε = sym(grad(v))

0 commit comments

Comments
 (0)