LandscapeDNDC
1.37.0
Loading...
Searching...
No Matches
siteparameterstypes.h
1
/*
2
* SPDX-FileCopyrightText: Karlsruhe Institute of Technology (KIT)
3
* SPDX-License-Identifier: LicenseRef-Crabmeat
4
* This file is part of Crabmeat. Redistribution or commercial use is
5
* prohibited without express written permission. See LICENCE.
6
*/
7
16
17
#ifndef LDNDC_INPUT_SITEPARAMETERSTYPES_H_
18
#define LDNDC_INPUT_SITEPARAMETERSTYPES_H_
19
20
#include "crabmeat-common.h"
21
#include "containers/cbm_typewrap.h"
22
23
#ifdef _DEBUG
24
# include "utils/cbm_utils.h"
25
#endif
26
#ifndef __SITEPARAMETER_VALUE__
27
# define __SITEPARAMETER_VALUE__(__name__,__type__) site_params_[__SITEPARAMETER_index_ ## __name__].get_value<__type__>()
28
#endif
29
#define SITEPARAMETER_(__name__,__type__) \
30
public: \
31
__type__ __name__() \
32
const \
33
{ \
34
crabmeat_assert( cbm::is_valid( __SITEPARAMETER_VALUE__(__name__,__type__))); \
35
return __SITEPARAMETER_VALUE__(__name__,__type__); \
36
} \
37
static __type__ __name__##_##MIN() \
38
{ \
39
return SITEPARAMETER_##__name__##_MINVALUE; \
40
} \
41
static __type__ __name__##_##MAX() \
42
{ \
43
return SITEPARAMETER_##__name__##_MAXVALUE; \
44
} \
45
private:
46
#define SITEPARAMETER_BOOL(__name__) SITEPARAMETER_(__name__,siteparameter_t::bool_type)
47
#define SITEPARAMETER_FLT(__name__) SITEPARAMETER_(__name__,siteparameter_t::float_type)
48
#define SITEPARAMETER_INT(__name__) SITEPARAMETER_(__name__,siteparameter_t::int_type)
49
#define SITEPARAMETER_UINT(__name__) SITEPARAMETER_(__name__,siteparameter_t::uint_type)
50
51
#define SITEPARAMETER_INVALID_BOOL false
52
#define SITEPARAMETER_INVALID_FLT ldndc::invalid_t< siteparameter_t::float_type >::value
53
#define SITEPARAMETER_INVALID_INT ldndc::invalid_t< siteparameter_t::int_type >::value
54
#define SITEPARAMETER_INVALID_UINT ldndc::invalid_t< siteparameter_t::uint_type >::value
55
56
#include "io/outputtypes.h"
57
namespace
ldndc
{
namespace
siteparameters
58
{
59
#define LTYPEWRAP_SITE_PARAM_MAGIC 3
60
typedef
ltypewrap_t< ldndc_flt64_t, ldndc_int32_t, ldndc_uint32_t, LTYPEWRAP_SITE_PARAM_MAGIC > siteparameter_t;
61
#define SITEPARAMETERS_bool_type LDNDC_BOOL
62
#define SITEPARAMETERS_float_type LDNDC_FLOAT64
63
#define SITEPARAMETERS_int_type LDNDC_INT32
64
#define SITEPARAMETERS_uint_type LDNDC_UINT32
65
66
#include "siteparameters.h.inc"
67
}}
68
69
#endif
/* !LDNDC_INPUT_SITEPARAMETERSTYPES_H_ */
70
ldndc
Spatially explicit groundwater model.
Definition
airchemistryput.h:21
crabmeat-src
scientific
siteparameters
siteparameterstypes.h
Generated by
1.13.2