-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathLSDRasterModel.hpp
More file actions
1761 lines (1486 loc) · 73 KB
/
Copy pathLSDRasterModel.hpp
File metadata and controls
1761 lines (1486 loc) · 73 KB
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
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
///=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
///
/// LSDRasterModel.cpp
/// cpp file for the LSDRasterModel object
/// LSD stands for Land Surface Dynamics
/// This object provides an environment for landscape evolution modelling, which can then
/// be integrated with the topographic analysis tools to efficiently analyse model runs.
///
/// The landscape evolution model uses implicit methods to provide stability with
/// relatively long timesteps. Fluvial erosion is solved following Braun and Willet (2013)
/// using the fastscape algorithm, whilst hillslope sediment transport is modelled as a
/// non-linear diffusive sediment flux, following the implicit scheme developed for
/// MuDDPile.
///
/// The aim is to have two complimentary models:
/// i) a simple coupled hillslope-channel model in which large scale landscape dynamics
/// can be modelled
/// ii) a more complex treatment of hillslopes explicitly incorporating the role of
/// vegetation in driving sediment production and transport, and that copes with the
/// with the transition from soil mantled-bedrock hillslopes at high erosion rates.
///
/// In order to run the model, one needs a parameter file that should be read by the
/// driver function.
///=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
///
/// This object is written by
/// @author Simon M. Mudd, University of Edinburgh
/// @author David T. Milodowski, University of Edinburgh
/// @author Martin D. Hurst, British Geological Survey
/// @author Fiona Clubb, University of Edinburgh
/// @author Stuart Grieve, University of Edinburgh
/// @author James Jenkinson, University of Edinburgh
///
///=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
///
/// Version 0.0.1 24/07/2013
///=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#include <iostream>
#include <fstream>
#include <iomanip>
#include <vector>
#include <string>
#include "TNT/tnt.h"
#include <boost/numeric/mtl/mtl.hpp>
#include <boost/numeric/itl/itl.hpp>
#include "LSDRaster.hpp"
#include "LSDRasterSpectral.hpp"
#include "LSDJunctionNetwork.hpp"
#include "LSDParticleColumn.hpp"
#include "LSDCRNParameters.hpp"
using namespace std;
using namespace TNT;
#ifndef LSDRasterModel_H
#define LSDRasterModel_H
///@brief Create model objects to use LSDRaster methods on synthetic landscapes.
class LSDRasterModel: public LSDRasterSpectral
{
public:
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// @!@!@!@!@!@!@!@!@!@!@!@!@!@!@!@!@
// CONSTRUCTORS AND CREATE FUNCTIONS
// @!@!@!@!@!@!@!@!@!@!@!@!@!@!@!@!@
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
/// @brief Constructor. Create a deafult LSDRasterModel (100x100)
/// @return An instance of LSDRasterModel
LSDRasterModel()
{
create();
}
/// @brief Constructor. Create a LSDRasterModel from a parameter file
/// @return An instance of LSDRasterModel
/// @param master_param A filenam for the master parameter file
LSDRasterModel( string master_param )
{
create(master_param);
}
/// @brief Constructor. Create an LSDRasterModel from a file.
/// Uses a filename and file extension
/// @return LSDRasterModel
/// @param filename A String, the file to be loaded.
/// @param extension A String, the file extension to be loaded.
LSDRasterModel(string filename, string extension)
{
create(filename, extension);
default_parameters();
}
/// @brief Constructor. Create an LSDRasterModel from memory.
/// @return LSDRasterModel
/// @param nrows An integer of the number of rows.
/// @param ncols An integer of the number of columns.
/// @param xmin A float of the minimum X coordinate.
/// @param ymin A float of the minimum Y coordinate.
/// @param cellsize A float of the cellsize.
/// @param ndv An integer of the no data value.
/// @param data An Array2D of floats in the shape nrows*ncols,
///containing the data to be written.
LSDRasterModel(int nrows, int ncols, float xmin, float ymin,
float cellsize, float ndv, Array2D<float> data)
{
default_parameters();
create(nrows, ncols, xmin, ymin, cellsize, ndv, data);
}
/// @brief Constructor. Create an LSDRasterModel from an LSDRaster.
/// @return LSDRasterModel
/// @param An_LSDRaster LSDRaster object.
LSDRasterModel(LSDRaster& An_LSDRaster)
{
create(An_LSDRaster);
default_parameters();
}
/// @brief Constructor. Create a blank raster nodel
/// @return LSDRasterModel
/// @param NCols Height of raster
/// @param NRows Width of raster
LSDRasterModel(int NRows, int NCols);
/// @brief Class destructor
~LSDRasterModel( void );
/// @brief operator assignment
LSDRasterModel& operator=(const LSDRasterModel& LSDR);
/// @brief This just returns the raster model object data as a raster
/// @return A raster with the data from the LSDRasterModel
/// @author SMM
/// @date 01/09/2017
LSDRaster return_as_raster();
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// @~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@
// INITIALISATION ROUTINES
// @~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
/// @brief this initialises the model by directly #ting the data members
void initialize_model(
string& parameter_file, string& run_name, float& dt, float& EndTime, float& PrintInterval,
float& k_w, float& b, float& m, float& n, float& K, float& ErosionThreshold,
float& K_nl, float& S_c, float& UpliftRate, float& PrecipitationRate,
float& NorthBoundaryElevation, float& SouthBoundaryElevation,
Array2D<float>& PrecipitationFlux, Array2D<float>& SlopesBetweenRows,
Array2D<float>& SlopesBetweenColumns, Array2D<float>& ErosionRate);
/// @brief This module initialises the model runs, calling the required function from
/// the initial topography and loads the parameters from the parameter file.
/// @param parameter_file the filename of the paramter file (with extension)
/// @author JAJ
/// @date 01/01/2014
void initialize_model( string parameter_file );
/// @brief This module initialises the model using the maps that have been read
/// in from the parameter file via the param file parser function.
/// @param nowt
/// @author DAV
/// @date 2015-01-17
void initialise_model();
/// @brief this appends a string to the run name
/// @detail can be used to append parameters to run names
/// @author SMM
/// @date 09/04/2015
void append_run_name(string append_name);
/// @brief Adds random noise to each pixel in range [min, max]
/// @param minium random addition
/// @param maximum random addition
/// @author JAJ
/// @date 01/01/2014
void random_surface_noise( float min, float max );
/// @brief Adds random noise to each pixel using the noise data member
/// @author SMM
/// @date 17/06/2014
void random_surface_noise();
/// @brief This resets the RasterData array to have a parabolic shape,
/// with 0 elevation at the N and S boundaries. It also adds some random
/// noise to the topography. The amplitude of this noise is set by the
/// data member 'noise'. The default noise is 1mm.
/// @param peak_elev The peak elevation in metres. Is in the middle of the
/// model domain
/// @param edge_offset an offest from the edge elevation. You can have a little
/// cliff at the edge
/// @author SMM
/// @date 1/7/2014
void initialise_parabolic_surface(float peak_elev, float edge_offset);
/// @brief Adds a parabolic surface to the DEM. Used to try and avoid
/// ;arge areas of fill from the fractal initiation steps
/// @param peak_elev The peak elevation in metres. Is in the middle of the
/// model domain
/// @author SMM
/// @date 11/8/2017
void superimpose_parabolic_surface(float peak_elev);
/// @brief This initialises the raster model to a square model domain
/// with a fractal surface using the algorithm from Saupe (1987d)
/// @param fractal_D Used to determine the fractal dimension, D by:
/// D = 3 - fractal_D. So the fractal dimension should be between
/// 2 and 3.
/// @author DAV
/// @date 20/10/2014
void intialise_fourier_fractal_surface(float fractal_D);
/// @brief This initialises the raster model to a square model domain
/// with a fractal surface using the algorithm from the LSDRasterModel
/// @param beta Used to determine the fractal dimension, beta by:
/// beta = 3 - fractal_beta. So the fractal dimension should be between
/// 2 and 3.
/// @param desired_relief The relief desired from the final surface
/// @author SMM
/// @date 10/08/2017
void intialise_fourier_fractal_surface_v2(float beta, float desired_relief);
/// @brief This initialises the raster model to a fractal surface using the
/// diamond square algorithm
/// @param feature_order is an interger n where the feature size consists of 2^n nodes.
/// If the feature order is set bigger than the dimensions of the parent raster then
/// this will default to the order of the parent raster.
/// @param desired_relief The relief desired from the final surface
/// @author SMM
/// @date 10/08/2017
void intialise_diamond_square_fractal_surface(int feature_order, float desired_relief);
/// @brief This takes a raster and tapers the edges to zero elevation. Its
/// purpose is to remove edge artefacts.
/// @param rows_to_taper The number of rows at the N and S boudaries to taper
/// @author SMM
/// @date 10/08/2017
void initialise_taper_edges_and_raise_raster(int rows_to_taper);
/// @brief this raises the raster so the lowest point is zero and also fills the raster
/// @author SMM
/// @date 25/08/2017
void raise_and_fill_raster();
/// @brief This initialises a surface with a hillslope
/// that is the solution to the nonlinear sediment flux equation.
/// It overwrites RasterData
/// @details The parameters D and S_c are stored as data members
/// Solution from Roering et al., (EPSL, 2007)
/// @param U the uplift rate
/// @author SMM
/// @date 01/07/2014
void initialise_nonlinear_SS(float U);
/// @brief This resizes the LSDRasterModel, resetting some flags in the process,
/// as well as setting many of the Array2D data members to be empty arrays
/// The raster data in the end is a random surface (determined by the noise
/// data member)
/// @param new_rows the new number of rows
/// @param new_cols the new number of columns
/// @author SMM
/// @date 30/06/2014
void resize_and_reset( int new_rows, int new_cols );
/// @brief This resizes the LSDRasterModel, resetting some flags in the process,
/// as well as setting many of the Array2D data members to be empty arrays
/// The raster data in the end is a random surface (determined by the noise
/// data member)
/// This overloaded version also changes the data resolution
/// @param new_rows the new number of rows
/// @param new_cols the new number of columns
/// @param new_resolution the new data resolution
/// @author SMM
/// @date 30/06/2014
void resize_and_reset( int new_rows, int new_cols, float new_resolution );
/// @brief this ads a pathname to the default names
/// @param the name of the path
/// @author SMM
/// @date 18/06/2014
void add_path_to_names( string pathname);
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// @!@!@!@!@!@!@!@!@!@!@!@!@!@!@!@!@
// TOOLS FOR CHECKING STEADY STATE
// @!@!@!@!@!@!@!@!@!@!@!@!@!@!@!@!@
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
/// @brief This function checks to see if the model has achieved steady state.
/// The nature of steady state checked is set by the cycle_steady_check flag
/// If this is false, it checks if there is simple steady state
/// (the surface elevations do not change in time)
/// If the cycle_steady_check is true, it check if steady state has been
/// achieved from one cycle to another
/// @return does not return anything, but instead changes the steady_state flag
/// @author JAJ commented SMM
/// @date 01/01/2014 commented SMM 27/06/2014
void check_steady_state( void );
/// @brief This function checks to see if the model should record results
/// If initial steady state has not been reached, recording is set to
/// false: that is, the model does not record information on the build up
/// to steady state.
/// @author JAJ
/// @date 01/01/2014
void check_recording( void );
/// @brief This checks on the ending condition of the model run
/// endTime_mode:
/// 1 == The end time is just some fixed time after initial steady state
/// 2 == The end time is after a fixed number of cycles
/// 3 == The time is after steady state, but waits for a fixed number of cycles
/// before ending
/// @return returns a boolean that is true if the end time has been reached
/// and false if end time has not been reached
/// @author JAJ, comments SMM
/// @date 01/01/2014 comments SMM 27/06/2014
bool check_end_condition( void );
/// @brief This function checks to see if this is a periodic run. If it is,
/// it sets the times to align with the period
/// Note this only realy comes into play if period mode == 2 or 4
/// period_mode means
/// 1 (default) one periodicity used without
/// 2 Two periodicities that switch at a given interval
/// 3 Two periodicities used as a compound sin wave
/// 4 Same as three, but weightings switch at a given interval (as in 2)
/// @author JAJ
/// @date 01/012014
void check_periodicity_switch( void );
/// @brief If the periodic model cycles over 100 times this returns true
/// @author JAJ
bool check_if_hung( void );
/// @brief Reset model - reset erosion values to 0 after a complete model run
/// @author JAJ
/// @date 01/01/2014
void reset_model( void );
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// @@@@@@@@@@@@!!!!!!!!!!!!!!!!!!!@@@@@@@@@@@@@@@@@@@@@
// Deal with the BOUNDARY CONDITIONS
// @@@@@@@@@@@@!!!!!!!!!!!!!!!!!!!@@@@@@@@@@@@@@@@@@@@@
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
/// @brief This first function is used as a simple way to implement boundary conditions,
/// particularly no flux and periodic boundary conditions.
/// The buffered surface has NRows+2 rows and NCols+2 columns.
/// The integer b_type sets the type of boundary conditions, but currently there
/// is only one implementation: no flux across N and S; periodic for E and W.
/// @param b_type at the moment this is irrelevant since this just switches to default
/// @return creates a buffered LSDRasterModel
LSDRasterModel create_buffered_surf(int b_type);
/// @brief This second version has periodic boundaries at E and W boundaries, and
/// Neumann boundary conditions (prescribed elevations) at the N and S
/// boundaries.
/// @param South_boundary_elevation the elevation at the southern boundary
/// @param North_boundary_elevation the elevation at the southern boundary
LSDRasterModel create_buffered_surf(float South_boundary_elevation,float North_boundary_elevation);
/// @brief Check whether current node is a base level node
/// @param row
/// @param column
/// @return true or false
/// @author JAJ
/// @date 01/01/2014
bool is_base_level(int i, int j);
/// @brief not sure what this does yet (SMM)
void interpret_boundary(short &dimension, bool &periodic, int &size);
/// @brief Gets the maxium elevation along a boundary
/// @param boundary_number 0 == row 0 1 == col 0
/// @return the maximum elevation along the boundaty
float find_max_boundary( int boundary_number );
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// @@@@@@@@@@@@!!!!!!!!!!!!!!!!!!!@@@@@@@@@@@@@@@@@@@@@
// Calculate erosion rates
// @@@@@@@@@@@@!!!!!!!!!!!!!!!!!!!@@@@@@@@@@@@@@@@@@@@@
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
/// @brief Simple function that creates an array with the erosion rates for a given
/// timestep. It doesn't do anything with NoData cells, and for cells with data
/// it calls the get_erosion_at_cell member function
/// updated to catch instances when zeta_old has not been calculated
/// @return an array with the erosion rates
/// @author JAJ updated SMM
/// @date 01/01/2014 updated 01/07/2014
Array2D<float> calculate_erosion_rates( void );
/// @brief This calculates the erosion rate for individual cells.
/// Currently it assumes that the zeta_old data member is from the previous
/// timestep
/// @param row the row of the cell
/// @param col the column of the cell
/// @author JAJ
/// @date 01/01/2014
float get_erosion_at_cell(int row, int col);
/// @brief this calcualtes the total erosion over a timester
/// @return the erosion rate calculated over the last timestep
/// @author SMM
/// @date 01/08/2014
float get_total_erosion_rate_over_timestep();
///=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
/// CREATE PRECIPITION FLUX ARRAY
/// Produces precipitation array from provided precipitation rate.
///---------------------------------------------------------------------------
Array2D<float> precip_array_from_precip_rate(float precip_rate);
///=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
/// TOPOGRAPHIC DERIVATIVES
/// Specifically, this function gets the topographic slopes, as required for
/// the sediment flux calculations. The slopes are stored as two matrices, one
/// that stores slopes between rows, the other which for slopes between
/// columns. Note that this is a finite volume model that utilises cubic model
/// voxels. Sediment fluxes are only permitted through the faces.
///
/// For slopes between columns, the entry at S[row][col] refers to the slope
/// between zeta at node [row][col] and at node [row][col+1]. Likewise for the
/// slopes between rows. In short, the center points of the slopes are offset
/// by 1/2 a node spacing in the positive direction.
/// Note that there are NCols +1 and NRows +1 columns and rows respectively
///----------------------------------------------------------------------------
void get_slopes(Array2D<float>& SlopesBetweenRows, Array2D<float>& SlopesBetweenCols);
///----------------------------------------------------------------------------
/// get_topographic_divergence
/// gets the topographic divergence at each point in the model domain. Use
/// buffered topography
///----------------------------------------------------------------------------
Array2D<float> get_topographic_divergence();
///=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
/// HYDROLOGICAL TOOLS
///----------------------------------------------------------------------------
/// calculate_channel_width_wolman
/// This function calculates channel width using the wolman method.
/// NOTE: typically Q_w will be in m^3/s.
/// EXAMPLE: in Salmon River, Idaho (Emmett, 1975 cited in Knighton 1988):
/// k_w = 2.77 and b = 0.56. b is often assumed to be 0.5
///----------------------------------------------------------------------------
float calculate_channel_width_wolman(float Q_w, float k_w, float b);
///----------------------------------------------------------------------------
/// array_channel_width_wolman
/// this function calcualtes channel width in a stand alone module so the widths
/// can be tested
///----------------------------------------------------------------------------
Array2D<float> array_channel_width_wolman(Array2D<float>& Q_w, float& k_w, float& b);
///=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
/// EROSION RATES/SEDIMENT FLUXES
///
///----------------------------------------------------------------------------
/// this caluclates the fluvial erosion rate at each point
///----------------------------------------------------------------------------
Array2D<float> calculate_fluvial_erosion_rate(Array2D<float> ChannelWidth, Array2D<float> Q_w,
Array2D<float> TopoDivergence, float K, float n, float m, float eros_thresh);
///=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
/// IMPLICIT MODEL COMPONENTS
///------------------------------------------------------------------------------
/// Implicit schemes for combination of hillslope sediment transport using
/// non-linear hillslope transport law, and fluvial erosion. This is essentially
/// the implicit implementation of MuddPILE, but has been modified so that now
/// fluvial erosion is undertaken using FASTSCAPE (Braun and Willet, 2013), which
/// greatly increases computational efficiency.
///------------------------------------------------------------------------------
/// calculate_k_values_for_assembly_matrix/mtl_initiate_assembler_matrix
/// this function creates vectors of integers that refer to the k values, that is
/// the index into the vectorized matrix of zeta values, that is used in the assembly matrix
/// the number of elements in the k vectors is N_rows*N_cols
///------------------------------------------------------------------------------
void calculate_k_values_for_assembly_matrix(int NRows, int NCols, vector<int>& k_value_i_j,
vector<int>& k_value_ip1_j, vector<int>& k_value_im1_j, vector<int>& k_value_i_jp1,
vector<int>& k_value_i_jm1);
/// mtl_initiate_assembler_matrix
void mtl_initiate_assembler_matrix(int& problem_dimension,
float& inv_dx_S_c_squared, float& inv_dy_S_c_squared, float& dx_front_term,
float& dy_front_term, vector<int>& vec_k_value_i_j, vector<int>& vec_k_value_ip1_j,
vector<int>& vec_k_value_im1_j, vector<int>& vec_k_value_i_jp1,
vector<int>& vec_k_value_i_jm1);
//------------------------------------------------------------------------------
/// mtl_assemble_matrix
/// this function assembles the solution matrix for nonlinear creep transport
//------------------------------------------------------------------------------
void mtl_assemble_matrix(Array2D<float>& zeta_last_iter, Array2D<float>& zeta_last_timestep,
Array2D<float>& zeta_this_iter, Array2D<float>& uplift_rate,
Array2D<float>& fluvial_erosion_rate,
mtl::compressed2D<float>& mtl_Assembly_matrix, mtl::dense_vector<float>& mtl_b_vector,
float dt, int problem_dimension, float inv_dx_S_c_squared, float inv_dy_S_c_squared,
float dx_front_term, float dy_front_term,
float South_boundary_elevation, float North_boundary_elevation,
vector<int>& vec_k_value_i_j, vector<int>& vec_k_value_ip1_j,vector<int>& vec_k_value_im1_j,
vector<int>& vec_k_value_i_jp1, vector<int>& vec_k_value_i_jm1);
///------------------------------------------------------------------------------
/// mtl_solve_assembler_matrix
/// this function assembles the solution matrix
///------------------------------------------------------------------------------
void mtl_solve_assembler_matrix(Array2D<float>& zeta_last_iter, Array2D<float>& zeta_last_timestep,
Array2D<float>& zeta_this_iter, Array2D<float>& uplift_rate,
Array2D<float>& fluvial_erosion_rate,
float dt, int problem_dimension, float inv_dx_S_c_squared, float inv_dy_S_c_squared,
float dx_front_term, float dy_front_term,
vector<int>& vec_k_value_i_j, vector<int>& vec_k_value_ip1_j, vector<int>& vec_k_value_im1_j,
vector<int>& vec_k_value_i_jp1, std::vector<int>& vec_k_value_i_jm1,
float South_boundary_elevation, float North_boundary_elevation);
///------------------------------------------------------------------------------
/// nonlinear_creep_timestep
/// do a creep timestep. This function houses the above two functions to
/// undertake model timestep using implicit implementation of the nonlinear
/// transport law.
/// NOTE you need to run mtl_initiate_assembler_matrix before you run this function
///------------------------------------------------------------------------------
void nonlinear_creep_timestep(Array2D<float>& fluvial_erosion_rate, float iteration_tolerance,
int problem_dimension, float inv_dx_S_c_squared, float inv_dy_S_c_squared,
float dx_front_term, float dy_front_term, vector<int>& vec_k_value_i_j,
vector<int>& vec_k_value_ip1_j, vector<int>& vec_k_value_im1_j,
vector<int>& vec_k_value_i_jp1, vector<int>& vec_k_value_i_jm1,
float South_boundary_elevation, float North_boundary_elevation);
/// -----------------------------------------------------------------------------
/// Soil diffusion method
/// Container for all the finite volume components
/// -----------------------------------------------------------------------------
void soil_diffusion_fv( void );
/// -----------------------------------------------------------------------------
/// Finite difference matrix
/// -----------------------------------------------------------------------------
mtl::compressed2D<float> generate_fd_matrix( int dimension, int size, bool periodic );
mtl::dense_vector <float> build_fd_vector( int dimension, int size );
//void repack_fd_vector(mtl::dense_vector <float> &data_vector, int dimension);
mtl::compressed2D<float> generate_fv_matrix( int dimension, int size, bool periodic );
mtl::dense_vector <float> build_fv_vector( int dimension, int size );
void repack_vector(mtl::dense_vector <float> &data_vector, int dimension);
/// -----------------------------------------------------------------------------
/// Soil diffusion using linear flux model
/// Solved using finite difference
/// -----------------------------------------------------------------------------
void soil_diffusion_fd_linear( void );
void soil_diffusion_fv_nonlinear( void );
///=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
/// RUN MODEL
///------------------------------------------------------------------------------
/// A series of wrapper functions that implement the numerical model
///------------------------------------------------------------------------------
/// implicit_hillslope_and_fluvial
/// This function sets up a landscape evolution model run incorporating fluvial
/// erosion and hillslope erosion via non-linear creep. It calls the implicit
/// implementation and returns the topography after the final timestep.
/// The user should provide the parameter file which sets out the details of the
/// model run.
///------------------------------------------------------------------------------
LSDRasterModel run_model_implicit_hillslope_and_fluvial(string param_file);
/// @brief This wrapper just calls the run_components method. Parameters used are those
/// stored as data members
/// @author JAJ
/// @date 01/01/2014
void run_model( void );
/// @brief This loads a steady state raster from the data members so that
/// a model can be run repeatedly from the same steady state condition
/// @author JAJ
/// @date 01/01/2014
void run_model_from_steady_state( void );
/// @brief This wrapper just calls the run_components method. Parameters used are those
/// stored as data members. This one actually calls the erosion laws
/// @author JAJ
/// @date 01/01/2014
void run_components( void );
/// @brief This is a wrapper similar to run_components but sends the
/// fluvial and uplfit fields to the nonlinear solver
/// @author SMM
/// @date 07/07/2014
void run_components_combined( void );
/// @brief This is a wrapper similar to run_components but sends the
/// fluvial and uplfit fields to the nonlinear solver.
/// @detail Variable U and K rasters can be used.
/// @param URaster A raster of uplift rates
/// @param KRaster A raster of K values
/// @param use_adaptive_timestep If true, an adaptive timestep is used
/// @author SMM
/// @date 03/09/2017
void run_components_combined( LSDRaster& URaster, LSDRaster& KRaster, bool use_adaptive_timestep );
/// @brief This is a wrapper that runs the model but includes CRN columns
/// fluvial and uplfit fields to the nonlinear solver
/// @param CRNColumns the vector of particle columns
/// @param eroded_cells this gets replaced, it is the eroded particles
/// @param startType the starting type of the particle (doesn't really play a role)
/// @param startDepth the starting depth (in m) of the particles
/// @param particle_spacing vertical distance between particles in the column
/// @param CRNParam the cosmogenic parameter values
/// @author SMM
/// @date 25/07/2014
void run_components_combined_cell_tracker( vector<LSDParticleColumn>& CRNColumns,
vector<LSDParticleColumn>& eroded_cells,
int startType, double startDepth, double particle_spacing,
LSDCRNParameters& CRNParam);
/// @brief This initiates a vector of CRN columns that sit under the model
/// @author SMM
/// @param column_spacing and integer telling how many nodes between particle columns
/// @param CRNcol_rows this is an integer vector that is replaced in this function
/// each element indexes the row of the vector of columns
/// @param CRNcol_cols this is an integer vector that is replaced in this function
/// each element indexes the col of the vector of columns
/// @param rho_r the density of the rock in kg/m^3
/// @param this_U the uplift rate in m/yr that the particles CRN concentrations
/// will be equilibrated to. Note it is only via nucleonic production
/// @param startType the starting type of the particle (doesn't really play a role)
/// @param startDepth the starting depth (in m) of the particles
/// @param particle_spacing vertical distance between particles in the column
/// @param CRNParam the cosmogenic parameter values
/// @return a vector of particle columns
/// @author SMM
/// @date 31/07/2014
vector<LSDParticleColumn> initiate_steady_CRN_columns(int column_spacing,
vector<int>& CRNcol_rows, vector<int>& CRNcol_cols,
double rho_r, double this_U, int startType, double startDepth,
double particle_spacing, LSDCRNParameters& CRNParam);
/// @brief This method forces the landscape into its steady state profile, by using periodic forcing.
/// This is much more efficient than using static forcing (as in run model), but doesn't give
/// a nice animation of an evolving landscape
/// Swings and roundabouts
/// @author JAJ
/// @date 01/01/2014
void reach_steady_state( void );
/// @brief This method creates a steady landscape that assumes everywhere obeys the
/// stream power law. It is based on equation 4a from Mudd et al 2014 JGR-ES
/// @detail There is no return but the underlying raster data will reflect the
/// analytical steady topography for the uplift rate.
/// @param U the uplift rate (in m/yr)
/// @author SMM
/// @date 10/08/2017
void fluvial_snap_to_steady_state(float U);
/// @brief This method creates a steady landscape that assumes everywhere obeys the
/// stream power law. It is based on equation 4a from Mudd et al 2014 JGR-ES.
/// The function is given a target relief and the K value is adjusted to match
/// this target relief at the maximum chi value.
/// @detail In addition to the return, the underlying raster data will reflect the
/// analytical steady topography for the uplift rate.
/// @param U the uplift rate (in m/yr)
/// @param desired_relief The desired landscape relief in metres
/// @return The back calculated K value for the desired relief
/// @author SMM
/// @date 10/08/2017
float fluvial_snap_to_steady_state_tune_K_for_relief(float U, float desired_relief);
/// @brief This method calcualtes the fluvial K required to generate the
/// desired relief at steady state for the farthest upstream chi.
/// It is based on equation 4a from Mudd et al 2014 JGR-ES.
/// @detail This does not update aything in the model, but simply returns the desired K
/// @param U the uplift rate (in m/yr)
/// @param desired_relief The desired landscape relief in metres
/// @return The back calculated K value for the desired relief
/// @author SMM
/// @date 29/08/2017
float fluvial_calculate_K_for_steady_state_relief(float U, float desired_relief);
/// @brief Fastscape, implicit finite difference solver for stream power equations
/// O(n)
/// Method takes its paramaters from the model data members
/// and solves the stream power equation at a future timestep in linear time
/// @author JAJ, commented SMM
/// @date 01/01/2014, edit 18/01/2014
void fluvial_incision( void );
/// @brief Fastscape, implicit finite difference solver for stream power equations
/// O(n)
/// Method takes its paramaters from the model data members
/// and solves the stream power equation at a future timestep in linear time
/// This version includes the current uplift, so you do not need to call
/// uplift after this has finished
/// @author SMM
/// @date 7/07/2014
void fluvial_incision_with_uplift( void );
/// @brief Fastscape, implicit finite difference solver for stream power equations
/// O(n)
/// Method takes the K value from a raster fed to it
/// and solves the stream power equation at a future timestep in linear time
/// This version includes the current uplift, so you do not need to call
/// uplift after this has finished
/// @param K_raster the raster of K values.
/// @author SMM
/// @date 01/09/2017
void fluvial_incision_with_uplift_and_variable_K( LSDRaster& K_raster );
/// @brief Fastscape, implicit finite difference solver for stream power equations
/// O(n)
/// Method takes the K value from a raster fed to it
/// and also take a raster of the uplift rates
/// and solves the stream power equation at a future timestep in linear time
/// This version includes the current uplift, so you do not need to call
/// uplift after this has finished
/// @param K_raster the raster of K values.
/// @param Uplift_rate a raster of uplift rates in m/yr
/// @author SMM
/// @date 01/09/2017
void fluvial_incision_with_variable_uplift_and_variable_K( LSDRaster& Uplift_rate, LSDRaster& K_raster );
/// @brief Fastscape, implicit finite difference solver for stream power equations
/// O(n)
/// Method takes the K value from a raster fed to it
/// and also take a raster of the uplift rates
/// and solves the stream power equation at a future timestep in linear time
/// This version includes the current uplift, so you do not need to call
/// uplift after this has finished. Uses an adaptive timestep.
/// @param K_raster the raster of K values.
/// @param Uplift_rate a raster of uplift rates in m/yr
/// @author SMM
/// @date 06/09/2017
void fluvial_incision_with_variable_uplift_and_variable_K_adaptive_timestep( LSDRaster& Uplift_rate, LSDRaster& K_raster );
/// @brief This function is more or less identical to fluvial_incision above, but it
/// Returns a raster with the erosion rate and takes arguments rather
/// than reading from data members
/// @param timestep the time spacing
/// @param K fluvial erosivity
/// @param m area exponent
/// @param n slope exponent
/// @param boundary a vector of strings cotaining model boundary conditions
/// @return A raster containing the erosion rate from fluvial processes
/// @author JAJ
/// @date 01/01/2014
LSDRaster fluvial_erosion_rate(float timestep, float K, float m, float n, vector <string> boundary);
/// @brief This function is more or less identical to fluvial_incision above, but it
/// Returns an array and takes arguments rather reads from data members
/// @return A 2d float containing the erosion rate from fluvial processes
/// @author SMM
/// @date 07/07/2014
Array2D<float> fluvial_erosion_rate( void );
/// @brief This assumes that all sediment transported from rivers into
/// channels is removed. It checks the raster to see where the channels are
/// which at this point is determined by a threshold drainage area,
/// and then removes all the sediment to those pixels
/// @author JAJ
/// @date 01/01/2014
void wash_out( void );
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// @!@!@!@!@!@!@!@!@!@!@!@!@!@!@!@!@
// TOOLS FOR UPLIFT
// @!@!@!@!@!@!@!@!@!@!@!@!@!@!@!@!@
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
/// @brief Creates uplift field from a set of templates
/// @param mode specifies a mode of uplift:
/// (0) - block uplift
/// 1 - tilt block
/// 2 - gaussian
/// 3 - quadratic
/// @param second argument is the maximum uplift
/// @return returns the uplift field that is the same dimensions as the original
/// raster
/// @author JAJ
/// @date 01/01/2014
Array2D <float> generate_uplift_field( int mode, float max_uplift);
/// @brief Creates uplift field from a set of templates, parameters are taken from
/// data members
/// @return returns the uplift field that is the same dimensions as the original
/// raster
/// @author SMM
/// @date 07/07/2014
Array2D <float> generate_uplift_field( void );
/// @brief Gets the uplift value at a given cell
/// this method is implemented as a memory saving measure, rather than
/// storing the uplift field in memory
/// Some methods still implemented still use this uplift field
/// It's advisable this is changed, otherwise the size of rasters that
/// can be modelled will be severely reduced
/// @details This uses the uplift_mode to determine how uplift is calculated
/// (0) - block uplift
/// 1 - tilt block
/// 2 - gaussian
/// 3 - quadratic
/// 4 - periodic
/// @param row
/// @param column
/// @return the uplift (as a distance rather than rate, uses data member timestep)
/// @author JAJ commented SMM
/// @author 01/01/2014 commented 26/06/2014
float get_uplift_at_cell(int i, int j);
/// @brief Gets the uplift rate at a given cell
/// this method is implemented as a memory saving measure, rather than
/// storing the uplift field in memory
/// Some methods still implemented still use this uplift field
/// It's advisable this is changed, otherwise the size of rasters that
/// can be modelled will be severely reduced
/// @details This uses the uplift_mode to determine how uplift is calculated
/// (0) - block uplift
/// 1 - tilt block
/// 2 - gaussian
/// 3 - quadratic
/// 4 - periodic
/// @param row
/// @param column
/// @return the uplift rate
/// @author SMM
/// @date 07/07/2014 commented 26/06/2014
float get_uplift_rate_at_cell(int i, int j);
/// @brief This checks to see if the uplift field is consistent with
/// the raster dimensions. If not it corrects the dimensions of the uplift field
/// @author SMM
/// @date 23/08/2017
void check_and_correct_uplift_field();
/// @brief this calcualtes the average uplfit rate over the entire model domain,
/// excluding the N and S boundaries
/// @return the average uplift rate in m/yr
/// @author SMM
/// @date 01/08/2014
float get_average_upflit_rate_last_timestep();
/// @brief Apply uplift field to the raster. Overloaded function so that the first
/// simply considers uniform uplift, the second allows user to use a prescribed
/// uplift fields of greater complexity, for example taking account of fault
/// geometry.
/// @details WARNING the returned LSDRasterModel only contains a very small
/// subset of the data members of the original LSDRasterModel. Implementation
/// NOT RECOMMENDED!
/// @param UpliftRate the rate of uplift at that timestep
/// @param dt the timestep
/// @param Returns an LSDRasterModel of uplift (SMM: why not just update
/// the raster directly??)
/// @author JAJ, comments SMM
/// @date 01/01/2014 SMM comments 26/06/2014
LSDRasterModel uplift_surface(float UpliftRate, float dt);
/// @brief Uplift surface using specified uplift field
/// uplift field should be specified as an array with the same dimensions as the
/// elevation raster, permitting non-uniform uplift fields to be applied in the
/// model.
/// @details WARNING the returned LSDRasterModel only contains a very small
/// subset of the data members of the original LSDRasterModel. Implementation
/// NOT RECOMMENDED!
/// @param UpliftRate a 2D float array of the uplift. Can be made using the
/// member function generate_uplift_field
/// @param dt the timestep
/// @param an LSDRasterModel object (SMM again, why not update the underlying
/// data member of surface elevation?)
/// @author JAJ, comments SMM
/// @date 01/01/2014 SMM comments 26/06/2014
LSDRasterModel uplift_surface(Array2D<float> UpliftRate, float dt);
/// @brief Intrinsic method of uplifting the Raster
/// Uplift field attribute is incremented onto RasterData itself
/// There are no parameters, but rather it simply passes upflift to the
/// get upflift at cell function
/// @details Uplift is calculated based on data_members max_uplift, timestep and
/// uplift mode.
/// This uses the uplift_mode to determine how uplift is calculated
/// (0) - block uplift
/// 1 - tilt block
/// 2 - gaussian
/// 3 - quadratic
/// 4 - periodic
/// @author JAJ commented SMM 26/06/2014
/// @date 01/01/2014, commented 26/06/2014
void uplift_surface( void );
/// @brief This just returns the max_uplift data member
/// NOTE; while this is currently a very trivial, and arguably unecessary method, it should be used
/// and developed if someone wants to integrate some sort of changing uplift field
/// @return the data member holding the maximum uplift
/// @author JAJ
/// @date 01/01/2014
float get_max_uplift( void );
/// @brief This function sets the uplift_field data member as bolck uplift
/// with a rate of uplift_rate
/// @param uplift_rate a float of uplift rate, the entire block will uplift
/// at this rate
/// @author SMM
/// @date 03/07/2014
void set_uplift_field_to_block_uplift(float uplift_rate);
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// @!@!@!@!@!@!@!@!@!@!@!@!@!@!@!@!@
// TOOLS FOR ISOSTACY
// @!@!@!@!@!@!@!@!@!@!@!@!@!@!@!@!@
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
/// --------------------------------------------------------------------
/// Runs flexural isostatic calculations
/// Uses fourier filtering method
/// Pelletier (2008)
/// --------------------------------------------------------------------
LSDRasterModel run_isostatic_correction( void );
/// -------------------------------------------------------------------
/// Correct for isostasy using Airy model
/// -------------------------------------------------------------------
void Airy_isostasy( void );
/// -------------------------------------------------------------------
/// Correct for isostasy using flexural model
/// -------------------------------------------------------------------
void flexural_isostasy( float alpha );
void flexural_isostasy_alt( void );
void write_root(string name, string ext);
/// -------------------------------------------------------------------
/// Calculates depth of topographic root using FFT methods inherited from LSDRasterSpectral
/// -------------------------------------------------------------------
Array2D <float> calculate_root( void );
Array2D <float> calculate_airy( void );
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// @~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@
// Setter methods
// @~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
/// @brief this sets the boundary conditions
void set_boundary_conditions(vector <string> bc)
{ for (int i=0; i<4; ++i) {bc[i][0] = tolower(bc[i][0]);} boundary_conditions = bc; }
void print_boundary_conditions_to_screen()
{ for (int i=0; i<4; ++i) { cout << "bc["<<i<<"]: "<<boundary_conditions[i] << endl;} }
/// @brief set the time step
void set_timeStep( float dt ) { timeStep = dt; }
/// @brief set the maximum time step
void set_maxtimeStep (float max_dt) { maxtimeStep = max_dt; }
/// @brief set the ending time
void set_endTime( float time ) { endTime = time; }
/// @brief set the number of runs. Used for running multiple simulations from
/// the same starting conditions
void set_num_runs( int num ) { num_runs = num; }
/// @brief sets the uplift mode
void set_uplift_mode( int new_uplift_mode) { uplift_mode = new_uplift_mode; }
/// @brief overloaded function, set the array of uplift
void set_uplift( Array2D <float> uplift ) { uplift_field = uplift; }
/// @brief overloaded function, set the array of uplift, but using the uplift mode
/// @details uplfit modes are:
/// (0) - block uplift
/// 1 - tilt block
/// 2 - gaussian
/// 3 - quadratic
/// 4 - periodic
void set_uplift( int mode, float max_rate )
{ uplift_field = generate_uplift_field( mode, max_rate ); this->max_uplift = max_rate; }
/// This adjusts the uplift mode
void set_periodic_uplift(double uplift_amplitude_fraction)
{ uplift_amplitude = max_uplift*uplift_amplitude_fraction; uplift_mode = 4; }
/// This sets the uplift amplitude as a fraction of the uplift
void set_uplift_amplitude( double uplift_amplitude_fraction)
{ uplift_amplitude = max_uplift*uplift_amplitude_fraction; }
/// @brief this sets the baseline uplift rate for the tilt block
void set_baseline_uplift( float new_rate ) { baseline_uplift = new_rate; }
/// @brief set the tolerance for determining steady state
void set_steady_state_tolerance( float tol ) { steady_state_tolerance = tol; }
/// @brief set the amplitude of random noise
void set_noise( float noise_amp) { this->noise = noise_amp; }
/// @brief sets fluvial erodibility
void set_K( float K ) { this->K_fluv = K; }
/// @brief sets the hillslope diffusivity
void set_D( float D ) { this->K_soil = D; }