Multiscale Universal Interface  2.0
A Concurrent Framework for Coupling Heterogeneous Solvers
config.h
Go to the documentation of this file.
1 /*****************************************************************************
2 * Multiscale Universal Interface Code Coupling Library *
3 * *
4 * Copyright (C) 2019 Y. H. Tang, S. Kudo, X. Bian, Z. Li, G. E. Karniadakis *
5 * *
6 * This software is jointly licensed under the Apache License, Version 2.0 *
7 * and the GNU General Public License version 3, you may use it according *
8 * to either. *
9 * *
10 * ** Apache License, version 2.0 ** *
11 * *
12 * Licensed under the Apache License, Version 2.0 (the "License"); *
13 * you may not use this file except in compliance with the License. *
14 * You may obtain a copy of the License at *
15 * *
16 * http://www.apache.org/licenses/LICENSE-2.0 *
17 * *
18 * Unless required by applicable law or agreed to in writing, software *
19 * distributed under the License is distributed on an "AS IS" BASIS, *
20 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
21 * See the License for the specific language governing permissions and *
22 * limitations under the License. *
23 * *
24 * ** GNU General Public License, version 3 ** *
25 * *
26 * This program is free software: you can redistribute it and/or modify *
27 * it under the terms of the GNU General Public License as published by *
28 * the Free Software Foundation, either version 3 of the License, or *
29 * (at your option) any later version. *
30 * *
31 * This program is distributed in the hope that it will be useful, *
32 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
33 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
34 * GNU General Public License for more details. *
35 * *
36 * You should have received a copy of the GNU General Public License *
37 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
38 *****************************************************************************/
39 
48 #ifndef CONFIG_H
49 #define CONFIG_H
50 
51 #include "general/util.h"
52 #include "general/dim.h"
53 #include "general/exception.h"
54 
55 namespace mui {
56 
57 template<typename... TYPES> struct type_list {};
58 
59 struct one_dim {
60  using EXCEPTION = exception_segv; //- Exception handling type
61 
62  static const bool DEBUG = false; //- Enable extra debugging output
63  static const int D = 1; //- Dimensionality of the domain
64  static const bool FIXEDPOINTS = false; //- Optimise for fixed structures - points, and order in which parameters sent must be unchanging between time frames
65  static const bool QUIET = false; //- If the library is quiet then it will only issue critical warning messages
66 
67  using REAL = double; //- REAL data type
68  using INT = int; //- INT data type
69 
70  using time_type = REAL; //- INT for iteration coupling, REAL for time-based coupling
71  using iterator_type = INT; //- Typically INT for sub-iteration count
72  using point_type = point<REAL, D>; //- "point" data type and dimensionality
73  using data_types = type_list<uint32_t, //- Data types that can be used in the interface
74  uint64_t,
75  int32_t,
76  int64_t,
77  double,
78  float,
79  std::string
80  >;
81 };
82 
83 struct two_dim {
85 
86  static const bool DEBUG = false;
87  static const int D = 2;
88  static const bool FIXEDPOINTS = false;
89  static const bool QUIET = false;
90 
91  using REAL = double;
92  using INT = int;
93 
94  using time_type = REAL;
95  using iterator_type = INT;
97  using data_types = type_list<uint32_t,
98  uint64_t,
99  int32_t,
100  int64_t,
101  double,
102  float,
103  std::string
104  >;
105 };
106 
107 struct three_dim {
109 
110  static const bool DEBUG = false;
111  static const int D = 3;
112  static const bool FIXEDPOINTS = false;
113  static const bool QUIET = false;
114 
115  using REAL = double;
116  using INT = int;
117 
118  using time_type = REAL;
121  using data_types = type_list<uint32_t,
122  uint64_t,
123  int32_t,
124  int64_t,
125  double,
126  float,
127  std::string
128  >;
129 };
130 
131 // backward-compatibility
133 }
134 
135 #endif
File providing data specialisms at different dimensionalities.
Base class for exception handling.
Definition: comm.h:54
Definition: config.h:132
Definition: exception.h:58
Definition: config.h:59
static const bool DEBUG
Definition: config.h:62
static const bool FIXEDPOINTS
Definition: config.h:64
static const bool QUIET
Definition: config.h:65
INT iterator_type
Definition: config.h:71
double REAL
Definition: config.h:67
static const int D
Definition: config.h:63
int INT
Definition: config.h:68
REAL time_type
Definition: config.h:70
Definition: point.h:100
Definition: config.h:107
static const bool DEBUG
Definition: config.h:110
int INT
Definition: config.h:116
double REAL
Definition: config.h:115
static const bool FIXEDPOINTS
Definition: config.h:112
INT iterator_type
Definition: config.h:119
static const bool QUIET
Definition: config.h:113
static const int D
Definition: config.h:111
REAL time_type
Definition: config.h:118
Definition: config.h:83
static const bool DEBUG
Definition: config.h:86
static const int D
Definition: config.h:87
REAL time_type
Definition: config.h:94
static const bool FIXEDPOINTS
Definition: config.h:88
static const bool QUIET
Definition: config.h:89
double REAL
Definition: config.h:91
int INT
Definition: config.h:92
INT iterator_type
Definition: config.h:95
Definition: config.h:57
Provides a number of utility functions used through the rest of the library.