OGS 6.2.0-405-gb717f6088
PropertyType.h
Go to the documentation of this file.
1 
14 #pragma once
15 
16 #include <array>
17 #include <boost/algorithm/string/predicate.hpp>
18 #include <memory>
19 #include <string>
20 #include "BaseLib/Error.h"
21 
22 namespace MaterialPropertyLib
23 {
24 class Property;
25 }
26 
27 namespace MaterialPropertyLib
28 {
35 enum PropertyType : int
36 {
79 };
80 
86 inline PropertyType convertStringToProperty(std::string const& inString)
87 {
88  if (boost::iequals(inString, "acentric_factor"))
89  {
91  }
92  if (boost::iequals(inString, "binary_interaction_coefficient"))
93  {
95  }
96  if (boost::iequals(inString, "biot_coefficient"))
97  {
99  }
100  if (boost::iequals(inString, "brooks_corey_exponent"))
101  {
103  }
104  if (boost::iequals(inString, "bulk_modulus"))
105  {
107  }
108  if (boost::iequals(inString, "critical_density"))
109  {
111  }
112  if (boost::iequals(inString, "critical_pressure"))
113  {
115  }
116  if (boost::iequals(inString, "critical_temperature"))
117  {
119  }
120  if (boost::iequals(inString, "compressibility"))
121  {
123  }
124  if (boost::iequals(inString, "density"))
125  {
126  return PropertyType::density;
127  }
128  if (boost::iequals(inString, "drhodT"))
129  {
130  return PropertyType::drhodT;
131  }
132  if (boost::iequals(inString, "effective_stress"))
133  {
135  }
136  if (boost::iequals(inString, "entry_pressure"))
137  {
139  }
140  if (boost::iequals(inString, "fredlund_parameters"))
141  {
143  }
144  if (boost::iequals(inString, "heat_capacity"))
145  {
147  }
148  if (boost::iequals(inString, "longitudinal_dispersivity"))
149  {
151  }
152  if (boost::iequals(inString, "molar_mass"))
153  {
155  }
156  if (boost::iequals(inString, "mole_fraction"))
157  {
159  }
160  if (boost::iequals(inString, "molecular_diffusion"))
161  {
163  }
164  if (boost::iequals(inString, "name"))
165  {
166  return PropertyType::name;
167  }
168  if (boost::iequals(inString, "permeability"))
169  {
171  }
172  if (boost::iequals(inString, "porosity"))
173  {
174  return PropertyType::porosity;
175  }
176  if (boost::iequals(inString, "phase_velocity"))
177  {
179  }
180  if (boost::iequals(inString, "reference_density"))
181  {
183  }
184  if (boost::iequals(inString, "reference_temperature"))
185  {
187  }
188  if (boost::iequals(inString, "reference_pressure"))
189  {
191  }
192  if (boost::iequals(inString, "relative_permeability"))
193  {
195  }
196  if (boost::iequals(inString, "residual_gas_saturation"))
197  {
199  }
200  if (boost::iequals(inString, "residual_liquid_saturation"))
201  {
203  }
204  if (boost::iequals(inString, "saturation"))
205  {
207  }
208  if (boost::iequals(inString, "specific_heat_capacity"))
209  {
211  }
212  if (boost::iequals(inString, "storage"))
213  {
214  return PropertyType::storage;
215  }
216  if (boost::iequals(inString, "thermal_conductivity"))
217  {
219  }
220  if (boost::iequals(inString, "thermal_expansivity"))
221  {
223  }
224  if (boost::iequals(inString, "thermal_longitudinal_dispersivity"))
225  {
227  }
228  if (boost::iequals(inString, "thermal_transversal_dispersivity"))
229  {
231  }
232  if (boost::iequals(inString, "transversal_dispersivity"))
233  {
235  }
236  if (boost::iequals(inString, "viscosity"))
237  {
239  }
240 
241  OGS_FATAL(
242  "The property name '%s' does not correspond to any known property",
243  inString.c_str());
244 
245  return PropertyType::number_of_properties; // to avoid the 'no return'
246  // warning
247 }
248 
249 static const std::array<std::string, PropertyType::number_of_properties>
250  property_enum_to_string{{"acentric_factor",
251  "binary_interaction_coefficient",
252  "biot_coefficient",
253  "brooks_corey_exponent",
254  "bulk_modulus",
255  "critical_density",
256  "critical_pressure",
257  "critical_temperature",
258  "compressibility",
259  "density",
260  "drhodT",
261  "effective_stress",
262  "entry_pressure",
263  "fredlund_parameters",
264  "heat_capacity",
265  "longitudinal_dispersivity",
266  "molar_mass",
267  "mole_fraction",
268  "molecular_diffusion",
269  "name",
270  "permeability",
271  "phase_velocity",
272  "porosity",
273  "reference_density",
274  "reference_temperature",
275  "reference_pressure",
276  "relative_permeability",
277  "residual_gas_saturation",
278  "residual_liquid_saturation",
279  "saturation",
280  "specific_heat_capacity",
281  "storage",
282  "thermal_conductivity",
283  "thermal_expansivity",
284  "thermal_longitudinal_dispersivity",
285  "thermal_transversal_dispersivity",
286  "transversal_dispersivity",
287  "viscosity"}};
288 
292 using PropertyArray =
293  std::array<std::unique_ptr<Property>, PropertyType::number_of_properties>;
294 
295 } // namespace MaterialPropertyLib
used to compute the hydrodynamic dispersion tensor.
Definition: PropertyType.h:57
static const std::array< std::string, PropertyType::number_of_properties > property_enum_to_string
Definition: PropertyType.h:250
used to compute the hydrodynamic dispersion tensor.
Definition: PropertyType.h:53
PropertyType convertStringToProperty(std::string const &inString)
Definition: PropertyType.h:86
used to compute the hydrodynamic dispersion tensor.
Definition: PropertyType.h:76
std::array< std::unique_ptr< Property >, PropertyType::number_of_properties > PropertyArray
#define OGS_FATAL(fmt,...)
Definition: Error.h:63