Skip to content

Commit

Permalink
use grid.add_field
Browse files Browse the repository at this point in the history
  • Loading branch information
mcflugen committed Oct 20, 2024
1 parent 40356c7 commit d6aaddf
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,7 @@
"outputs": [],
"source": [
"# The grid represents a basic rectangular channel with slope equal to 0.01 m/m\n",
"te = grid.add_zeros(\"topographic__elevation\", at=\"node\")\n",
"te += 1.0 - channel_slope * grid.x_of_node\n",
"te = grid.add_field(\"topographic__elevation\", 1.0 - channel_slope * grid.x_of_node, at=\"node\")\n",
"te[grid.y_of_node > 1.5] = 2.5\n",
"te[grid.y_of_node < 0.5] = 2.5"
]
Expand Down Expand Up @@ -198,8 +197,7 @@
"vel = grid.add_zeros(\"surface_water__velocity\", at=\"link\")\n",
"\n",
"# Calculating the initial water surface elevation from water depth and topographic elevation\n",
"wse = grid.add_zeros(\"surface_water__elevation\", at=\"node\")\n",
"wse += h + te"
"wse = grid.add_field(\"surface_water__elevation\", te, at=\"node\")"
]
},
{
Expand Down Expand Up @@ -428,8 +426,7 @@
"vel = grid.add_zeros(\"surface_water__velocity\", at=\"link\")\n",
"\n",
"# Calculating the initial water surface elevation from water depth and topographic elevation\n",
"wse = grid.add_zeros(\"surface_water__elevation\", at=\"node\")\n",
"wse += h + te"
"wse = grid.add_field(\"surface_water__elevation\", te, at=\"node\")"
]
},
{
Expand Down

0 comments on commit d6aaddf

Please sign in to comment.