-
Notifications
You must be signed in to change notification settings - Fork 0
/
BedSmoother_8cc_source.html
552 lines (550 loc) · 118 KB
/
BedSmoother_8cc_source.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>PISM, A Parallel Ice Sheet Model: src/stressbalance/sia/BedSmoother.cc Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script>
<script type="text/javascript" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="browser.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">PISM, A Parallel Ice Sheet Model
 <span id="projectnumber">stable v2.1-1-g6902d5502 committed by Ed Bueler on 2023-12-20 08:38:27 -0800</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_337d79c4e85232f0487076e092bb4774.html">stressbalance</a></li><li class="navelem"><a class="el" href="dir_980286f9e69bc882ba80adb90321165b.html">sia</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">BedSmoother.cc</div> </div>
</div><!--header-->
<div class="contents">
<a href="BedSmoother_8cc.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">// Copyright (C) 2010--2023 Ed Bueler and Constantine Khroulev</span></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">//</span></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment">// This file is part of PISM.</span></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">//</span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment">// PISM is free software; you can redistribute it and/or modify it under the</span></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment">// terms of the GNU General Public License as published by the Free Software</span></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment">// Foundation; either version 3 of the License, or (at your option) any later</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment">// version.</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment">//</span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment">// PISM is distributed in the hope that it will be useful, but WITHOUT ANY</span></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment">// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment">// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment">// details.</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment">//</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment">// You should have received a copy of the GNU General Public License</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment">// along with PISM; if not, write to the Free Software</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment">// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>  </div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="preprocessor">#include <cassert></span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>  </div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#include "pism/stressbalance/sia/BedSmoother.hh"</span></div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#include "pism/util/Context.hh"</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor">#include "pism/util/Grid.hh"</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="preprocessor">#include "pism/util/Logger.hh"</span></div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#include "pism/util/array/CellType.hh"</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#include "pism/util/error_handling.hh"</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#include "pism/util/petscwrappers/Vec.hh"</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="preprocessor">#include "pism/util/pism_utilities.hh"</span></div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="preprocessor">#include "pism/util/VariableMetadata.hh"</span></div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  </div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="keyword">namespace </span><a class="code" href="namespacepism.html">pism</a> {</div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="keyword">namespace </span>stressbalance {</div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  </div>
<div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="classpism_1_1stressbalance_1_1BedSmoother_a32338d245c30dd4f2a3bb5218f59e3bc.html#a32338d245c30dd4f2a3bb5218f59e3bc"> 34</a></span> <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a32338d245c30dd4f2a3bb5218f59e3bc.html#a32338d245c30dd4f2a3bb5218f59e3bc">BedSmoother::BedSmoother</a>(std::shared_ptr<const Grid> <a class="code" href="namespacepism_a47d754ed3e959d5866b02a1b78b6a5b5.html#a47d754ed3e959d5866b02a1b78b6a5b5">g</a>)</div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  : m_grid(<a class="code" href="namespacepism_a47d754ed3e959d5866b02a1b78b6a5b5.html#a47d754ed3e959d5866b02a1b78b6a5b5">g</a>),</div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  m_config(<a class="code" href="namespacepism_a47d754ed3e959d5866b02a1b78b6a5b5.html#a47d754ed3e959d5866b02a1b78b6a5b5">g</a>->ctx()->config()),</div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  m_topgsmooth(m_grid, <span class="stringliteral">"topgsmooth"</span>),</div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  m_maxtl(m_grid, <span class="stringliteral">"maxtl"</span>),</div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  m_C2(m_grid, <span class="stringliteral">"C2bedsmooth"</span>),</div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  m_C3(m_grid, <span class="stringliteral">"C3bedsmooth"</span>),</div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  m_C4(m_grid, <span class="stringliteral">"C3bedsmooth"</span>)</div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span> {</div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  </div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  <span class="keyword">const</span> <a class="code" href="classpism_1_1Logger.html">Logger</a> &log = *<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ad95e0c783c9d8318bb7eecf09284d1eb.html#ad95e0c783c9d8318bb7eecf09284d1eb">m_grid</a>->ctx()->log();</div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  </div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  {</div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  <span class="comment">// allocate Vecs that live on all procs; all have to be as "wide" as any of</span></div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  <span class="comment">// their prospective uses</span></div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a4c86442bfdbbc2a4ba9e2f20407c4b55.html#a4c86442bfdbbc2a4ba9e2f20407c4b55">m_topgsmooth</a>.<a class="code" href="classpism_1_1array_1_1Array_af9eece42153cd03bfc8ba237ae5310c4.html#af9eece42153cd03bfc8ba237ae5310c4">metadata</a>(0)</div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  .<a class="code" href="classpism_1_1VariableMetadata_a5e378cf7077ab00a808ef446a79dc34d.html#a5e378cf7077ab00a808ef446a79dc34d">long_name</a>(<span class="stringliteral">"smoothed bed elevation, in bed roughness parameterization"</span>)</div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  .<a class="code" href="classpism_1_1VariableMetadata_ae73185be0693a8607b8e0f74558e11e4.html#ae73185be0693a8607b8e0f74558e11e4">units</a>(<span class="stringliteral">"m"</span>);</div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a7b2336a229c4cd4b7e0b08edd7c716eb.html#a7b2336a229c4cd4b7e0b08edd7c716eb">m_maxtl</a>.<a class="code" href="classpism_1_1array_1_1Array_af9eece42153cd03bfc8ba237ae5310c4.html#af9eece42153cd03bfc8ba237ae5310c4">metadata</a>(0)</div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  .<a class="code" href="classpism_1_1VariableMetadata_a5e378cf7077ab00a808ef446a79dc34d.html#a5e378cf7077ab00a808ef446a79dc34d">long_name</a>(<span class="stringliteral">"maximum elevation in local topography patch, in bed roughness parameterization"</span>)</div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  .<a class="code" href="classpism_1_1VariableMetadata_ae73185be0693a8607b8e0f74558e11e4.html#ae73185be0693a8607b8e0f74558e11e4">units</a>(<span class="stringliteral">"m"</span>);</div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a487e1e99477f270bc123982315713169.html#a487e1e99477f270bc123982315713169">m_C2</a>.<a class="code" href="classpism_1_1array_1_1Array_af9eece42153cd03bfc8ba237ae5310c4.html#af9eece42153cd03bfc8ba237ae5310c4">metadata</a>(0)</div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  .<a class="code" href="classpism_1_1VariableMetadata_a5e378cf7077ab00a808ef446a79dc34d.html#a5e378cf7077ab00a808ef446a79dc34d">long_name</a>(<span class="stringliteral">"polynomial coeff of H^-2, in bed roughness parameterization"</span>)</div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  .<a class="code" href="classpism_1_1VariableMetadata_ae73185be0693a8607b8e0f74558e11e4.html#ae73185be0693a8607b8e0f74558e11e4">units</a>(<span class="stringliteral">"m2"</span>);</div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ae744391ca2db8b254d3b037da92cbbba.html#ae744391ca2db8b254d3b037da92cbbba">m_C3</a>.<a class="code" href="classpism_1_1array_1_1Array_af9eece42153cd03bfc8ba237ae5310c4.html#af9eece42153cd03bfc8ba237ae5310c4">metadata</a>(0)</div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  .<a class="code" href="classpism_1_1VariableMetadata_a5e378cf7077ab00a808ef446a79dc34d.html#a5e378cf7077ab00a808ef446a79dc34d">long_name</a>(<span class="stringliteral">"polynomial coeff of H^-3, in bed roughness parameterization"</span>)</div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  .<a class="code" href="classpism_1_1VariableMetadata_ae73185be0693a8607b8e0f74558e11e4.html#ae73185be0693a8607b8e0f74558e11e4">units</a>(<span class="stringliteral">"m3"</span>);</div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a1ed491372b68c6e6e8a50010b112b681.html#a1ed491372b68c6e6e8a50010b112b681">m_C4</a>.<a class="code" href="classpism_1_1array_1_1Array_af9eece42153cd03bfc8ba237ae5310c4.html#af9eece42153cd03bfc8ba237ae5310c4">metadata</a>(0)</div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  .<a class="code" href="classpism_1_1VariableMetadata_a5e378cf7077ab00a808ef446a79dc34d.html#a5e378cf7077ab00a808ef446a79dc34d">long_name</a>(<span class="stringliteral">"polynomial coeff of H^-4, in bed roughness parameterization"</span>)</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  .<a class="code" href="classpism_1_1VariableMetadata_ae73185be0693a8607b8e0f74558e11e4.html#ae73185be0693a8607b8e0f74558e11e4">units</a>(<span class="stringliteral">"m4"</span>);</div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  </div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  <span class="comment">// allocate Vecs that live on processor 0:</span></div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a43d6ca6da2f6513d1a5115d6b5de8332.html#a43d6ca6da2f6513d1a5115d6b5de8332">m_topgp0</a> = <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a4c86442bfdbbc2a4ba9e2f20407c4b55.html#a4c86442bfdbbc2a4ba9e2f20407c4b55">m_topgsmooth</a>.<a class="code" href="classpism_1_1array_1_1Array_ab03888a9f5e399025704ae789738bba2.html#ab03888a9f5e399025704ae789738bba2">allocate_proc0_copy</a>();</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ab1c917c55fc9b6fc0e3265ed1ee71202.html#ab1c917c55fc9b6fc0e3265ed1ee71202">m_topgsmoothp0</a> = <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a4c86442bfdbbc2a4ba9e2f20407c4b55.html#a4c86442bfdbbc2a4ba9e2f20407c4b55">m_topgsmooth</a>.<a class="code" href="classpism_1_1array_1_1Array_ab03888a9f5e399025704ae789738bba2.html#ab03888a9f5e399025704ae789738bba2">allocate_proc0_copy</a>();</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a4f727584546e4cef224c33484d1e41e2.html#a4f727584546e4cef224c33484d1e41e2">m_maxtlp0</a> = <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a7b2336a229c4cd4b7e0b08edd7c716eb.html#a7b2336a229c4cd4b7e0b08edd7c716eb">m_maxtl</a>.<a class="code" href="classpism_1_1array_1_1Array_ab03888a9f5e399025704ae789738bba2.html#ab03888a9f5e399025704ae789738bba2">allocate_proc0_copy</a>();</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_af200deb02932da18adb78d12a908346f.html#af200deb02932da18adb78d12a908346f">m_C2p0</a> = <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a487e1e99477f270bc123982315713169.html#a487e1e99477f270bc123982315713169">m_C2</a>.<a class="code" href="classpism_1_1array_1_1Array_ab03888a9f5e399025704ae789738bba2.html#ab03888a9f5e399025704ae789738bba2">allocate_proc0_copy</a>();</div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a02fb4d8d2e000f58a4eabcc1d0bf1ccb.html#a02fb4d8d2e000f58a4eabcc1d0bf1ccb">m_C3p0</a> = <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ae744391ca2db8b254d3b037da92cbbba.html#ae744391ca2db8b254d3b037da92cbbba">m_C3</a>.<a class="code" href="classpism_1_1array_1_1Array_ab03888a9f5e399025704ae789738bba2.html#ab03888a9f5e399025704ae789738bba2">allocate_proc0_copy</a>();</div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ad07977b6a5e8b8df9963203bca80553b.html#ad07977b6a5e8b8df9963203bca80553b">m_C4p0</a> = <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a1ed491372b68c6e6e8a50010b112b681.html#a1ed491372b68c6e6e8a50010b112b681">m_C4</a>.<a class="code" href="classpism_1_1array_1_1Array_ab03888a9f5e399025704ae789738bba2.html#ab03888a9f5e399025704ae789738bba2">allocate_proc0_copy</a>();</div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  }</div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  </div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a01b79ef0eb383f13aa8b62bb590d38c0.html#a01b79ef0eb383f13aa8b62bb590d38c0">m_Glen_exponent</a> = <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_aa72b3eb0e614bc7111e99f39e66d0187.html#aa72b3eb0e614bc7111e99f39e66d0187">m_config</a>->get_number(<span class="stringliteral">"stress_balance.sia.Glen_exponent"</span>); <span class="comment">// choice is SIA; see #285</span></div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a1da9b441304f82bf6fc8fb7c70c6a7a8.html#a1da9b441304f82bf6fc8fb7c70c6a7a8">m_smoothing_range</a> = <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_aa72b3eb0e614bc7111e99f39e66d0187.html#aa72b3eb0e614bc7111e99f39e66d0187">m_config</a>->get_number(<span class="stringliteral">"stress_balance.sia.bed_smoother.range"</span>);</div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  </div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  <span class="keywordflow">if</span> (<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a1da9b441304f82bf6fc8fb7c70c6a7a8.html#a1da9b441304f82bf6fc8fb7c70c6a7a8">m_smoothing_range</a> > 0.0) {</div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  log.<a class="code" href="classpism_1_1Logger_a72a51137de46115eb228a8bbc12a2a8a.html#a72a51137de46115eb228a8bbc12a2a8a">message</a>(2,</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  <span class="stringliteral">"* Initializing bed smoother object with %.3f km half-width ...\n"</span>,</div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  <a class="code" href="namespacepism_1_1units_aae3f4db8a6a2365e607a699bc61a5077.html#aae3f4db8a6a2365e607a699bc61a5077">units::convert</a>(<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ad95e0c783c9d8318bb7eecf09284d1eb.html#ad95e0c783c9d8318bb7eecf09284d1eb">m_grid</a>->ctx()->unit_system(), <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a1da9b441304f82bf6fc8fb7c70c6a7a8.html#a1da9b441304f82bf6fc8fb7c70c6a7a8">m_smoothing_range</a>, <span class="stringliteral">"m"</span>, <span class="stringliteral">"km"</span>));</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  }</div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  </div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  <span class="comment">// Make sure that Nx and Ny are initialized. In most cases SIAFD::update() will call</span></div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  <span class="comment">// preprocess_bed() and set appropriate values, but in a zero-length (-y 0) run IceModel does not</span></div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  <span class="comment">// call SIAFD::update()... We may need to re-structure this class so that everything is</span></div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  <span class="comment">// initialized right after construction and users don't have to call preprocess_bed() manually.</span></div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ae0db8dcdf5af87a7feb0bdb472b71227.html#ae0db8dcdf5af87a7feb0bdb472b71227">m_Nx</a> = -1;</div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a2553d3b7d74feebc688a654cf3cef75e.html#a2553d3b7d74feebc688a654cf3cef75e">m_Ny</a> = -1;</div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span> }</div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  </div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span> <span class="comment"></span> </div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span> <span class="comment">/*!</span></div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span> <span class="comment">Input lambda gives physical half-width (in m) of square over which to do the</span></div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span> <span class="comment">average. Only square smoothing domains are allowed with this call, which is the</span></div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span> <span class="comment">default case.</span></div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span> <span class="comment"> */</span></div>
<div class="line"><a name="l00097"></a><span class="lineno"><a class="line" href="classpism_1_1stressbalance_1_1BedSmoother_ae13dd0bbf11b712bbef3eeaf93a8f527.html#ae13dd0bbf11b712bbef3eeaf93a8f527"> 97</a></span> <span class="keywordtype">void</span> <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ae13dd0bbf11b712bbef3eeaf93a8f527.html#ae13dd0bbf11b712bbef3eeaf93a8f527">BedSmoother::preprocess_bed</a>(<span class="keyword">const</span> <a class="code" href="classpism_1_1array_1_1Scalar.html">array::Scalar</a> &topg) {</div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  </div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  <span class="keywordflow">if</span> (<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a1da9b441304f82bf6fc8fb7c70c6a7a8.html#a1da9b441304f82bf6fc8fb7c70c6a7a8">m_smoothing_range</a> <= 0.0) {</div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  <span class="comment">// smoothing completely inactive. we transfer the original bed topg,</span></div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  <span class="comment">// including ghosts, to public member topgsmooth ...</span></div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a4c86442bfdbbc2a4ba9e2f20407c4b55.html#a4c86442bfdbbc2a4ba9e2f20407c4b55">m_topgsmooth</a>.<a class="code" href="classpism_1_1array_1_1Array2D_a7b9a0d8a83d5379f1debdcefce0fffae.html#a7b9a0d8a83d5379f1debdcefce0fffae">copy_from</a>(topg);</div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  <span class="comment">// and we tell theta() to return theta=1</span></div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ae0db8dcdf5af87a7feb0bdb472b71227.html#ae0db8dcdf5af87a7feb0bdb472b71227">m_Nx</a> = -1;</div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a2553d3b7d74feebc688a654cf3cef75e.html#a2553d3b7d74feebc688a654cf3cef75e">m_Ny</a> = -1;</div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  }</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  </div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  <span class="comment">// determine Nx, Ny, which are always at least one if m_smoothing_range > 0</span></div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ae0db8dcdf5af87a7feb0bdb472b71227.html#ae0db8dcdf5af87a7feb0bdb472b71227">m_Nx</a> = <span class="keyword">static_cast<</span><span class="keywordtype">int</span><span class="keyword">></span>(ceil(<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a1da9b441304f82bf6fc8fb7c70c6a7a8.html#a1da9b441304f82bf6fc8fb7c70c6a7a8">m_smoothing_range</a> / <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ad95e0c783c9d8318bb7eecf09284d1eb.html#ad95e0c783c9d8318bb7eecf09284d1eb">m_grid</a>->dx()));</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a2553d3b7d74feebc688a654cf3cef75e.html#a2553d3b7d74feebc688a654cf3cef75e">m_Ny</a> = <span class="keyword">static_cast<</span><span class="keywordtype">int</span><span class="keyword">></span>(ceil(<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a1da9b441304f82bf6fc8fb7c70c6a7a8.html#a1da9b441304f82bf6fc8fb7c70c6a7a8">m_smoothing_range</a> / <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ad95e0c783c9d8318bb7eecf09284d1eb.html#ad95e0c783c9d8318bb7eecf09284d1eb">m_grid</a>->dy()));</div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  <span class="keywordflow">if</span> (<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ae0db8dcdf5af87a7feb0bdb472b71227.html#ae0db8dcdf5af87a7feb0bdb472b71227">m_Nx</a> < 1) {</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ae0db8dcdf5af87a7feb0bdb472b71227.html#ae0db8dcdf5af87a7feb0bdb472b71227">m_Nx</a> = 1;</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  }</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  <span class="keywordflow">if</span> (<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a2553d3b7d74feebc688a654cf3cef75e.html#a2553d3b7d74feebc688a654cf3cef75e">m_Ny</a> < 1) {</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a2553d3b7d74feebc688a654cf3cef75e.html#a2553d3b7d74feebc688a654cf3cef75e">m_Ny</a> = 1;</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  }</div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  </div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ae13dd0bbf11b712bbef3eeaf93a8f527.html#ae13dd0bbf11b712bbef3eeaf93a8f527">preprocess_bed</a>(topg, <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ae0db8dcdf5af87a7feb0bdb472b71227.html#ae0db8dcdf5af87a7feb0bdb472b71227">m_Nx</a>, <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a2553d3b7d74feebc688a654cf3cef75e.html#a2553d3b7d74feebc688a654cf3cef75e">m_Ny</a>);</div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span> }</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  </div>
<div class="line"><a name="l00122"></a><span class="lineno"><a class="line" href="classpism_1_1stressbalance_1_1BedSmoother_a706c3a4805bc78586d0e0d8e4973b7bb.html#a706c3a4805bc78586d0e0d8e4973b7bb"> 122</a></span> <span class="keyword">const</span> <a class="code" href="classpism_1_1array_1_1Scalar.html">array::Scalar</a>& <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a706c3a4805bc78586d0e0d8e4973b7bb.html#a706c3a4805bc78586d0e0d8e4973b7bb">BedSmoother::smoothed_bed</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  <span class="keywordflow">return</span> <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a4c86442bfdbbc2a4ba9e2f20407c4b55.html#a4c86442bfdbbc2a4ba9e2f20407c4b55">m_topgsmooth</a>;</div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span> }</div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span> <span class="comment"></span> </div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span> <span class="comment">/*!</span></div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span> <span class="comment">Inputs Nx,Ny gives half-width in number of grid points, over which to do the</span></div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span> <span class="comment">average.</span></div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span> <span class="comment"> */</span></div>
<div class="line"><a name="l00130"></a><span class="lineno"><a class="line" href="classpism_1_1stressbalance_1_1BedSmoother_addb17716aefc353aee774bc3921eb29b.html#addb17716aefc353aee774bc3921eb29b"> 130</a></span> <span class="keywordtype">void</span> <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ae13dd0bbf11b712bbef3eeaf93a8f527.html#ae13dd0bbf11b712bbef3eeaf93a8f527">BedSmoother::preprocess_bed</a>(<span class="keyword">const</span> <a class="code" href="classpism_1_1array_1_1Scalar.html">array::Scalar</a> &topg,</div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> Nx, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> Ny) {</div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  </div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  <span class="keywordflow">if</span> ((Nx >= <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ad95e0c783c9d8318bb7eecf09284d1eb.html#ad95e0c783c9d8318bb7eecf09284d1eb">m_grid</a>->Mx()) || (Ny >= <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ad95e0c783c9d8318bb7eecf09284d1eb.html#ad95e0c783c9d8318bb7eecf09284d1eb">m_grid</a>->My())) {</div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  <span class="keywordflow">throw</span> <a class="code" href="classpism_1_1RuntimeError.html">RuntimeError</a>(<a class="code" href="error__handling_8hh_aa0c260bffe8a4dbd77d48e8feee7c526.html#aa0c260bffe8a4dbd77d48e8feee7c526">PISM_ERROR_LOCATION</a>, <span class="stringliteral">"input Nx, Ny in bed smoother is too large because\n"</span></div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  <span class="stringliteral">"domain of smoothing exceeds Grid domain"</span>);</div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  }</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ae0db8dcdf5af87a7feb0bdb472b71227.html#ae0db8dcdf5af87a7feb0bdb472b71227">m_Nx</a> = Nx;</div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a2553d3b7d74feebc688a654cf3cef75e.html#a2553d3b7d74feebc688a654cf3cef75e">m_Ny</a> = Ny;</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  </div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  topg.<a class="code" href="classpism_1_1array_1_1Array_ab56dc4d6cf0f9660ce580bbf4f3585d9.html#ab56dc4d6cf0f9660ce580bbf4f3585d9">put_on_proc0</a>(*<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a43d6ca6da2f6513d1a5115d6b5de8332.html#a43d6ca6da2f6513d1a5115d6b5de8332">m_topgp0</a>);</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a58ff28fd406efac160671b5067fcf2e1.html#a58ff28fd406efac160671b5067fcf2e1">smooth_the_bed_on_proc0</a>();</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  <span class="comment">// next call *does indeed* fill ghosts in topgsmooth</span></div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a4c86442bfdbbc2a4ba9e2f20407c4b55.html#a4c86442bfdbbc2a4ba9e2f20407c4b55">m_topgsmooth</a>.<a class="code" href="classpism_1_1array_1_1Array_a4b0a2833f2ca67c37228e037d1821ccf.html#a4b0a2833f2ca67c37228e037d1821ccf">get_from_proc0</a>(*<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ab1c917c55fc9b6fc0e3265ed1ee71202.html#ab1c917c55fc9b6fc0e3265ed1ee71202">m_topgsmoothp0</a>);</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  </div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a84c1adc9a37d8099c419c21d14e045d9.html#a84c1adc9a37d8099c419c21d14e045d9">compute_coefficients_on_proc0</a>();</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  <span class="comment">// following calls *do* fill the ghosts</span></div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a7b2336a229c4cd4b7e0b08edd7c716eb.html#a7b2336a229c4cd4b7e0b08edd7c716eb">m_maxtl</a>.<a class="code" href="classpism_1_1array_1_1Array_a4b0a2833f2ca67c37228e037d1821ccf.html#a4b0a2833f2ca67c37228e037d1821ccf">get_from_proc0</a>(*<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a4f727584546e4cef224c33484d1e41e2.html#a4f727584546e4cef224c33484d1e41e2">m_maxtlp0</a>);</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a487e1e99477f270bc123982315713169.html#a487e1e99477f270bc123982315713169">m_C2</a>.<a class="code" href="classpism_1_1array_1_1Array_a4b0a2833f2ca67c37228e037d1821ccf.html#a4b0a2833f2ca67c37228e037d1821ccf">get_from_proc0</a>(*<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_af200deb02932da18adb78d12a908346f.html#af200deb02932da18adb78d12a908346f">m_C2p0</a>);</div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ae744391ca2db8b254d3b037da92cbbba.html#ae744391ca2db8b254d3b037da92cbbba">m_C3</a>.<a class="code" href="classpism_1_1array_1_1Array_a4b0a2833f2ca67c37228e037d1821ccf.html#a4b0a2833f2ca67c37228e037d1821ccf">get_from_proc0</a>(*<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a02fb4d8d2e000f58a4eabcc1d0bf1ccb.html#a02fb4d8d2e000f58a4eabcc1d0bf1ccb">m_C3p0</a>);</div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a1ed491372b68c6e6e8a50010b112b681.html#a1ed491372b68c6e6e8a50010b112b681">m_C4</a>.<a class="code" href="classpism_1_1array_1_1Array_a4b0a2833f2ca67c37228e037d1821ccf.html#a4b0a2833f2ca67c37228e037d1821ccf">get_from_proc0</a>(*<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ad07977b6a5e8b8df9963203bca80553b.html#ad07977b6a5e8b8df9963203bca80553b">m_C4p0</a>);</div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span> }</div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  </div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span> <span class="comment"></span> </div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span> <span class="comment">//! Computes the smoothed bed by a simple average over a rectangle of grid points.</span></div>
<div class="line"><a name="l00155"></a><span class="lineno"><a class="line" href="classpism_1_1stressbalance_1_1BedSmoother_a58ff28fd406efac160671b5067fcf2e1.html#a58ff28fd406efac160671b5067fcf2e1"> 155</a></span> <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a58ff28fd406efac160671b5067fcf2e1.html#a58ff28fd406efac160671b5067fcf2e1">BedSmoother::smooth_the_bed_on_proc0</a>() {</div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  </div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  <a class="code" href="classpism_1_1ParallelSection.html">ParallelSection</a> rank0(<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ad95e0c783c9d8318bb7eecf09284d1eb.html#ad95e0c783c9d8318bb7eecf09284d1eb">m_grid</a>->com);</div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  <span class="keywordflow">try</span> {</div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  <span class="keywordflow">if</span> (<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ad95e0c783c9d8318bb7eecf09284d1eb.html#ad95e0c783c9d8318bb7eecf09284d1eb">m_grid</a>->rank() == 0) {</div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  <span class="keyword">const</span> <span class="keywordtype">int</span> Mx = (int)<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ad95e0c783c9d8318bb7eecf09284d1eb.html#ad95e0c783c9d8318bb7eecf09284d1eb">m_grid</a>->Mx();</div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  <span class="keyword">const</span> <span class="keywordtype">int</span> My = (int)<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ad95e0c783c9d8318bb7eecf09284d1eb.html#ad95e0c783c9d8318bb7eecf09284d1eb">m_grid</a>->My();</div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>  </div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  <a class="code" href="classpism_1_1petsc_1_1VecArray2D.html">petsc::VecArray2D</a></div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  <a class="code" href="exactTestL_8cc_a7cd4ebc9eb7d8912281c0f7e47868b80.html#a7cd4ebc9eb7d8912281c0f7e47868b80">b0</a>(*<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a43d6ca6da2f6513d1a5115d6b5de8332.html#a43d6ca6da2f6513d1a5115d6b5de8332">m_topgp0</a>, Mx, My),</div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>  bs(*<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ab1c917c55fc9b6fc0e3265ed1ee71202.html#ab1c917c55fc9b6fc0e3265ed1ee71202">m_topgsmoothp0</a>, Mx, My);</div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>  </div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j=0; j < My; j++) {</div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i=0; i < Mx; i++) {</div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  <span class="comment">// average only over those points which are in the grid; do</span></div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  <span class="comment">// not wrap periodically</span></div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  <span class="keywordtype">double</span> <a class="code" href="namespacepism_1_1array_aa88c3344e3ab8655faabb90fe37e76c6.html#aa88c3344e3ab8655faabb90fe37e76c6">sum</a> = 0.0, <a class="code" href="test__cube_8c_ad43c3812e6d13e0518d9f8b8f463ffcf.html#ad43c3812e6d13e0518d9f8b8f463ffcf">count</a> = 0.0;</div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> r = -<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ae0db8dcdf5af87a7feb0bdb472b71227.html#ae0db8dcdf5af87a7feb0bdb472b71227">m_Nx</a>; r <= <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ae0db8dcdf5af87a7feb0bdb472b71227.html#ae0db8dcdf5af87a7feb0bdb472b71227">m_Nx</a>; r++) {</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> s = -<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a2553d3b7d74feebc688a654cf3cef75e.html#a2553d3b7d74feebc688a654cf3cef75e">m_Ny</a>; s <= <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a2553d3b7d74feebc688a654cf3cef75e.html#a2553d3b7d74feebc688a654cf3cef75e">m_Ny</a>; s++) {</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  <span class="keywordflow">if</span> ((i+r >= 0) and (i+r < Mx) and (j+s >= 0) and (j+s < My)) {</div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>  <a class="code" href="namespacepism_1_1array_aa88c3344e3ab8655faabb90fe37e76c6.html#aa88c3344e3ab8655faabb90fe37e76c6">sum</a> += <a class="code" href="exactTestL_8cc_a7cd4ebc9eb7d8912281c0f7e47868b80.html#a7cd4ebc9eb7d8912281c0f7e47868b80">b0</a>(i+r, j+s);</div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>  <a class="code" href="test__cube_8c_ad43c3812e6d13e0518d9f8b8f463ffcf.html#ad43c3812e6d13e0518d9f8b8f463ffcf">count</a> += 1.0;</div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>  }</div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>  }</div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>  }</div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>  <span class="comment">// unprotected division by count but r=0,s=0 case guarantees count>=1</span></div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>  bs(i, j) = <a class="code" href="namespacepism_1_1array_aa88c3344e3ab8655faabb90fe37e76c6.html#aa88c3344e3ab8655faabb90fe37e76c6">sum</a> / <a class="code" href="test__cube_8c_ad43c3812e6d13e0518d9f8b8f463ffcf.html#ad43c3812e6d13e0518d9f8b8f463ffcf">count</a>;</div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  }</div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  }</div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>  }</div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>  } <span class="keywordflow">catch</span> (...) {</div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  rank0.<a class="code" href="classpism_1_1ParallelSection_a6b0a6e5e64970af7eadabfebe2b20bd2.html#a6b0a6e5e64970af7eadabfebe2b20bd2">failed</a>();</div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>  }</div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  rank0.<a class="code" href="classpism_1_1ParallelSection_ac23296abee1cbcb3c3fd68c7f5ce0835.html#ac23296abee1cbcb3c3fd68c7f5ce0835">check</a>();</div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span> }</div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>  </div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  </div>
<div class="line"><a name="l00192"></a><span class="lineno"><a class="line" href="classpism_1_1stressbalance_1_1BedSmoother_a84c1adc9a37d8099c419c21d14e045d9.html#a84c1adc9a37d8099c419c21d14e045d9"> 192</a></span> <span class="keywordtype">void</span> <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a84c1adc9a37d8099c419c21d14e045d9.html#a84c1adc9a37d8099c419c21d14e045d9">BedSmoother::compute_coefficients_on_proc0</a>() {</div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  </div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> Mx = <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ad95e0c783c9d8318bb7eecf09284d1eb.html#ad95e0c783c9d8318bb7eecf09284d1eb">m_grid</a>->Mx(), My = <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ad95e0c783c9d8318bb7eecf09284d1eb.html#ad95e0c783c9d8318bb7eecf09284d1eb">m_grid</a>->My();</div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  </div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  <a class="code" href="classpism_1_1ParallelSection.html">ParallelSection</a> rank0(<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ad95e0c783c9d8318bb7eecf09284d1eb.html#ad95e0c783c9d8318bb7eecf09284d1eb">m_grid</a>->com);</div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  <span class="keywordflow">try</span> {</div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  <span class="keywordflow">if</span> (<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ad95e0c783c9d8318bb7eecf09284d1eb.html#ad95e0c783c9d8318bb7eecf09284d1eb">m_grid</a>->rank() == 0) {</div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  <a class="code" href="classpism_1_1petsc_1_1VecArray2D.html">petsc::VecArray2D</a></div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  <a class="code" href="exactTestL_8cc_a7cd4ebc9eb7d8912281c0f7e47868b80.html#a7cd4ebc9eb7d8912281c0f7e47868b80">b0</a>(*<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a43d6ca6da2f6513d1a5115d6b5de8332.html#a43d6ca6da2f6513d1a5115d6b5de8332">m_topgp0</a>, Mx, My),</div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>  bs(*<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ab1c917c55fc9b6fc0e3265ed1ee71202.html#ab1c917c55fc9b6fc0e3265ed1ee71202">m_topgsmoothp0</a>, Mx, My),</div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>  mt(*<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a4f727584546e4cef224c33484d1e41e2.html#a4f727584546e4cef224c33484d1e41e2">m_maxtlp0</a>, Mx, My),</div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  <a class="code" href="namespacepism_a61f495299b26a97b1957dd1ff8333201.html#a61f495299b26a97b1957dd1ff8333201">c2</a>(*<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_af200deb02932da18adb78d12a908346f.html#af200deb02932da18adb78d12a908346f">m_C2p0</a>, Mx, My),</div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>  c3(*<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a02fb4d8d2e000f58a4eabcc1d0bf1ccb.html#a02fb4d8d2e000f58a4eabcc1d0bf1ccb">m_C3p0</a>, Mx, My),</div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  c4(*<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ad07977b6a5e8b8df9963203bca80553b.html#ad07977b6a5e8b8df9963203bca80553b">m_C4p0</a>, Mx, My);</div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  </div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j=0; j < (int)My; j++) {</div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i=0; i < (int)Mx; i++) {</div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  <span class="comment">// average only over those points which are in the grid</span></div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>  <span class="comment">// do not wrap periodically</span></div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>  <span class="keywordtype">double</span></div>
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>  topgs = bs(i, j),</div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>  maxtltemp = 0.0,</div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>  sum2 = 0.0,</div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  sum3 = 0.0,</div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>  sum4 = 0.0,</div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  <a class="code" href="test__cube_8c_ad43c3812e6d13e0518d9f8b8f463ffcf.html#ad43c3812e6d13e0518d9f8b8f463ffcf">count</a> = 0.0;</div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>  </div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> r = -<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ae0db8dcdf5af87a7feb0bdb472b71227.html#ae0db8dcdf5af87a7feb0bdb472b71227">m_Nx</a>; r <= <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ae0db8dcdf5af87a7feb0bdb472b71227.html#ae0db8dcdf5af87a7feb0bdb472b71227">m_Nx</a>; r++) {</div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> s = -<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a2553d3b7d74feebc688a654cf3cef75e.html#a2553d3b7d74feebc688a654cf3cef75e">m_Ny</a>; s <= <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a2553d3b7d74feebc688a654cf3cef75e.html#a2553d3b7d74feebc688a654cf3cef75e">m_Ny</a>; s++) {</div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>  <span class="keywordflow">if</span> ((i+r >= 0) && (i+r < (<span class="keywordtype">int</span>)Mx) && (j+s >= 0) && (j+s < (<span class="keywordtype">int</span>)My)) {</div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>  <span class="comment">// tl is elevation of local topography at a pt in patch</span></div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>  <span class="keyword">const</span> <span class="keywordtype">double</span> tl = <a class="code" href="exactTestL_8cc_a7cd4ebc9eb7d8912281c0f7e47868b80.html#a7cd4ebc9eb7d8912281c0f7e47868b80">b0</a>(i+r, j+s) - topgs;</div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>  maxtltemp = <a class="code" href="namespacepism_1_1array_a8957d08741c6f48d1e554ac7ea98530a.html#a8957d08741c6f48d1e554ac7ea98530a">std::max</a>(maxtltemp, tl);</div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>  <span class="comment">// accumulate 2nd, 3rd, and 4th powers with only 3 multiplications</span></div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>  <span class="keyword">const</span> <span class="keywordtype">double</span> tl2 = tl * tl;</div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>  sum2 += tl2;</div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>  sum3 += tl2 * tl;</div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>  sum4 += tl2 * tl2;</div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>  <a class="code" href="test__cube_8c_ad43c3812e6d13e0518d9f8b8f463ffcf.html#ad43c3812e6d13e0518d9f8b8f463ffcf">count</a> += 1.0;</div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>  }</div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>  }</div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>  }</div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>  mt(i, j) = maxtltemp;</div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>  </div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>  <span class="comment">// unprotected division by count but r=0,s=0 case guarantees count>=1</span></div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>  <a class="code" href="namespacepism_a61f495299b26a97b1957dd1ff8333201.html#a61f495299b26a97b1957dd1ff8333201">c2</a>(i, j) = sum2 / <a class="code" href="test__cube_8c_ad43c3812e6d13e0518d9f8b8f463ffcf.html#ad43c3812e6d13e0518d9f8b8f463ffcf">count</a>;</div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>  c3(i, j) = sum3 / <a class="code" href="test__cube_8c_ad43c3812e6d13e0518d9f8b8f463ffcf.html#ad43c3812e6d13e0518d9f8b8f463ffcf">count</a>;</div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>  c4(i, j) = sum4 / <a class="code" href="test__cube_8c_ad43c3812e6d13e0518d9f8b8f463ffcf.html#ad43c3812e6d13e0518d9f8b8f463ffcf">count</a>;</div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>  }</div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>  }</div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>  </div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>  <span class="comment">// scale the coeffs in Taylor series</span></div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>  <span class="keyword">const</span> <span class="keywordtype">double</span></div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>  <a class="code" href="exactTestM_8c_ad5228cd48403ef9d8b632f5c7c124720.html#ad5228cd48403ef9d8b632f5c7c124720">n</a> = <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a01b79ef0eb383f13aa8b62bb590d38c0.html#a01b79ef0eb383f13aa8b62bb590d38c0">m_Glen_exponent</a>,</div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>  <a class="code" href="namespacepism_a7343afff8d353b59dbdec563bd896812.html#a7343afff8d353b59dbdec563bd896812">k</a> = (<a class="code" href="exactTestM_8c_ad5228cd48403ef9d8b632f5c7c124720.html#ad5228cd48403ef9d8b632f5c7c124720">n</a> + 2) / <a class="code" href="exactTestM_8c_ad5228cd48403ef9d8b632f5c7c124720.html#ad5228cd48403ef9d8b632f5c7c124720">n</a>,</div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>  s2 = <a class="code" href="namespacepism_a7343afff8d353b59dbdec563bd896812.html#a7343afff8d353b59dbdec563bd896812">k</a> * (2 * <a class="code" href="exactTestM_8c_ad5228cd48403ef9d8b632f5c7c124720.html#ad5228cd48403ef9d8b632f5c7c124720">n</a> + 2) / (2 * <a class="code" href="exactTestM_8c_ad5228cd48403ef9d8b632f5c7c124720.html#ad5228cd48403ef9d8b632f5c7c124720">n</a>),</div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>  s3 = s2 * (3 * <a class="code" href="exactTestM_8c_ad5228cd48403ef9d8b632f5c7c124720.html#ad5228cd48403ef9d8b632f5c7c124720">n</a> + 2) / (3 * <a class="code" href="exactTestM_8c_ad5228cd48403ef9d8b632f5c7c124720.html#ad5228cd48403ef9d8b632f5c7c124720">n</a>),</div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>  s4 = s3 * (4 * <a class="code" href="exactTestM_8c_ad5228cd48403ef9d8b632f5c7c124720.html#ad5228cd48403ef9d8b632f5c7c124720">n</a> + 2) / (4 * <a class="code" href="exactTestM_8c_ad5228cd48403ef9d8b632f5c7c124720.html#ad5228cd48403ef9d8b632f5c7c124720">n</a>);</div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>  </div>
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>  PetscErrorCode ierr;</div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>  ierr = VecScale(*<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_af200deb02932da18adb78d12a908346f.html#af200deb02932da18adb78d12a908346f">m_C2p0</a>,s2);</div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>  <a class="code" href="error__handling_8hh_a970ec877c0e54c6e16c039bfa1b88bad.html#a970ec877c0e54c6e16c039bfa1b88bad">PISM_CHK</a>(ierr, <span class="stringliteral">"VecScale"</span>);</div>
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>  </div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>  ierr = VecScale(*<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a02fb4d8d2e000f58a4eabcc1d0bf1ccb.html#a02fb4d8d2e000f58a4eabcc1d0bf1ccb">m_C3p0</a>,s3);</div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>  <a class="code" href="error__handling_8hh_a970ec877c0e54c6e16c039bfa1b88bad.html#a970ec877c0e54c6e16c039bfa1b88bad">PISM_CHK</a>(ierr, <span class="stringliteral">"VecScale"</span>);</div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>  </div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>  ierr = VecScale(*<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ad07977b6a5e8b8df9963203bca80553b.html#ad07977b6a5e8b8df9963203bca80553b">m_C4p0</a>,s4);</div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>  <a class="code" href="error__handling_8hh_a970ec877c0e54c6e16c039bfa1b88bad.html#a970ec877c0e54c6e16c039bfa1b88bad">PISM_CHK</a>(ierr, <span class="stringliteral">"VecScale"</span>);</div>
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>  }</div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>  } <span class="keywordflow">catch</span> (...) {</div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>  rank0.<a class="code" href="classpism_1_1ParallelSection_a6b0a6e5e64970af7eadabfebe2b20bd2.html#a6b0a6e5e64970af7eadabfebe2b20bd2">failed</a>();</div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>  }</div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>  rank0.<a class="code" href="classpism_1_1ParallelSection_ac23296abee1cbcb3c3fd68c7f5ce0835.html#ac23296abee1cbcb3c3fd68c7f5ce0835">check</a>();</div>
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span> }</div>
<div class="line"><a name="l00266"></a><span class="lineno"> 266</span>  </div>
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span> <span class="comment"></span> </div>
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span> <span class="comment">//! Computes a smoothed thickness map.</span></div>
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span> <span class="comment"></span><span class="comment">/*!</span></div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span> <span class="comment">The result `thksmooth` is the difference between the given upper surface</span></div>
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span> <span class="comment">elevation (`usurf`) and the stored smoothed bed topography (`topgsmooth`),</span></div>
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span> <span class="comment">except where the given original thickness (`thk`) is zero. In places where</span></div>
<div class="line"><a name="l00273"></a><span class="lineno"> 273</span> <span class="comment">the original thickness is zero, the result `thksmooth` is also set to zero.</span></div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span> <span class="comment"></span> </div>
<div class="line"><a name="l00275"></a><span class="lineno"> 275</span> <span class="comment">Ghosted values are updated directly and no communication occurs. In fact,</span></div>
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span> <span class="comment">we \e assume `usurf`, `thk`, and `thksmooth` all have stencil width at least</span></div>
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span> <span class="comment">equal to GHOSTS. We \e check whether `topgsmooth`, which has stencil width</span></div>
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span> <span class="comment">maxGHOSTS, has at least GHOSTS stencil width, and throw an error if not.</span></div>
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span> <span class="comment"></span> </div>
<div class="line"><a name="l00280"></a><span class="lineno"> 280</span> <span class="comment">Call preprocess_bed() first.</span></div>
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span> <span class="comment"> */</span></div>
<div class="line"><a name="l00282"></a><span class="lineno"><a class="line" href="classpism_1_1stressbalance_1_1BedSmoother_a38b304465661b70e7d2faa4b49aff5eb.html#a38b304465661b70e7d2faa4b49aff5eb"> 282</a></span> <span class="keywordtype">void</span> <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a38b304465661b70e7d2faa4b49aff5eb.html#a38b304465661b70e7d2faa4b49aff5eb">BedSmoother::smoothed_thk</a>(<span class="keyword">const</span> <a class="code" href="classpism_1_1array_1_1Scalar.html">array::Scalar</a> &usurf,</div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>  <span class="keyword">const</span> <a class="code" href="classpism_1_1array_1_1Scalar.html">array::Scalar</a> &thk,</div>
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>  <span class="keyword">const</span> <a class="code" href="classpism_1_1array_1_1CellType2.html">array::CellType2</a> &mask,</div>
<div class="line"><a name="l00285"></a><span class="lineno"> 285</span>  <a class="code" href="classpism_1_1array_1_1Scalar.html">array::Scalar</a> &result)<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>  </div>
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span>  <a class="code" href="classpism_1_1array_1_1AccessScope.html">array::AccessScope</a> list{&mask, &<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a7b2336a229c4cd4b7e0b08edd7c716eb.html#a7b2336a229c4cd4b7e0b08edd7c716eb">m_maxtl</a>, &result, &thk, &<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a4c86442bfdbbc2a4ba9e2f20407c4b55.html#a4c86442bfdbbc2a4ba9e2f20407c4b55">m_topgsmooth</a>, &usurf};</div>
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>  </div>
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span>  <span class="keyword">auto</span> GHOSTS = result.<a class="code" href="classpism_1_1array_1_1Array_ade892a3412dcdc9f21129c2aed50e84d.html#ade892a3412dcdc9f21129c2aed50e84d">stencil_width</a>();</div>
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>  assert(mask.<a class="code" href="classpism_1_1array_1_1Array_ade892a3412dcdc9f21129c2aed50e84d.html#ade892a3412dcdc9f21129c2aed50e84d">stencil_width</a>() >= GHOSTS);</div>
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>  assert(<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a7b2336a229c4cd4b7e0b08edd7c716eb.html#a7b2336a229c4cd4b7e0b08edd7c716eb">m_maxtl</a>.<a class="code" href="classpism_1_1array_1_1Array_ade892a3412dcdc9f21129c2aed50e84d.html#ade892a3412dcdc9f21129c2aed50e84d">stencil_width</a>() >= GHOSTS);</div>
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span>  assert(thk.<a class="code" href="classpism_1_1array_1_1Array_ade892a3412dcdc9f21129c2aed50e84d.html#ade892a3412dcdc9f21129c2aed50e84d">stencil_width</a>() >= GHOSTS);</div>
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>  assert(<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a4c86442bfdbbc2a4ba9e2f20407c4b55.html#a4c86442bfdbbc2a4ba9e2f20407c4b55">m_topgsmooth</a>.<a class="code" href="classpism_1_1array_1_1Array_ade892a3412dcdc9f21129c2aed50e84d.html#ade892a3412dcdc9f21129c2aed50e84d">stencil_width</a>() >= GHOSTS);</div>
<div class="line"><a name="l00294"></a><span class="lineno"> 294</span>  assert(usurf.<a class="code" href="classpism_1_1array_1_1Array_ade892a3412dcdc9f21129c2aed50e84d.html#ade892a3412dcdc9f21129c2aed50e84d">stencil_width</a>() >= GHOSTS);</div>
<div class="line"><a name="l00295"></a><span class="lineno"> 295</span>  </div>
<div class="line"><a name="l00296"></a><span class="lineno"> 296</span>  <a class="code" href="classpism_1_1ParallelSection.html">ParallelSection</a> loop(<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ad95e0c783c9d8318bb7eecf09284d1eb.html#ad95e0c783c9d8318bb7eecf09284d1eb">m_grid</a>->com);</div>
<div class="line"><a name="l00297"></a><span class="lineno"> 297</span>  <span class="keywordflow">try</span> {</div>
<div class="line"><a name="l00298"></a><span class="lineno"> 298</span>  <span class="keywordflow">for</span> (<span class="keyword">auto</span> p = <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ad95e0c783c9d8318bb7eecf09284d1eb.html#ad95e0c783c9d8318bb7eecf09284d1eb">m_grid</a>->points(GHOSTS); p; p.next()) {</div>
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span>  <span class="keyword">const</span> <span class="keywordtype">int</span> i = p.i(), j = p.j();</div>
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span>  </div>
<div class="line"><a name="l00301"></a><span class="lineno"> 301</span>  <span class="keywordflow">if</span> (thk(i, j) < 0.0) {</div>
<div class="line"><a name="l00302"></a><span class="lineno"> 302</span>  <span class="keywordflow">throw</span> <a class="code" href="classpism_1_1RuntimeError_ad0ed5f05a9a4e3e403a1d62f8d1e4e7d.html#ad0ed5f05a9a4e3e403a1d62f8d1e4e7d">RuntimeError::formatted</a>(<a class="code" href="error__handling_8hh_aa0c260bffe8a4dbd77d48e8feee7c526.html#aa0c260bffe8a4dbd77d48e8feee7c526">PISM_ERROR_LOCATION</a>, <span class="stringliteral">"BedSmoother detects negative original thickness\n"</span></div>
<div class="line"><a name="l00303"></a><span class="lineno"> 303</span>  <span class="stringliteral">"at location (i, j) = (%d, %d) ... ending"</span>, i, j);</div>
<div class="line"><a name="l00304"></a><span class="lineno"> 304</span>  }</div>
<div class="line"><a name="l00305"></a><span class="lineno"> 305</span>  </div>
<div class="line"><a name="l00306"></a><span class="lineno"> 306</span>  <span class="keywordflow">if</span> (thk(i, j) == 0.0) {</div>
<div class="line"><a name="l00307"></a><span class="lineno"> 307</span>  result(i, j) = 0.0;</div>
<div class="line"><a name="l00308"></a><span class="lineno"> 308</span>  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a7b2336a229c4cd4b7e0b08edd7c716eb.html#a7b2336a229c4cd4b7e0b08edd7c716eb">m_maxtl</a>(i, j) >= thk(i, j)) {</div>
<div class="line"><a name="l00309"></a><span class="lineno"> 309</span>  result(i, j) = thk(i, j);</div>
<div class="line"><a name="l00310"></a><span class="lineno"> 310</span>  } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00311"></a><span class="lineno"> 311</span>  <span class="keywordflow">if</span> (mask.<a class="code" href="classpism_1_1array_1_1CellType_ada641b8ad181dfc6efd1a50d2a361edd.html#ada641b8ad181dfc6efd1a50d2a361edd">grounded</a>(i, j)) {</div>
<div class="line"><a name="l00312"></a><span class="lineno"> 312</span>  <span class="comment">// if grounded, compute smoothed thickness as the difference of ice surface</span></div>
<div class="line"><a name="l00313"></a><span class="lineno"> 313</span>  <span class="comment">// elevation and smoothed bed elevation, making sure the result is non-negative</span></div>
<div class="line"><a name="l00314"></a><span class="lineno"> 314</span>  result(i, j) = <a class="code" href="namespacepism_1_1array_a8957d08741c6f48d1e554ac7ea98530a.html#a8957d08741c6f48d1e554ac7ea98530a">std::max</a>(usurf(i, j) - <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a4c86442bfdbbc2a4ba9e2f20407c4b55.html#a4c86442bfdbbc2a4ba9e2f20407c4b55">m_topgsmooth</a>(i, j), 0.0);</div>
<div class="line"><a name="l00315"></a><span class="lineno"> 315</span>  } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00316"></a><span class="lineno"> 316</span>  <span class="comment">// if floating, use original thickness (note: surface elevation was</span></div>
<div class="line"><a name="l00317"></a><span class="lineno"> 317</span>  <span class="comment">// computed using this thickness and the sea level elevation)</span></div>
<div class="line"><a name="l00318"></a><span class="lineno"> 318</span>  result(i, j) = thk(i, j);</div>
<div class="line"><a name="l00319"></a><span class="lineno"> 319</span>  }</div>
<div class="line"><a name="l00320"></a><span class="lineno"> 320</span>  }</div>
<div class="line"><a name="l00321"></a><span class="lineno"> 321</span>  }</div>
<div class="line"><a name="l00322"></a><span class="lineno"> 322</span>  } <span class="keywordflow">catch</span> (...) {</div>
<div class="line"><a name="l00323"></a><span class="lineno"> 323</span>  loop.<a class="code" href="classpism_1_1ParallelSection_a6b0a6e5e64970af7eadabfebe2b20bd2.html#a6b0a6e5e64970af7eadabfebe2b20bd2">failed</a>();</div>
<div class="line"><a name="l00324"></a><span class="lineno"> 324</span>  }</div>
<div class="line"><a name="l00325"></a><span class="lineno"> 325</span>  loop.<a class="code" href="classpism_1_1ParallelSection_ac23296abee1cbcb3c3fd68c7f5ce0835.html#ac23296abee1cbcb3c3fd68c7f5ce0835">check</a>();</div>
<div class="line"><a name="l00326"></a><span class="lineno"> 326</span> }</div>
<div class="line"><a name="l00327"></a><span class="lineno"> 327</span>  </div>
<div class="line"><a name="l00328"></a><span class="lineno"> 328</span> <span class="comment"></span> </div>
<div class="line"><a name="l00329"></a><span class="lineno"> 329</span> <span class="comment">/*!</span></div>
<div class="line"><a name="l00330"></a><span class="lineno"> 330</span> <span class="comment">Implements the strategy for computing \f$\theta(h,x,y)\f$ from previously-</span></div>
<div class="line"><a name="l00331"></a><span class="lineno"> 331</span> <span class="comment">stored coefficients, described on [Bed roughness parameterization](@ref bedrough) page and in [\ref</span></div>
<div class="line"><a name="l00332"></a><span class="lineno"> 332</span> <span class="comment">Schoofbasaltopg2003].</span></div>
<div class="line"><a name="l00333"></a><span class="lineno"> 333</span> <span class="comment"></span> </div>
<div class="line"><a name="l00334"></a><span class="lineno"> 334</span> <span class="comment">Specifically, \f$\theta = \omega^{-n}\f$ where \f$\omega\f$ is a local average</span></div>
<div class="line"><a name="l00335"></a><span class="lineno"> 335</span> <span class="comment">of a rational function of surface elevation, approximated here by a Taylor polynomial:</span></div>
<div class="line"><a name="l00336"></a><span class="lineno"> 336</span> <span class="comment"> \f[ \omega = \fint \left(1 - \frac{\tilde b(x_1,x_2,\xi_1,\xi_2)}{H}</span></div>
<div class="line"><a name="l00337"></a><span class="lineno"> 337</span> <span class="comment"> \right)^{-(n+2)/n}\,d\xi_1\,d\xi_2</span></div>
<div class="line"><a name="l00338"></a><span class="lineno"> 338</span> <span class="comment"> \approx 1 + C_2 H^{-2} + C_3 H^{-3} + C_4 H^{-4} \f]</span></div>
<div class="line"><a name="l00339"></a><span class="lineno"> 339</span> <span class="comment">where \f$h =\f$ usurf, \f$H = h -\f$ topgsmooth and \f$\tilde b\f$ is the local</span></div>
<div class="line"><a name="l00340"></a><span class="lineno"> 340</span> <span class="comment">bed topography, a function with mean zero. The coefficients \f$C_2,C_3,C_4\f$,</span></div>
<div class="line"><a name="l00341"></a><span class="lineno"> 341</span> <span class="comment">which depend on \f$x,y\f$, are precomputed by `preprocess_bed()`.</span></div>
<div class="line"><a name="l00342"></a><span class="lineno"> 342</span> <span class="comment"></span> </div>
<div class="line"><a name="l00343"></a><span class="lineno"> 343</span> <span class="comment">Ghosted values are updated directly and no communication occurs. In fact,</span></div>
<div class="line"><a name="l00344"></a><span class="lineno"> 344</span> <span class="comment">we \e assume `usurf` and `theta` have stencil width at least</span></div>
<div class="line"><a name="l00345"></a><span class="lineno"> 345</span> <span class="comment">equal to GHOSTS. We \e check whether `topgsmooth`, which has stencil width</span></div>
<div class="line"><a name="l00346"></a><span class="lineno"> 346</span> <span class="comment">maxGHOSTS, has at least GHOSTS stencil width, and throw an error if not.</span></div>
<div class="line"><a name="l00347"></a><span class="lineno"> 347</span> <span class="comment"></span> </div>
<div class="line"><a name="l00348"></a><span class="lineno"> 348</span> <span class="comment">Call preprocess_bed() first.</span></div>
<div class="line"><a name="l00349"></a><span class="lineno"> 349</span> <span class="comment"> */</span></div>
<div class="line"><a name="l00350"></a><span class="lineno"><a class="line" href="classpism_1_1stressbalance_1_1BedSmoother_a71b068f8e7b3d3aa7235e6d1bec1f797.html#a71b068f8e7b3d3aa7235e6d1bec1f797"> 350</a></span> <span class="keywordtype">void</span> <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a71b068f8e7b3d3aa7235e6d1bec1f797.html#a71b068f8e7b3d3aa7235e6d1bec1f797">BedSmoother::theta</a>(<span class="keyword">const</span> <a class="code" href="classpism_1_1array_1_1Scalar.html">array::Scalar</a> &usurf, <a class="code" href="classpism_1_1array_1_1Scalar.html">array::Scalar</a> &result)<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00351"></a><span class="lineno"> 351</span>  </div>
<div class="line"><a name="l00352"></a><span class="lineno"> 352</span>  <span class="keywordflow">if</span> ((<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ae0db8dcdf5af87a7feb0bdb472b71227.html#ae0db8dcdf5af87a7feb0bdb472b71227">m_Nx</a> < 0) || (<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a2553d3b7d74feebc688a654cf3cef75e.html#a2553d3b7d74feebc688a654cf3cef75e">m_Ny</a> < 0)) {</div>
<div class="line"><a name="l00353"></a><span class="lineno"> 353</span>  result.<a class="code" href="classpism_1_1array_1_1Array_a9959fcf0124f084e6a2835ed745ce0d1.html#a9959fcf0124f084e6a2835ed745ce0d1">set</a>(1.0);</div>
<div class="line"><a name="l00354"></a><span class="lineno"> 354</span>  <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00355"></a><span class="lineno"> 355</span>  }</div>
<div class="line"><a name="l00356"></a><span class="lineno"> 356</span>  </div>
<div class="line"><a name="l00357"></a><span class="lineno"> 357</span>  <a class="code" href="classpism_1_1array_1_1AccessScope.html">array::AccessScope</a> list{&<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a487e1e99477f270bc123982315713169.html#a487e1e99477f270bc123982315713169">m_C2</a>, &<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ae744391ca2db8b254d3b037da92cbbba.html#ae744391ca2db8b254d3b037da92cbbba">m_C3</a>, &<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a1ed491372b68c6e6e8a50010b112b681.html#a1ed491372b68c6e6e8a50010b112b681">m_C4</a>, &<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a7b2336a229c4cd4b7e0b08edd7c716eb.html#a7b2336a229c4cd4b7e0b08edd7c716eb">m_maxtl</a>, &result, &<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a4c86442bfdbbc2a4ba9e2f20407c4b55.html#a4c86442bfdbbc2a4ba9e2f20407c4b55">m_topgsmooth</a>, &usurf};</div>
<div class="line"><a name="l00358"></a><span class="lineno"> 358</span>  </div>
<div class="line"><a name="l00359"></a><span class="lineno"> 359</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> GHOSTS = result.<a class="code" href="classpism_1_1array_1_1Array_ade892a3412dcdc9f21129c2aed50e84d.html#ade892a3412dcdc9f21129c2aed50e84d">stencil_width</a>();</div>
<div class="line"><a name="l00360"></a><span class="lineno"> 360</span>  assert(<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a487e1e99477f270bc123982315713169.html#a487e1e99477f270bc123982315713169">m_C2</a>.<a class="code" href="classpism_1_1array_1_1Array_ade892a3412dcdc9f21129c2aed50e84d.html#ade892a3412dcdc9f21129c2aed50e84d">stencil_width</a>() >= GHOSTS);</div>
<div class="line"><a name="l00361"></a><span class="lineno"> 361</span>  assert(<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ae744391ca2db8b254d3b037da92cbbba.html#ae744391ca2db8b254d3b037da92cbbba">m_C3</a>.<a class="code" href="classpism_1_1array_1_1Array_ade892a3412dcdc9f21129c2aed50e84d.html#ade892a3412dcdc9f21129c2aed50e84d">stencil_width</a>() >= GHOSTS);</div>
<div class="line"><a name="l00362"></a><span class="lineno"> 362</span>  assert(<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a1ed491372b68c6e6e8a50010b112b681.html#a1ed491372b68c6e6e8a50010b112b681">m_C4</a>.<a class="code" href="classpism_1_1array_1_1Array_ade892a3412dcdc9f21129c2aed50e84d.html#ade892a3412dcdc9f21129c2aed50e84d">stencil_width</a>() >= GHOSTS);</div>
<div class="line"><a name="l00363"></a><span class="lineno"> 363</span>  assert(<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a7b2336a229c4cd4b7e0b08edd7c716eb.html#a7b2336a229c4cd4b7e0b08edd7c716eb">m_maxtl</a>.<a class="code" href="classpism_1_1array_1_1Array_ade892a3412dcdc9f21129c2aed50e84d.html#ade892a3412dcdc9f21129c2aed50e84d">stencil_width</a>() >= GHOSTS);</div>
<div class="line"><a name="l00364"></a><span class="lineno"> 364</span>  assert(<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a4c86442bfdbbc2a4ba9e2f20407c4b55.html#a4c86442bfdbbc2a4ba9e2f20407c4b55">m_topgsmooth</a>.<a class="code" href="classpism_1_1array_1_1Array_ade892a3412dcdc9f21129c2aed50e84d.html#ade892a3412dcdc9f21129c2aed50e84d">stencil_width</a>() >= GHOSTS);</div>
<div class="line"><a name="l00365"></a><span class="lineno"> 365</span>  assert(usurf.<a class="code" href="classpism_1_1array_1_1Array_ade892a3412dcdc9f21129c2aed50e84d.html#ade892a3412dcdc9f21129c2aed50e84d">stencil_width</a>() >= GHOSTS);</div>
<div class="line"><a name="l00366"></a><span class="lineno"> 366</span>  </div>
<div class="line"><a name="l00367"></a><span class="lineno"> 367</span>  <span class="keyword">const</span> <span class="keywordtype">double</span></div>
<div class="line"><a name="l00368"></a><span class="lineno"> 368</span>  theta_min = <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_aa72b3eb0e614bc7111e99f39e66d0187.html#aa72b3eb0e614bc7111e99f39e66d0187">m_config</a>->get_number(<span class="stringliteral">"stress_balance.sia.bed_smoother.theta_min"</span>),</div>
<div class="line"><a name="l00369"></a><span class="lineno"> 369</span>  theta_max = 1.0;</div>
<div class="line"><a name="l00370"></a><span class="lineno"> 370</span>  </div>
<div class="line"><a name="l00371"></a><span class="lineno"> 371</span>  <a class="code" href="classpism_1_1ParallelSection.html">ParallelSection</a> loop(<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ad95e0c783c9d8318bb7eecf09284d1eb.html#ad95e0c783c9d8318bb7eecf09284d1eb">m_grid</a>->com);</div>
<div class="line"><a name="l00372"></a><span class="lineno"> 372</span>  <span class="keywordflow">try</span> {</div>
<div class="line"><a name="l00373"></a><span class="lineno"> 373</span>  <span class="keywordflow">for</span> (<span class="keyword">auto</span> p = <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ad95e0c783c9d8318bb7eecf09284d1eb.html#ad95e0c783c9d8318bb7eecf09284d1eb">m_grid</a>->points(GHOSTS); p; p.next()) {</div>
<div class="line"><a name="l00374"></a><span class="lineno"> 374</span>  <span class="keyword">const</span> <span class="keywordtype">int</span> i = p.i(), j = p.j();</div>
<div class="line"><a name="l00375"></a><span class="lineno"> 375</span>  </div>
<div class="line"><a name="l00376"></a><span class="lineno"> 376</span>  <span class="keyword">const</span> <span class="keywordtype">double</span> H = usurf(i, j) - <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a4c86442bfdbbc2a4ba9e2f20407c4b55.html#a4c86442bfdbbc2a4ba9e2f20407c4b55">m_topgsmooth</a>(i, j);</div>
<div class="line"><a name="l00377"></a><span class="lineno"> 377</span>  <span class="keywordflow">if</span> (H > <a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a7b2336a229c4cd4b7e0b08edd7c716eb.html#a7b2336a229c4cd4b7e0b08edd7c716eb">m_maxtl</a>(i, j)) {</div>
<div class="line"><a name="l00378"></a><span class="lineno"> 378</span>  <span class="comment">// thickness exceeds maximum variation in patch of local topography,</span></div>
<div class="line"><a name="l00379"></a><span class="lineno"> 379</span>  <span class="comment">// so ice buries local topography; note maxtl >= 0 always</span></div>
<div class="line"><a name="l00380"></a><span class="lineno"> 380</span>  <span class="keyword">const</span> <span class="keywordtype">double</span> Hinv = 1.0 / <a class="code" href="namespacepism_1_1array_a8957d08741c6f48d1e554ac7ea98530a.html#a8957d08741c6f48d1e554ac7ea98530a">std::max</a>(H, 1.0);</div>
<div class="line"><a name="l00381"></a><span class="lineno"> 381</span>  <span class="keywordtype">double</span> omega = 1.0 + Hinv*Hinv * (<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a487e1e99477f270bc123982315713169.html#a487e1e99477f270bc123982315713169">m_C2</a>(i, j) + Hinv * (<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_ae744391ca2db8b254d3b037da92cbbba.html#ae744391ca2db8b254d3b037da92cbbba">m_C3</a>(i, j) + Hinv*<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a1ed491372b68c6e6e8a50010b112b681.html#a1ed491372b68c6e6e8a50010b112b681">m_C4</a>(i, j)));</div>
<div class="line"><a name="l00382"></a><span class="lineno"> 382</span>  <span class="keywordflow">if</span> (omega <= 0) { <span class="comment">// this check *should not* be necessary: p4(s) > 0</span></div>
<div class="line"><a name="l00383"></a><span class="lineno"> 383</span>  <span class="keywordflow">throw</span> <a class="code" href="classpism_1_1RuntimeError_ad0ed5f05a9a4e3e403a1d62f8d1e4e7d.html#ad0ed5f05a9a4e3e403a1d62f8d1e4e7d">RuntimeError::formatted</a>(<a class="code" href="error__handling_8hh_aa0c260bffe8a4dbd77d48e8feee7c526.html#aa0c260bffe8a4dbd77d48e8feee7c526">PISM_ERROR_LOCATION</a>,</div>
<div class="line"><a name="l00384"></a><span class="lineno"> 384</span>  <span class="stringliteral">"omega is negative for i=%d, j=%d\n"</span></div>
<div class="line"><a name="l00385"></a><span class="lineno"> 385</span>  <span class="stringliteral">"in BedSmoother.theta()"</span>, i, j);</div>
<div class="line"><a name="l00386"></a><span class="lineno"> 386</span>  }</div>
<div class="line"><a name="l00387"></a><span class="lineno"> 387</span>  </div>
<div class="line"><a name="l00388"></a><span class="lineno"> 388</span>  <span class="keywordflow">if</span> (omega < 0.001) { <span class="comment">// this check *should not* be necessary</span></div>
<div class="line"><a name="l00389"></a><span class="lineno"> 389</span>  omega = 0.001;</div>
<div class="line"><a name="l00390"></a><span class="lineno"> 390</span>  }</div>
<div class="line"><a name="l00391"></a><span class="lineno"> 391</span>  </div>
<div class="line"><a name="l00392"></a><span class="lineno"> 392</span>  result(i, j) = pow(omega, -<a class="code" href="classpism_1_1stressbalance_1_1BedSmoother_a01b79ef0eb383f13aa8b62bb590d38c0.html#a01b79ef0eb383f13aa8b62bb590d38c0">m_Glen_exponent</a>);</div>
<div class="line"><a name="l00393"></a><span class="lineno"> 393</span>  } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00394"></a><span class="lineno"> 394</span>  result(i, j) = 0.00;</div>
<div class="line"><a name="l00395"></a><span class="lineno"> 395</span>  }</div>
<div class="line"><a name="l00396"></a><span class="lineno"> 396</span>  </div>
<div class="line"><a name="l00397"></a><span class="lineno"> 397</span>  result(i, j) = <a class="code" href="namespacepism_a5a692829dff892f92260e9120adaf2f6.html#a5a692829dff892f92260e9120adaf2f6">clip</a>(result(i, j), theta_min, theta_max);</div>
<div class="line"><a name="l00398"></a><span class="lineno"> 398</span>  }</div>
<div class="line"><a name="l00399"></a><span class="lineno"> 399</span>  } <span class="keywordflow">catch</span> (...) {</div>
<div class="line"><a name="l00400"></a><span class="lineno"> 400</span>  loop.<a class="code" href="classpism_1_1ParallelSection_a6b0a6e5e64970af7eadabfebe2b20bd2.html#a6b0a6e5e64970af7eadabfebe2b20bd2">failed</a>();</div>
<div class="line"><a name="l00401"></a><span class="lineno"> 401</span>  }</div>
<div class="line"><a name="l00402"></a><span class="lineno"> 402</span>  loop.<a class="code" href="classpism_1_1ParallelSection_ac23296abee1cbcb3c3fd68c7f5ce0835.html#ac23296abee1cbcb3c3fd68c7f5ce0835">check</a>();</div>
<div class="line"><a name="l00403"></a><span class="lineno"> 403</span> }</div>
<div class="line"><a name="l00404"></a><span class="lineno"> 404</span>  </div>
<div class="line"><a name="l00405"></a><span class="lineno"> 405</span>  </div>
<div class="line"><a name="l00406"></a><span class="lineno"> 406</span> } <span class="comment">// end of namespace stressbalance</span></div>
<div class="line"><a name="l00407"></a><span class="lineno"> 407</span> } <span class="comment">// end of namespace pism</span></div>
<div class="ttc" id="aclasspism_1_1Logger_a72a51137de46115eb228a8bbc12a2a8a_html_a72a51137de46115eb228a8bbc12a2a8a"><div class="ttname"><a href="classpism_1_1Logger_a72a51137de46115eb228a8bbc12a2a8a.html#a72a51137de46115eb228a8bbc12a2a8a">pism::Logger::message</a></div><div class="ttdeci">void message(int threshold, const char format[],...) const __attribute__((format(printf</div><div class="ttdoc">Print a message to the log.</div><div class="ttdef"><b>Definition:</b> <a href="Logger_8cc_source.html#l00049">Logger.cc:49</a></div></div>
<div class="ttc" id="aclasspism_1_1Logger_html"><div class="ttname"><a href="classpism_1_1Logger.html">pism::Logger</a></div><div class="ttdoc">A basic logging class.</div><div class="ttdef"><b>Definition:</b> <a href="Logger_8hh_source.html#l00040">Logger.hh:40</a></div></div>
<div class="ttc" id="aclasspism_1_1ParallelSection_a6b0a6e5e64970af7eadabfebe2b20bd2_html_a6b0a6e5e64970af7eadabfebe2b20bd2"><div class="ttname"><a href="classpism_1_1ParallelSection_a6b0a6e5e64970af7eadabfebe2b20bd2.html#a6b0a6e5e64970af7eadabfebe2b20bd2">pism::ParallelSection::failed</a></div><div class="ttdeci">void failed()</div><div class="ttdoc">Indicates a failure of a parallel section.</div><div class="ttdef"><b>Definition:</b> <a href="error__handling_8cc_source.html#l00185">error_handling.cc:185</a></div></div>
<div class="ttc" id="aclasspism_1_1ParallelSection_ac23296abee1cbcb3c3fd68c7f5ce0835_html_ac23296abee1cbcb3c3fd68c7f5ce0835"><div class="ttname"><a href="classpism_1_1ParallelSection_ac23296abee1cbcb3c3fd68c7f5ce0835.html#ac23296abee1cbcb3c3fd68c7f5ce0835">pism::ParallelSection::check</a></div><div class="ttdeci">void check()</div><div class="ttdef"><b>Definition:</b> <a href="error__handling_8cc_source.html#l00201">error_handling.cc:201</a></div></div>
<div class="ttc" id="aclasspism_1_1ParallelSection_html"><div class="ttname"><a href="classpism_1_1ParallelSection.html">pism::ParallelSection</a></div><div class="ttdef"><b>Definition:</b> <a href="error__handling_8hh_source.html#l00069">error_handling.hh:69</a></div></div>
<div class="ttc" id="aclasspism_1_1RuntimeError_ad0ed5f05a9a4e3e403a1d62f8d1e4e7d_html_ad0ed5f05a9a4e3e403a1d62f8d1e4e7d"><div class="ttname"><a href="classpism_1_1RuntimeError_ad0ed5f05a9a4e3e403a1d62f8d1e4e7d.html#ad0ed5f05a9a4e3e403a1d62f8d1e4e7d">pism::RuntimeError::formatted</a></div><div class="ttdeci">static RuntimeError formatted(const ErrorLocation &location, const char format[],...) __attribute__((format(printf</div><div class="ttdoc">build a RuntimeError with a formatted message</div><div class="ttdef"><b>Definition:</b> <a href="error__handling_8cc_source.html#l00047">error_handling.cc:47</a></div></div>
<div class="ttc" id="aclasspism_1_1RuntimeError_html"><div class="ttname"><a href="classpism_1_1RuntimeError.html">pism::RuntimeError</a></div><div class="ttdef"><b>Definition:</b> <a href="error__handling_8hh_source.html#l00046">error_handling.hh:46</a></div></div>
<div class="ttc" id="aclasspism_1_1VariableMetadata_a5e378cf7077ab00a808ef446a79dc34d_html_a5e378cf7077ab00a808ef446a79dc34d"><div class="ttname"><a href="classpism_1_1VariableMetadata_a5e378cf7077ab00a808ef446a79dc34d.html#a5e378cf7077ab00a808ef446a79dc34d">pism::VariableMetadata::long_name</a></div><div class="ttdeci">VariableMetadata & long_name(const std::string &input)</div><div class="ttdef"><b>Definition:</b> <a href="VariableMetadata_8hh_source.html#l00115">VariableMetadata.hh:115</a></div></div>
<div class="ttc" id="aclasspism_1_1VariableMetadata_ae73185be0693a8607b8e0f74558e11e4_html_ae73185be0693a8607b8e0f74558e11e4"><div class="ttname"><a href="classpism_1_1VariableMetadata_ae73185be0693a8607b8e0f74558e11e4.html#ae73185be0693a8607b8e0f74558e11e4">pism::VariableMetadata::units</a></div><div class="ttdeci">VariableMetadata & units(const std::string &input)</div><div class="ttdef"><b>Definition:</b> <a href="VariableMetadata_8hh_source.html#l00123">VariableMetadata.hh:123</a></div></div>
<div class="ttc" id="aclasspism_1_1array_1_1AccessScope_html"><div class="ttname"><a href="classpism_1_1array_1_1AccessScope.html">pism::array::AccessScope</a></div><div class="ttdoc">Makes sure that we call begin_access() and end_access() for all accessed array::Arrays.</div><div class="ttdef"><b>Definition:</b> <a href="Array_8hh_source.html#l00065">Array.hh:65</a></div></div>
<div class="ttc" id="aclasspism_1_1array_1_1Array2D_a7b9a0d8a83d5379f1debdcefce0fffae_html_a7b9a0d8a83d5379f1debdcefce0fffae"><div class="ttname"><a href="classpism_1_1array_1_1Array2D_a7b9a0d8a83d5379f1debdcefce0fffae.html#a7b9a0d8a83d5379f1debdcefce0fffae">pism::array::Array2D::copy_from</a></div><div class="ttdeci">void copy_from(const Array2D< T > &source)</div><div class="ttdef"><b>Definition:</b> <a href="Array2D_8hh_source.html#l00073">Array2D.hh:73</a></div></div>
<div class="ttc" id="aclasspism_1_1array_1_1Array_a4b0a2833f2ca67c37228e037d1821ccf_html_a4b0a2833f2ca67c37228e037d1821ccf"><div class="ttname"><a href="classpism_1_1array_1_1Array_a4b0a2833f2ca67c37228e037d1821ccf.html#a4b0a2833f2ca67c37228e037d1821ccf">pism::array::Array::get_from_proc0</a></div><div class="ttdeci">void get_from_proc0(petsc::Vec &onp0)</div><div class="ttdoc">Gets a local Array2 from processor 0.</div><div class="ttdef"><b>Definition:</b> <a href="Array_8cc_source.html#l01095">Array.cc:1095</a></div></div>
<div class="ttc" id="aclasspism_1_1array_1_1Array_a9959fcf0124f084e6a2835ed745ce0d1_html_a9959fcf0124f084e6a2835ed745ce0d1"><div class="ttname"><a href="classpism_1_1array_1_1Array_a9959fcf0124f084e6a2835ed745ce0d1.html#a9959fcf0124f084e6a2835ed745ce0d1">pism::array::Array::set</a></div><div class="ttdeci">void set(double c)</div><div class="ttdoc">Result: v[j] <- c for all j.</div><div class="ttdef"><b>Definition:</b> <a href="Array_8cc_source.html#l00707">Array.cc:707</a></div></div>
<div class="ttc" id="aclasspism_1_1array_1_1Array_ab03888a9f5e399025704ae789738bba2_html_ab03888a9f5e399025704ae789738bba2"><div class="ttname"><a href="classpism_1_1array_1_1Array_ab03888a9f5e399025704ae789738bba2.html#ab03888a9f5e399025704ae789738bba2">pism::array::Array::allocate_proc0_copy</a></div><div class="ttdeci">std::shared_ptr< petsc::Vec > allocate_proc0_copy() const</div><div class="ttdef"><b>Definition:</b> <a href="Array_8cc_source.html#l00963">Array.cc:963</a></div></div>
<div class="ttc" id="aclasspism_1_1array_1_1Array_ab56dc4d6cf0f9660ce580bbf4f3585d9_html_ab56dc4d6cf0f9660ce580bbf4f3585d9"><div class="ttname"><a href="classpism_1_1array_1_1Array_ab56dc4d6cf0f9660ce580bbf4f3585d9.html#ab56dc4d6cf0f9660ce580bbf4f3585d9">pism::array::Array::put_on_proc0</a></div><div class="ttdeci">void put_on_proc0(petsc::Vec &onp0) const</div><div class="ttdoc">Puts a local array::Scalar on processor 0.</div><div class="ttdef"><b>Definition:</b> <a href="Array_8cc_source.html#l01052">Array.cc:1052</a></div></div>
<div class="ttc" id="aclasspism_1_1array_1_1Array_ade892a3412dcdc9f21129c2aed50e84d_html_ade892a3412dcdc9f21129c2aed50e84d"><div class="ttname"><a href="classpism_1_1array_1_1Array_ade892a3412dcdc9f21129c2aed50e84d.html#ade892a3412dcdc9f21129c2aed50e84d">pism::array::Array::stencil_width</a></div><div class="ttdeci">unsigned int stencil_width() const</div><div class="ttdoc">Get the stencil width of the current Array. Returns 0 if ghosts are not available.</div><div class="ttdef"><b>Definition:</b> <a href="Array_8cc_source.html#l00331">Array.cc:331</a></div></div>
<div class="ttc" id="aclasspism_1_1array_1_1Array_af9eece42153cd03bfc8ba237ae5310c4_html_af9eece42153cd03bfc8ba237ae5310c4"><div class="ttname"><a href="classpism_1_1array_1_1Array_af9eece42153cd03bfc8ba237ae5310c4.html#af9eece42153cd03bfc8ba237ae5310c4">pism::array::Array::metadata</a></div><div class="ttdeci">SpatialVariableMetadata & metadata(unsigned int N=0)</div><div class="ttdoc">Returns a reference to the SpatialVariableMetadata object containing metadata for the compoment N.</div><div class="ttdef"><b>Definition:</b> <a href="Array_8cc_source.html#l00553">Array.cc:553</a></div></div>
<div class="ttc" id="aclasspism_1_1array_1_1CellType2_html"><div class="ttname"><a href="classpism_1_1array_1_1CellType2.html">pism::array::CellType2</a></div><div class="ttdef"><b>Definition:</b> <a href="CellType_8hh_source.html#l00117">CellType.hh:117</a></div></div>
<div class="ttc" id="aclasspism_1_1array_1_1CellType_ada641b8ad181dfc6efd1a50d2a361edd_html_ada641b8ad181dfc6efd1a50d2a361edd"><div class="ttname"><a href="classpism_1_1array_1_1CellType_ada641b8ad181dfc6efd1a50d2a361edd.html#ada641b8ad181dfc6efd1a50d2a361edd">pism::array::CellType::grounded</a></div><div class="ttdeci">bool grounded(int i, int j) const</div><div class="ttdef"><b>Definition:</b> <a href="CellType_8hh_source.html#l00038">CellType.hh:38</a></div></div>
<div class="ttc" id="aclasspism_1_1array_1_1Scalar_html"><div class="ttname"><a href="classpism_1_1array_1_1Scalar.html">pism::array::Scalar</a></div><div class="ttdef"><b>Definition:</b> <a href="Scalar_8hh_source.html#l00031">Scalar.hh:31</a></div></div>
<div class="ttc" id="aclasspism_1_1petsc_1_1VecArray2D_html"><div class="ttname"><a href="classpism_1_1petsc_1_1VecArray2D.html">pism::petsc::VecArray2D</a></div><div class="ttdoc">Wrapper around VecGetArray2d and VecRestoreArray2d.</div><div class="ttdef"><b>Definition:</b> <a href="Vec_8hh_source.html#l00055">Vec.hh:55</a></div></div>
<div class="ttc" id="aclasspism_1_1stressbalance_1_1BedSmoother_a01b79ef0eb383f13aa8b62bb590d38c0_html_a01b79ef0eb383f13aa8b62bb590d38c0"><div class="ttname"><a href="classpism_1_1stressbalance_1_1BedSmoother_a01b79ef0eb383f13aa8b62bb590d38c0.html#a01b79ef0eb383f13aa8b62bb590d38c0">pism::stressbalance::BedSmoother::m_Glen_exponent</a></div><div class="ttdeci">double m_Glen_exponent</div><div class="ttdef"><b>Definition:</b> <a href="BedSmoother_8hh_source.html#l00114">BedSmoother.hh:114</a></div></div>
<div class="ttc" id="aclasspism_1_1stressbalance_1_1BedSmoother_a02fb4d8d2e000f58a4eabcc1d0bf1ccb_html_a02fb4d8d2e000f58a4eabcc1d0bf1ccb"><div class="ttname"><a href="classpism_1_1stressbalance_1_1BedSmoother_a02fb4d8d2e000f58a4eabcc1d0bf1ccb.html#a02fb4d8d2e000f58a4eabcc1d0bf1ccb">pism::stressbalance::BedSmoother::m_C3p0</a></div><div class="ttdeci">std::shared_ptr< petsc::Vec > m_C3p0</div><div class="ttdef"><b>Definition:</b> <a href="BedSmoother_8hh_source.html#l00121">BedSmoother.hh:121</a></div></div>
<div class="ttc" id="aclasspism_1_1stressbalance_1_1BedSmoother_a1da9b441304f82bf6fc8fb7c70c6a7a8_html_a1da9b441304f82bf6fc8fb7c70c6a7a8"><div class="ttname"><a href="classpism_1_1stressbalance_1_1BedSmoother_a1da9b441304f82bf6fc8fb7c70c6a7a8.html#a1da9b441304f82bf6fc8fb7c70c6a7a8">pism::stressbalance::BedSmoother::m_smoothing_range</a></div><div class="ttdeci">double m_smoothing_range</div><div class="ttdef"><b>Definition:</b> <a href="BedSmoother_8hh_source.html#l00114">BedSmoother.hh:114</a></div></div>
<div class="ttc" id="aclasspism_1_1stressbalance_1_1BedSmoother_a1ed491372b68c6e6e8a50010b112b681_html_a1ed491372b68c6e6e8a50010b112b681"><div class="ttname"><a href="classpism_1_1stressbalance_1_1BedSmoother_a1ed491372b68c6e6e8a50010b112b681.html#a1ed491372b68c6e6e8a50010b112b681">pism::stressbalance::BedSmoother::m_C4</a></div><div class="ttdeci">array::Scalar2 m_C4</div><div class="ttdef"><b>Definition:</b> <a href="BedSmoother_8hh_source.html#l00107">BedSmoother.hh:107</a></div></div>
<div class="ttc" id="aclasspism_1_1stressbalance_1_1BedSmoother_a2553d3b7d74feebc688a654cf3cef75e_html_a2553d3b7d74feebc688a654cf3cef75e"><div class="ttname"><a href="classpism_1_1stressbalance_1_1BedSmoother_a2553d3b7d74feebc688a654cf3cef75e.html#a2553d3b7d74feebc688a654cf3cef75e">pism::stressbalance::BedSmoother::m_Ny</a></div><div class="ttdeci">int m_Ny</div><div class="ttdef"><b>Definition:</b> <a href="BedSmoother_8hh_source.html#l00112">BedSmoother.hh:112</a></div></div>
<div class="ttc" id="aclasspism_1_1stressbalance_1_1BedSmoother_a32338d245c30dd4f2a3bb5218f59e3bc_html_a32338d245c30dd4f2a3bb5218f59e3bc"><div class="ttname"><a href="classpism_1_1stressbalance_1_1BedSmoother_a32338d245c30dd4f2a3bb5218f59e3bc.html#a32338d245c30dd4f2a3bb5218f59e3bc">pism::stressbalance::BedSmoother::BedSmoother</a></div><div class="ttdeci">BedSmoother(std::shared_ptr< const Grid > g)</div><div class="ttdef"><b>Definition:</b> <a href="BedSmoother_8cc_source.html#l00034">BedSmoother.cc:34</a></div></div>
<div class="ttc" id="aclasspism_1_1stressbalance_1_1BedSmoother_a38b304465661b70e7d2faa4b49aff5eb_html_a38b304465661b70e7d2faa4b49aff5eb"><div class="ttname"><a href="classpism_1_1stressbalance_1_1BedSmoother_a38b304465661b70e7d2faa4b49aff5eb.html#a38b304465661b70e7d2faa4b49aff5eb">pism::stressbalance::BedSmoother::smoothed_thk</a></div><div class="ttdeci">void smoothed_thk(const array::Scalar &usurf, const array::Scalar &thk, const array::CellType2 &mask, array::Scalar &thksmooth) const</div><div class="ttdoc">Computes a smoothed thickness map.</div><div class="ttdef"><b>Definition:</b> <a href="BedSmoother_8cc_source.html#l00282">BedSmoother.cc:282</a></div></div>
<div class="ttc" id="aclasspism_1_1stressbalance_1_1BedSmoother_a43d6ca6da2f6513d1a5115d6b5de8332_html_a43d6ca6da2f6513d1a5115d6b5de8332"><div class="ttname"><a href="classpism_1_1stressbalance_1_1BedSmoother_a43d6ca6da2f6513d1a5115d6b5de8332.html#a43d6ca6da2f6513d1a5115d6b5de8332">pism::stressbalance::BedSmoother::m_topgp0</a></div><div class="ttdeci">std::shared_ptr< petsc::Vec > m_topgp0</div><div class="ttdoc">original bed elevation on processor 0</div><div class="ttdef"><b>Definition:</b> <a href="BedSmoother_8hh_source.html#l00117">BedSmoother.hh:117</a></div></div>
<div class="ttc" id="aclasspism_1_1stressbalance_1_1BedSmoother_a487e1e99477f270bc123982315713169_html_a487e1e99477f270bc123982315713169"><div class="ttname"><a href="classpism_1_1stressbalance_1_1BedSmoother_a487e1e99477f270bc123982315713169.html#a487e1e99477f270bc123982315713169">pism::stressbalance::BedSmoother::m_C2</a></div><div class="ttdeci">array::Scalar2 m_C2</div><div class="ttdef"><b>Definition:</b> <a href="BedSmoother_8hh_source.html#l00107">BedSmoother.hh:107</a></div></div>
<div class="ttc" id="aclasspism_1_1stressbalance_1_1BedSmoother_a4c86442bfdbbc2a4ba9e2f20407c4b55_html_a4c86442bfdbbc2a4ba9e2f20407c4b55"><div class="ttname"><a href="classpism_1_1stressbalance_1_1BedSmoother_a4c86442bfdbbc2a4ba9e2f20407c4b55.html#a4c86442bfdbbc2a4ba9e2f20407c4b55">pism::stressbalance::BedSmoother::m_topgsmooth</a></div><div class="ttdeci">array::Scalar2 m_topgsmooth</div><div class="ttdoc">smoothed bed elevation; set by calling preprocess_bed()</div><div class="ttdef"><b>Definition:</b> <a href="BedSmoother_8hh_source.html#l00105">BedSmoother.hh:105</a></div></div>
<div class="ttc" id="aclasspism_1_1stressbalance_1_1BedSmoother_a4f727584546e4cef224c33484d1e41e2_html_a4f727584546e4cef224c33484d1e41e2"><div class="ttname"><a href="classpism_1_1stressbalance_1_1BedSmoother_a4f727584546e4cef224c33484d1e41e2.html#a4f727584546e4cef224c33484d1e41e2">pism::stressbalance::BedSmoother::m_maxtlp0</a></div><div class="ttdeci">std::shared_ptr< petsc::Vec > m_maxtlp0</div><div class="ttdoc">maximum elevation at (i,j) of local topography (nearby patch)</div><div class="ttdef"><b>Definition:</b> <a href="BedSmoother_8hh_source.html#l00121">BedSmoother.hh:121</a></div></div>
<div class="ttc" id="aclasspism_1_1stressbalance_1_1BedSmoother_a58ff28fd406efac160671b5067fcf2e1_html_a58ff28fd406efac160671b5067fcf2e1"><div class="ttname"><a href="classpism_1_1stressbalance_1_1BedSmoother_a58ff28fd406efac160671b5067fcf2e1.html#a58ff28fd406efac160671b5067fcf2e1">pism::stressbalance::BedSmoother::smooth_the_bed_on_proc0</a></div><div class="ttdeci">void smooth_the_bed_on_proc0()</div><div class="ttdoc">Computes the smoothed bed by a simple average over a rectangle of grid points.</div><div class="ttdef"><b>Definition:</b> <a href="BedSmoother_8cc_source.html#l00155">BedSmoother.cc:155</a></div></div>
<div class="ttc" id="aclasspism_1_1stressbalance_1_1BedSmoother_a706c3a4805bc78586d0e0d8e4973b7bb_html_a706c3a4805bc78586d0e0d8e4973b7bb"><div class="ttname"><a href="classpism_1_1stressbalance_1_1BedSmoother_a706c3a4805bc78586d0e0d8e4973b7bb.html#a706c3a4805bc78586d0e0d8e4973b7bb">pism::stressbalance::BedSmoother::smoothed_bed</a></div><div class="ttdeci">const array::Scalar & smoothed_bed() const</div><div class="ttdef"><b>Definition:</b> <a href="BedSmoother_8cc_source.html#l00122">BedSmoother.cc:122</a></div></div>
<div class="ttc" id="aclasspism_1_1stressbalance_1_1BedSmoother_a71b068f8e7b3d3aa7235e6d1bec1f797_html_a71b068f8e7b3d3aa7235e6d1bec1f797"><div class="ttname"><a href="classpism_1_1stressbalance_1_1BedSmoother_a71b068f8e7b3d3aa7235e6d1bec1f797.html#a71b068f8e7b3d3aa7235e6d1bec1f797">pism::stressbalance::BedSmoother::theta</a></div><div class="ttdeci">void theta(const array::Scalar &usurf, array::Scalar &result) const</div><div class="ttdef"><b>Definition:</b> <a href="BedSmoother_8cc_source.html#l00350">BedSmoother.cc:350</a></div></div>
<div class="ttc" id="aclasspism_1_1stressbalance_1_1BedSmoother_a7b2336a229c4cd4b7e0b08edd7c716eb_html_a7b2336a229c4cd4b7e0b08edd7c716eb"><div class="ttname"><a href="classpism_1_1stressbalance_1_1BedSmoother_a7b2336a229c4cd4b7e0b08edd7c716eb.html#a7b2336a229c4cd4b7e0b08edd7c716eb">pism::stressbalance::BedSmoother::m_maxtl</a></div><div class="ttdeci">array::Scalar2 m_maxtl</div><div class="ttdef"><b>Definition:</b> <a href="BedSmoother_8hh_source.html#l00107">BedSmoother.hh:107</a></div></div>
<div class="ttc" id="aclasspism_1_1stressbalance_1_1BedSmoother_a84c1adc9a37d8099c419c21d14e045d9_html_a84c1adc9a37d8099c419c21d14e045d9"><div class="ttname"><a href="classpism_1_1stressbalance_1_1BedSmoother_a84c1adc9a37d8099c419c21d14e045d9.html#a84c1adc9a37d8099c419c21d14e045d9">pism::stressbalance::BedSmoother::compute_coefficients_on_proc0</a></div><div class="ttdeci">void compute_coefficients_on_proc0()</div><div class="ttdef"><b>Definition:</b> <a href="BedSmoother_8cc_source.html#l00192">BedSmoother.cc:192</a></div></div>
<div class="ttc" id="aclasspism_1_1stressbalance_1_1BedSmoother_aa72b3eb0e614bc7111e99f39e66d0187_html_aa72b3eb0e614bc7111e99f39e66d0187"><div class="ttname"><a href="classpism_1_1stressbalance_1_1BedSmoother_aa72b3eb0e614bc7111e99f39e66d0187.html#aa72b3eb0e614bc7111e99f39e66d0187">pism::stressbalance::BedSmoother::m_config</a></div><div class="ttdeci">const Config::ConstPtr m_config</div><div class="ttdef"><b>Definition:</b> <a href="BedSmoother_8hh_source.html#l00102">BedSmoother.hh:102</a></div></div>
<div class="ttc" id="aclasspism_1_1stressbalance_1_1BedSmoother_ab1c917c55fc9b6fc0e3265ed1ee71202_html_ab1c917c55fc9b6fc0e3265ed1ee71202"><div class="ttname"><a href="classpism_1_1stressbalance_1_1BedSmoother_ab1c917c55fc9b6fc0e3265ed1ee71202.html#ab1c917c55fc9b6fc0e3265ed1ee71202">pism::stressbalance::BedSmoother::m_topgsmoothp0</a></div><div class="ttdeci">std::shared_ptr< petsc::Vec > m_topgsmoothp0</div><div class="ttdoc">smoothed bed elevation on processor 0</div><div class="ttdef"><b>Definition:</b> <a href="BedSmoother_8hh_source.html#l00119">BedSmoother.hh:119</a></div></div>
<div class="ttc" id="aclasspism_1_1stressbalance_1_1BedSmoother_ad07977b6a5e8b8df9963203bca80553b_html_ad07977b6a5e8b8df9963203bca80553b"><div class="ttname"><a href="classpism_1_1stressbalance_1_1BedSmoother_ad07977b6a5e8b8df9963203bca80553b.html#ad07977b6a5e8b8df9963203bca80553b">pism::stressbalance::BedSmoother::m_C4p0</a></div><div class="ttdeci">std::shared_ptr< petsc::Vec > m_C4p0</div><div class="ttdef"><b>Definition:</b> <a href="BedSmoother_8hh_source.html#l00121">BedSmoother.hh:121</a></div></div>
<div class="ttc" id="aclasspism_1_1stressbalance_1_1BedSmoother_ad95e0c783c9d8318bb7eecf09284d1eb_html_ad95e0c783c9d8318bb7eecf09284d1eb"><div class="ttname"><a href="classpism_1_1stressbalance_1_1BedSmoother_ad95e0c783c9d8318bb7eecf09284d1eb.html#ad95e0c783c9d8318bb7eecf09284d1eb">pism::stressbalance::BedSmoother::m_grid</a></div><div class="ttdeci">std::shared_ptr< const Grid > m_grid</div><div class="ttdef"><b>Definition:</b> <a href="BedSmoother_8hh_source.html#l00101">BedSmoother.hh:101</a></div></div>
<div class="ttc" id="aclasspism_1_1stressbalance_1_1BedSmoother_ae0db8dcdf5af87a7feb0bdb472b71227_html_ae0db8dcdf5af87a7feb0bdb472b71227"><div class="ttname"><a href="classpism_1_1stressbalance_1_1BedSmoother_ae0db8dcdf5af87a7feb0bdb472b71227.html#ae0db8dcdf5af87a7feb0bdb472b71227">pism::stressbalance::BedSmoother::m_Nx</a></div><div class="ttdeci">int m_Nx</div><div class="ttdef"><b>Definition:</b> <a href="BedSmoother_8hh_source.html#l00112">BedSmoother.hh:112</a></div></div>
<div class="ttc" id="aclasspism_1_1stressbalance_1_1BedSmoother_ae13dd0bbf11b712bbef3eeaf93a8f527_html_ae13dd0bbf11b712bbef3eeaf93a8f527"><div class="ttname"><a href="classpism_1_1stressbalance_1_1BedSmoother_ae13dd0bbf11b712bbef3eeaf93a8f527.html#ae13dd0bbf11b712bbef3eeaf93a8f527">pism::stressbalance::BedSmoother::preprocess_bed</a></div><div class="ttdeci">void preprocess_bed(const array::Scalar &topg)</div><div class="ttdef"><b>Definition:</b> <a href="BedSmoother_8cc_source.html#l00097">BedSmoother.cc:97</a></div></div>
<div class="ttc" id="aclasspism_1_1stressbalance_1_1BedSmoother_ae744391ca2db8b254d3b037da92cbbba_html_ae744391ca2db8b254d3b037da92cbbba"><div class="ttname"><a href="classpism_1_1stressbalance_1_1BedSmoother_ae744391ca2db8b254d3b037da92cbbba.html#ae744391ca2db8b254d3b037da92cbbba">pism::stressbalance::BedSmoother::m_C3</a></div><div class="ttdeci">array::Scalar2 m_C3</div><div class="ttdef"><b>Definition:</b> <a href="BedSmoother_8hh_source.html#l00107">BedSmoother.hh:107</a></div></div>
<div class="ttc" id="aclasspism_1_1stressbalance_1_1BedSmoother_af200deb02932da18adb78d12a908346f_html_af200deb02932da18adb78d12a908346f"><div class="ttname"><a href="classpism_1_1stressbalance_1_1BedSmoother_af200deb02932da18adb78d12a908346f.html#af200deb02932da18adb78d12a908346f">pism::stressbalance::BedSmoother::m_C2p0</a></div><div class="ttdeci">std::shared_ptr< petsc::Vec > m_C2p0</div><div class="ttdef"><b>Definition:</b> <a href="BedSmoother_8hh_source.html#l00121">BedSmoother.hh:121</a></div></div>
<div class="ttc" id="aerror__handling_8hh_a970ec877c0e54c6e16c039bfa1b88bad_html_a970ec877c0e54c6e16c039bfa1b88bad"><div class="ttname"><a href="error__handling_8hh_a970ec877c0e54c6e16c039bfa1b88bad.html#a970ec877c0e54c6e16c039bfa1b88bad">PISM_CHK</a></div><div class="ttdeci">#define PISM_CHK(errcode, name)</div><div class="ttdef"><b>Definition:</b> <a href="error__handling_8hh_source.html#l00090">error_handling.hh:90</a></div></div>
<div class="ttc" id="aerror__handling_8hh_aa0c260bffe8a4dbd77d48e8feee7c526_html_aa0c260bffe8a4dbd77d48e8feee7c526"><div class="ttname"><a href="error__handling_8hh_aa0c260bffe8a4dbd77d48e8feee7c526.html#aa0c260bffe8a4dbd77d48e8feee7c526">PISM_ERROR_LOCATION</a></div><div class="ttdeci">#define PISM_ERROR_LOCATION</div><div class="ttdef"><b>Definition:</b> <a href="error__handling_8hh_source.html#l00043">error_handling.hh:43</a></div></div>
<div class="ttc" id="aexactTestL_8cc_a7cd4ebc9eb7d8912281c0f7e47868b80_html_a7cd4ebc9eb7d8912281c0f7e47868b80"><div class="ttname"><a href="exactTestL_8cc_a7cd4ebc9eb7d8912281c0f7e47868b80.html#a7cd4ebc9eb7d8912281c0f7e47868b80">b0</a></div><div class="ttdeci">static const double b0</div><div class="ttdef"><b>Definition:</b> <a href="exactTestL_8cc_source.html#l00041">exactTestL.cc:41</a></div></div>
<div class="ttc" id="aexactTestM_8c_ad5228cd48403ef9d8b632f5c7c124720_html_ad5228cd48403ef9d8b632f5c7c124720"><div class="ttname"><a href="exactTestM_8c_ad5228cd48403ef9d8b632f5c7c124720.html#ad5228cd48403ef9d8b632f5c7c124720">n</a></div><div class="ttdeci">#define n</div><div class="ttdef"><b>Definition:</b> <a href="exactTestM_8c_source.html#l00037">exactTestM.c:37</a></div></div>
<div class="ttc" id="anamespacepism_1_1array_a8957d08741c6f48d1e554ac7ea98530a_html_a8957d08741c6f48d1e554ac7ea98530a"><div class="ttname"><a href="namespacepism_1_1array_a8957d08741c6f48d1e554ac7ea98530a.html#a8957d08741c6f48d1e554ac7ea98530a">pism::array::max</a></div><div class="ttdeci">double max(const array::Scalar &input)</div><div class="ttdoc">Finds maximum over all the values in an array::Scalar object. Ignores ghosts.</div><div class="ttdef"><b>Definition:</b> <a href="Scalar_8cc_source.html#l00165">Scalar.cc:165</a></div></div>
<div class="ttc" id="anamespacepism_1_1array_aa88c3344e3ab8655faabb90fe37e76c6_html_aa88c3344e3ab8655faabb90fe37e76c6"><div class="ttname"><a href="namespacepism_1_1array_aa88c3344e3ab8655faabb90fe37e76c6.html#aa88c3344e3ab8655faabb90fe37e76c6">pism::array::sum</a></div><div class="ttdeci">double sum(const array::Scalar &input)</div><div class="ttdoc">Sums up all the values in an array::Scalar object. Ignores ghosts.</div><div class="ttdef"><b>Definition:</b> <a href="Scalar_8cc_source.html#l00150">Scalar.cc:150</a></div></div>
<div class="ttc" id="anamespacepism_1_1units_aae3f4db8a6a2365e607a699bc61a5077_html_aae3f4db8a6a2365e607a699bc61a5077"><div class="ttname"><a href="namespacepism_1_1units_aae3f4db8a6a2365e607a699bc61a5077.html#aae3f4db8a6a2365e607a699bc61a5077">pism::units::convert</a></div><div class="ttdeci">double convert(System::Ptr system, double input, const std::string &spec1, const std::string &spec2)</div><div class="ttdoc">Convert a quantity from unit1 to unit2.</div><div class="ttdef"><b>Definition:</b> <a href="Units_8cc_source.html#l00070">Units.cc:70</a></div></div>
<div class="ttc" id="anamespacepism_a47d754ed3e959d5866b02a1b78b6a5b5_html_a47d754ed3e959d5866b02a1b78b6a5b5"><div class="ttname"><a href="namespacepism_a47d754ed3e959d5866b02a1b78b6a5b5.html#a47d754ed3e959d5866b02a1b78b6a5b5">pism::g</a></div><div class="ttdeci">static const double g</div><div class="ttdef"><b>Definition:</b> <a href="exactTestP_8cc_source.html#l00036">exactTestP.cc:36</a></div></div>
<div class="ttc" id="anamespacepism_a5a692829dff892f92260e9120adaf2f6_html_a5a692829dff892f92260e9120adaf2f6"><div class="ttname"><a href="namespacepism_a5a692829dff892f92260e9120adaf2f6.html#a5a692829dff892f92260e9120adaf2f6">pism::clip</a></div><div class="ttdeci">T clip(T x, T a, T b)</div><div class="ttdef"><b>Definition:</b> <a href="pism__utilities_8hh_source.html#l00104">pism_utilities.hh:104</a></div></div>
<div class="ttc" id="anamespacepism_a61f495299b26a97b1957dd1ff8333201_html_a61f495299b26a97b1957dd1ff8333201"><div class="ttname"><a href="namespacepism_a61f495299b26a97b1957dd1ff8333201.html#a61f495299b26a97b1957dd1ff8333201">pism::c2</a></div><div class="ttdeci">static const double c2</div><div class="ttdef"><b>Definition:</b> <a href="exactTestP_8cc_source.html#l00045">exactTestP.cc:45</a></div></div>
<div class="ttc" id="anamespacepism_a7343afff8d353b59dbdec563bd896812_html_a7343afff8d353b59dbdec563bd896812"><div class="ttname"><a href="namespacepism_a7343afff8d353b59dbdec563bd896812.html#a7343afff8d353b59dbdec563bd896812">pism::k</a></div><div class="ttdeci">static const double k</div><div class="ttdef"><b>Definition:</b> <a href="exactTestP_8cc_source.html#l00042">exactTestP.cc:42</a></div></div>
<div class="ttc" id="anamespacepism_html"><div class="ttname"><a href="namespacepism.html">pism</a></div><div class="ttdef"><b>Definition:</b> <a href="AgeColumnSystem_8cc_source.html#l00023">AgeColumnSystem.cc:23</a></div></div>
<div class="ttc" id="atest__cube_8c_ad43c3812e6d13e0518d9f8b8f463ffcf_html_ad43c3812e6d13e0518d9f8b8f463ffcf"><div class="ttname"><a href="test__cube_8c_ad43c3812e6d13e0518d9f8b8f463ffcf.html#ad43c3812e6d13e0518d9f8b8f463ffcf">count</a></div><div class="ttdeci">int count</div><div class="ttdef"><b>Definition:</b> <a href="test__cube_8c_source.html#l00016">test_cube.c:16</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>