Skip to content

Commit e09c869

Browse files
committed
changing the model grid size for memory reasons
1 parent 151f97f commit e09c869

1 file changed

Lines changed: 12 additions & 30 deletions

File tree

rockblock/introduction_to_rockblock.ipynb

Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@
2323
{
2424
"cell_type": "code",
2525
"execution_count": null,
26-
"metadata": {
27-
"collapsed": true
28-
},
26+
"metadata": {},
2927
"outputs": [],
3028
"source": [
3129
"import os\n",
@@ -73,7 +71,7 @@
7371
"attrs = {'K_sp': {0: 0.0003,\n",
7472
" 1: 0.0001}}\n",
7573
"\n",
76-
"mg = RasterModelGrid((100, 100), 200)\n",
74+
"mg = RasterModelGrid((70, 70), 200)\n",
7775
"z = mg.add_zeros('node', 'topographic__elevation') \n",
7876
"random_field = 0.01*np.random.randn(mg.size('node'))\n",
7977
"z += random_field - random_field.min()\n",
@@ -83,7 +81,7 @@
8381
"ids = np.tile([0,1], 20) \n",
8482
"\n",
8583
"# Anticline\n",
86-
"rb = LayeredRockBlock(mg, z0s, ids, x0=10000, y0=10000, function = lambda x, y : ((0.0015*x)**2+(0.0007*y)**2), attrs=attrs)\n",
84+
"rb = LayeredRockBlock(mg, z0s, ids, x0=7000, y0=7000, function = lambda x, y : ((0.002*x)**2+(0.001*y)**2), attrs=attrs)\n",
8785
"\n",
8886
"# Shallow dips\n",
8987
"#rb = LayeredRockBlock(mg, z0s, ids, x0=5000, y0=5000, function = lambda x, y : ((0.001*x)+(0.003*y)), attrs=attrs)\n",
@@ -104,9 +102,7 @@
104102
{
105103
"cell_type": "code",
106104
"execution_count": null,
107-
"metadata": {
108-
"collapsed": true
109-
},
105+
"metadata": {},
110106
"outputs": [],
111107
"source": [
112108
"imshow_grid(mg, 'K_sp')"
@@ -191,9 +187,7 @@
191187
{
192188
"cell_type": "code",
193189
"execution_count": null,
194-
"metadata": {
195-
"collapsed": true
196-
},
190+
"metadata": {},
197191
"outputs": [],
198192
"source": [
199193
"imshow_grid(mg, 'topographic__elevation', cmap='viridis')"
@@ -213,9 +207,7 @@
213207
{
214208
"cell_type": "code",
215209
"execution_count": null,
216-
"metadata": {
217-
"collapsed": true
218-
},
210+
"metadata": {},
219211
"outputs": [],
220212
"source": [
221213
"hvds = hv.Dataset(ds)\n",
@@ -232,9 +224,7 @@
232224
{
233225
"cell_type": "code",
234226
"execution_count": null,
235-
"metadata": {
236-
"collapsed": true
237-
},
227+
"metadata": {},
238228
"outputs": [],
239229
"source": [
240230
"%opts Image (cmap='viridis')\n",
@@ -272,7 +262,7 @@
272262
},
273263
"outputs": [],
274264
"source": [
275-
"mg2 = RasterModelGrid((100, 100), 200)\n",
265+
"mg2 = RasterModelGrid((70, 70), 200)\n",
276266
"mg2.set_closed_boundaries_at_grid_edges(True, False, True, False)\n",
277267
"z2 = mg2.add_zeros('node', 'topographic__elevation') \n",
278268
"random_field = 0.01*np.random.randn(mg2.size('node'))\n",
@@ -331,9 +321,7 @@
331321
{
332322
"cell_type": "code",
333323
"execution_count": null,
334-
"metadata": {
335-
"collapsed": true
336-
},
324+
"metadata": {},
337325
"outputs": [],
338326
"source": [
339327
"imshow_grid(mg2, 'topographic__elevation')"
@@ -351,9 +339,7 @@
351339
{
352340
"cell_type": "code",
353341
"execution_count": null,
354-
"metadata": {
355-
"collapsed": true
356-
},
342+
"metadata": {},
357343
"outputs": [],
358344
"source": [
359345
"volcanic_deposits = np.zeros(mg2.size('node'))\n",
@@ -408,9 +394,7 @@
408394
{
409395
"cell_type": "code",
410396
"execution_count": null,
411-
"metadata": {
412-
"collapsed": true
413-
},
397+
"metadata": {},
414398
"outputs": [],
415399
"source": [
416400
"imshow_grid(mg2, 'topographic__elevation')"
@@ -426,9 +410,7 @@
426410
{
427411
"cell_type": "code",
428412
"execution_count": null,
429-
"metadata": {
430-
"collapsed": true
431-
},
413+
"metadata": {},
432414
"outputs": [],
433415
"source": [
434416
"%opts Image (cmap='viridis')\n",

0 commit comments

Comments
 (0)