OGS 6.2.2-330-gf48c72f61.dirty.20200225212913
PropertyType.h
Go to the documentation of this file.
1 
13 #pragma once
14 
15 #include <array>
16 #include <boost/algorithm/string/predicate.hpp>
17 #include <memory>
18 #include <string>
19 #include "BaseLib/Error.h"
20 
21 namespace MaterialPropertyLib
22 {
23 class Property;
24 }
25 
26 namespace MaterialPropertyLib
27 {
34 enum PropertyType : int
35 {
82 };
83 
89 inline PropertyType convertStringToProperty(std::string const& inString)
90 {
91  if (boost::iequals(inString, "acentric_factor"))
92  {
94  }
95  if (boost::iequals(inString, "binary_interaction_coefficient"))
96  {
98  }
99  if (boost::iequals(inString, "biot_coefficient"))
100  {
102  }
103  if (boost::iequals(inString, "brooks_corey_exponent"))
104  {
106  }
107  if (boost::iequals(inString, "bulk_modulus"))
108  {
110  }
111  if (boost::iequals(inString, "critical_density"))
112  {
114  }
115  if (boost::iequals(inString, "critical_pressure"))
116  {
118  }
119  if (boost::iequals(inString, "critical_temperature"))
120  {
122  }
123  if (boost::iequals(inString, "compressibility"))
124  {
126  }
127  if (boost::iequals(inString, "decay_rate"))
128  {
130  }
131  if (boost::iequals(inString, "density"))
132  {
133  return PropertyType::density;
134  }
135  if (boost::iequals(inString, "drhodT"))
136  {
137  return PropertyType::drhodT;
138  }
139  if (boost::iequals(inString, "effective_stress"))
140  {
142  }
143  if (boost::iequals(inString, "entry_pressure"))
144  {
146  }
147  if (boost::iequals(inString, "fredlund_parameters"))
148  {
150  }
151  if (boost::iequals(inString, "heat_capacity"))
152  {
154  }
155  if (boost::iequals(inString, "longitudinal_dispersivity"))
156  {
158  }
159  if (boost::iequals(inString, "molar_mass"))
160  {
162  }
163  if (boost::iequals(inString, "mole_fraction"))
164  {
166  }
167  if (boost::iequals(inString, "molecular_diffusion"))
168  {
170  }
171  if (boost::iequals(inString, "name"))
172  {
173  return PropertyType::name;
174  }
175  if (boost::iequals(inString, "permeability"))
176  {
178  }
179  if (boost::iequals(inString, "porosity"))
180  {
181  return PropertyType::porosity;
182  }
183  if (boost::iequals(inString, "phase_velocity"))
184  {
186  }
187  if (boost::iequals(inString, "reference_density"))
188  {
190  }
191  if (boost::iequals(inString, "reference_temperature"))
192  {
194  }
195  if (boost::iequals(inString, "reference_pressure"))
196  {
198  }
199  if (boost::iequals(inString, "relative_permeability"))
200  {
202  }
203  if (boost::iequals(inString, "residual_gas_saturation"))
204  {
206  }
207  if (boost::iequals(inString, "residual_liquid_saturation"))
208  {
210  }
211  if (boost::iequals(inString, "retardation_factor"))
212  {
214  }
215  if (boost::iequals(inString, "saturation"))
216  {
218  }
219  if (boost::iequals(inString, "specific_heat_capacity"))
220  {
222  }
223  if (boost::iequals(inString, "storage"))
224  {
225  return PropertyType::storage;
226  }
227  if (boost::iequals(inString, "thermal_conductivity"))
228  {
230  }
231  if (boost::iequals(inString, "thermal_expansivity"))
232  {
234  }
235  if (boost::iequals(inString, "thermal_longitudinal_dispersivity"))
236  {
238  }
239  if (boost::iequals(inString, "thermal_transversal_dispersivity"))
240  {
242  }
243  if (boost::iequals(inString, "transversal_dispersivity"))
244  {
246  }
247  if (boost::iequals(inString, "viscosity"))
248  {
250  }
251 
252  OGS_FATAL(
253  "The property name '%s' does not correspond to any known property",
254  inString.c_str());
255 
256  return PropertyType::number_of_properties; // to avoid the 'no return'
257  // warning
258 }
259 
260 static const std::array<std::string, PropertyType::number_of_properties>
261  property_enum_to_string{{"acentric_factor",
262  "binary_interaction_coefficient",
263  "biot_coefficient",
264  "brooks_corey_exponent",
265  "bulk_modulus",
266  "critical_density",
267  "critical_pressure",
268  "critical_temperature",
269  "compressibility",
270  "decay_rate",
271  "density",
272  "drhodT",
273  "effective_stress",
274  "entry_pressure",
275  "fredlund_parameters",
276  "heat_capacity",
277  "longitudinal_dispersivity",
278  "molar_mass",
279  "mole_fraction",
280  "molecular_diffusion",
281  "name",
282  "permeability",
283  "phase_velocity",
284  "porosity",
285  "reference_density",
286  "reference_temperature",
287  "reference_pressure",
288  "relative_permeability",
289  "residual_gas_saturation",
290  "residual_liquid_saturation",
291  "retardation_factor",
292  "saturation",
293  "specific_heat_capacity",
294  "storage",
295  "thermal_conductivity",
296  "thermal_expansivity",
297  "thermal_longitudinal_dispersivity",
298  "thermal_transversal_dispersivity",
299  "transversal_dispersivity",
300  "viscosity"}};
301 
305 using PropertyArray =
306  std::array<std::unique_ptr<Property>, PropertyType::number_of_properties>;
307 
308 } // namespace MaterialPropertyLib
used to specify decay rate of a substance.
Definition: PropertyType.h:46
used to compute the hydrodynamic dispersion tensor.
Definition: PropertyType.h:58
static const std::array< std::string, PropertyType::number_of_properties > property_enum_to_string
Definition: PropertyType.h:261
specify retardation factor used in component transport process.
Definition: PropertyType.h:70
used to compute the hydrodynamic dispersion tensor.
Definition: PropertyType.h:54
PropertyType convertStringToProperty(std::string const &inString)
Definition: PropertyType.h:89
used to compute the hydrodynamic dispersion tensor.
Definition: PropertyType.h:79
std::array< std::unique_ptr< Property >, PropertyType::number_of_properties > PropertyArray
#define OGS_FATAL(fmt,...)
Definition: Error.h:64