1 #ifndef MCRC_PROGRAMMING_HH
2 #define MCRC_PROGRAMMING_HH
6 #pragma warning( disable : 4351 )
10 #include "flumy_export.hpp"
28 #include "MCRCDefines.h"
31 typedef double MP_real;
33 typedef unsigned int MP_uint;
34 typedef unsigned char MP_uchar;
36 typedef std::string MP_string;
37 typedef MP_int MP_tseed;
38 typedef MP_uint MP_age;
39 typedef MP_uchar MP_color;
40 typedef MP_uchar MP_stut;
41 typedef MP_uchar MP_agut;
43 typedef std::vector<MP_stut> FaciesList;
44 typedef std::vector<MP_age> AgeList;
45 typedef std::vector<MP_real> RealList;
46 typedef std::vector<MP_int> IntList;
47 typedef std::vector<MP_string> StringList;
50 #define MP_FAMILY_MASK 0xf
51 #define MP_GRANULO_OFFSET 4
52 #define MP_STUT_SIZE 8
53 #define MP_AGUT_SIZE 8
55 #define UNUSED(x) (void)(x)
59 #define MP_INIT_SEED DEF_SIM_SEED
60 #define MP_INIT_FREQ FREQ_NEVER
61 #define MP_INIT_PERIOD_VAL 100
62 #define MP_INIT_POISSON_VAL 100
63 #define MP_INIT_DIST DIST_CONSTANT
64 #define MP_INIT_CONST 0.
65 #define MP_INIT_MIN 0.
66 #define MP_INIT_MAX 1.
67 #define MP_INIT_NORM_MEAN 0.
68 #define MP_INIT_NORM_STDEV 1.
69 #define MP_INIT_LOGNORM_MEAN 0.
70 #define MP_INIT_LOGNORM_STDEV 1.
73 #define MP_CHANNEL_A_AFF 4.
74 #define MP_CHANNEL_A_SEC 3.
75 #define MP_CHANNEL_A (MP_CHANNEL_A_AFF + MP_CHANNEL_A_SEC)
78 #define MP_FLU_EFF_TO_MAX_HFLOW 1.5
79 #define MP_TUR_EFF_TO_MAX_HFLOW 3.
80 #define MP_FLU_HMAX_TO_MAX_HFLOW 1.
81 #define MP_TUR_HMAX_TO_MAX_HFLOW 3.
84 #define MP_PI 3.14159265
85 #define MP_2PI 2*MP_PI
87 #define MP_YEAR_SECONDS 31557600
88 #define MP_PARAB_MEAN_TO_MAX_FACTOR 1.5
89 #define MP_PARAB_MAX_TO_MEAN_FACTOR 1/1.5
92 #define MP_DENSITY_SED 2.65
93 #define MP_R (MP_DENSITY_SED - 1)
94 #define MP_VISCO 0.000001
96 #define MP_FRICTION_COEFF_SKIN 0.005
97 #define MP_FRICTION_COEFF_SKIN_SQRT sqrt(MP_FRICTION_COEFF_SKIN)
99 #define MP_KSI (0.077 / MP_FRICTION_COEFF_SKIN_SQRT)
100 #define MP_TURBI_SCALE_FACTOR 14.
101 #define MP_LOC_SLOPE_ALPHA 3.
106 #define MP_VEL_TURB_POW 0.8
107 #define MP_POWER_FACTOR pow(2, MP_VEL_TURB_POW)
108 #define MP_INTEGRAL (MP_POWER_FACTOR / sqrt(MP_PI) * tgamma(alpha + 0.5) / tgamma(alpha + 1))
111 #define MP_FLU_D2W_FACTOR 15.
112 #define MP_FLU_W2WL_FACTOR 12.5
113 #define MP_FLU_W2LOB_FACTOR 30.
114 #define MP_FLU_SINUO 2.71
115 #define MP_FLU_SINUO_ALLEN 1.5
116 #define MP_FLU_KOB 0.6
117 #define MP_FLU_KMIG 0.65
118 #define MP_FLU_KMIG_OLD 0.75
119 #define MP_FLU_KVP 0.87
120 #define MP_FLU_TAU_CUT 2.53e-9
123 #define MP_TUR_D2W_FACTOR 30.
124 #define MP_TUR_W2WL_FACTOR 5.0
125 #define MP_TUR_W2LOB_FACTOR 10.
126 #define MP_TUR_SINUO 2.05
127 #define MP_TUR_SINUO_ALLEN 1.5
128 #define MP_TUR_KOB 1.25
129 #define MP_TUR_KMIG 0.4
130 #define MP_TUR_KMIG_OLD 0.95
131 #define MP_TUR_KVP 0.75
132 #define MP_TUR_TAU_CUT 4.85e-9
135 #define MP_MIN_SLOPE_WARN 0.0005
136 #define MP_MAX_SLOPE_WARN 0.016
137 #define MP_PEAT_COMPRESS_FACTOR 0.1
138 #define MP_DEFAULT_MIG_WELL_FACTOR 15
139 #define MP_UNDEFINED_ZUL MP_UNKNOWN_INT_VALUE
140 #define MP_DEFAULT_ZUL_TOL 0
141 #define MP_THICKNESS_RATIO 0.01
142 #define MP_INACTIVE_EP 100000.
143 #define MP_MAX_CS_CHANNEL 13
144 #define MP_MAX_MEANDER_DEFAULT_VALUES 4
145 #define MP_MAX_NB_NODES 25000000
146 #define MP_MAX_NB_NODES_WARN 1000000
147 #define MP_ERR_MAX_WELLS 100
148 #define MP_WARN_MAX_WELLS 55
149 #define MP_MAX_GRID_SIZE 5000
150 #define MP_ZOOM_TIFF 1
151 #define MP_REFRESH_LOOP 100
152 #define MP_DEFAULT_CELLS_ORDER "+Y +X +Z"
153 #define MP_DEFAULT_GSLIB_CELLS_ORDER "+X +Y +Z"
154 #define MP_DEFAULT_NA_VALUE "NA"
157 #define MP_RN_DEFAULT_SEED MP_INIT_SEED
158 #define MP_RN_DEFAULT_MODULUS 2147483647
159 #define MP_RN_DEFAULT_MULTIPLIER 16807
160 #define MP_RN_DEFAULT_QUOTIENT 127773
161 #define MP_RN_DEFAULT_REST 2836
162 #define MP_RN_SHUFFLING_TABLE_SIZE 32
165 #define MP_EPSILON 0.000001
166 #define MP_UNKNOWN_STRING_VALUE "??"
167 #define MP_UNKNOWN_REAL_VALUE 1.e30
168 #define MP_MAX_REAL_VALUE 1.e30
169 #define MP_MIN_REAL_VALUE -1.e30
170 #define MP_UNKNOWN_INT_VALUE 2147483647
171 #define MP_MAX_INT_VALUE 2147483647
172 #define MP_MIN_INT_VALUE -2147483647
229 #define MIN(x,y) (( (x) > (y) ) ? (y) : (x))
231 #define MAX(x,y) (( (x) < (y) ) ? (y) : (x))
233 #define ABS(a) ((a) >= 0 ? (a) : -(a))
237 #define round(x) ((MP_real)((x)>=0?(MP_int)((x)+0.5):(MP_int)((x)-0.5)))
240 #define assert(x) TRACE_ASSERT(x)
245 #define DECLARE_ITERATOR(X,Y,Z) \
246 class FLUMY_EXPORT X { \
249 X( const X & ci ) : _val( ci._val ) {} ; \
250 X( const Y::const_iterator & ci ) : _val( ci ) {} ; \
251 X& operator=( const X & ci ) {if (*this != ci) _val = ci._val; return(*this);} \
252 bool operator<( const X & ci ) const {return(_val<ci._val);} \
253 bool operator>( const X & ci ) const {return(_val>ci._val);} \
254 bool operator<=( const X & ci ) const {return(_val<=ci._val);} \
255 bool operator>=( const X & ci ) const {return(_val>=ci._val);} \
256 bool operator==( const X & ci ) const {return(_val==ci._val);} \
257 bool operator!=( const X & ci ) const {return(_val!=ci._val);} \
258 X& operator++() {++_val;return(*this);} \
259 X& operator--() {--_val;return(*this);} \
260 const Z& operator*() const { return( *_val ); } \
261 const Z* operator->() const { return( &(*_val) ); } \
263 Y::const_iterator _val ; \
267 #define DECLARE_REVERSE_ITERATOR(X,Y,Z) \
268 class FLUMY_EXPORT X { \
271 X( const X & ci ) : _val( ci._val ) {} ; \
272 X( const Y::const_reverse_iterator & ci ) : _val( ci ) {} ; \
273 X& operator=( const X & ci ) {if (*this != ci) _val = ci._val; return(*this);} \
274 bool operator<( const X & ci ) const {return(_val<ci._val);} \
275 bool operator>( const X & ci ) const {return(_val>ci._val);} \
276 bool operator<=( const X & ci ) const {return(_val<=ci._val);} \
277 bool operator>=( const X & ci ) const {return(_val>=ci._val);} \
278 bool operator==( const X & ci ) const {return(_val==ci._val);} \
279 bool operator!=( const X & ci ) const {return(_val!=ci._val);} \
280 X& operator++() {++_val;return(*this);} \
281 X& operator--() {--_val;return(*this);} \
282 const Z& operator*() const { return( *_val ); } \
283 const Z* operator->() const { return( &(*_val) ); } \
285 Y::const_reverse_iterator _val ; \
288 #define SPACES " \t\r\n"
290 inline MP_string trim_right (
const MP_string & s,
291 const MP_string & t = SPACES)
294 MP_string::size_type i (d.find_last_not_of (t));
295 if (i == MP_string::npos)
298 return d.erase (d.find_last_not_of (t) + 1) ;
301 inline MP_string trim_left (
const MP_string & s,
302 const MP_string & t = SPACES)
305 return d.erase (0, s.find_first_not_of (t)) ;
308 inline MP_string trim_all (
const MP_string & s,
309 const MP_string & t = SPACES)
312 return trim_left (trim_right (d, t), t) ;
Definition: MCRCProgramming.hpp:176
MP_real infer_kmig
Kmig infered value (no unit)
Definition: MCRCProgramming.hpp:185
MP_real sand_prop
Sand proportion (Net-to-Gross) (i.e. PB+CL proportion) ([0,1])
Definition: MCRCProgramming.hpp:180
InferenceStats()
Definition: MCRCProgramming.hpp:192
MP_real sinuo_allen
Channel Allen (1984) sinuosity (no unit)
Definition: MCRCProgramming.hpp:189
MP_real agg_rate
Aggradation rate (m / it)
Definition: MCRCProgramming.hpp:181
MP_real wl
Mean wavelength (m)
Definition: MCRCProgramming.hpp:191
MP_age age
Age of statistics (it)
Definition: MCRCProgramming.hpp:178
MP_real infer_kob
Kob infered value (no unit)
Definition: MCRCProgramming.hpp:184
MP_real infer_kvp
Kvp infered value (no unit)
Definition: MCRCProgramming.hpp:186
MP_real mig_rate
Migration rate (m / it)
Definition: MCRCProgramming.hpp:182
MP_real sbext
Mean sand bodies extension (m)
Definition: MCRCProgramming.hpp:190
MP_real pb_prop
Pointbar / LAPs facies proportion ([0,1])
Definition: MCRCProgramming.hpp:179
MP_real tortuo
Channel tortuosity (no unit)
Definition: MCRCProgramming.hpp:188
MP_real mean_vp
Mean velocity perturbation (m/s)
Definition: MCRCProgramming.hpp:183
MP_real sinuo
Channel sinuosity (no unit)
Definition: MCRCProgramming.hpp:187
Definition: MCRCProgramming.hpp:209
MP_real sinuo_allen
Allen (1984) sinuosity before first cutoff (no unit)
Definition: MCRCProgramming.hpp:214
MP_age age
Age of first cutoff (it)
Definition: MCRCProgramming.hpp:211
TauCutStats()
Definition: MCRCProgramming.hpp:218
MP_real wavelength
Wavelength before first cutoff (m)
Definition: MCRCProgramming.hpp:216
MP_real mean_sbext
Mean sand body extension before first cutoff (m)
Definition: MCRCProgramming.hpp:217
MP_real tortuo
Tortuosity before first cutoff (no unit)
Definition: MCRCProgramming.hpp:215
MP_real sinuo
Sinuosity before first cutoff (no unit)
Definition: MCRCProgramming.hpp:213
MP_real tau_cut
Abstract time of first cutoff (no unit)
Definition: MCRCProgramming.hpp:212