OGS 6.1.0-1699-ge946d4c5f
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 {
76 };
77 
83 inline PropertyType convertStringToProperty(std::string const& inString)
84 {
85  if (boost::iequals(inString, "acentric_factor"))
86  {
88  }
89  if (boost::iequals(inString, "binary_interaction_coefficient"))
90  {
92  }
93  if (boost::iequals(inString, "biot_coefficient"))
94  {
96  }
97  if (boost::iequals(inString, "brooks_corey_exponent"))
98  {
100  }
101  if (boost::iequals(inString, "bulk_modulus"))
102  {
104  }
105  if (boost::iequals(inString, "critical_density"))
106  {
108  }
109  if (boost::iequals(inString, "critical_pressure"))
110  {
112  }
113  if (boost::iequals(inString, "critical_temperature"))
114  {
116  }
117  if (boost::iequals(inString, "compressibility"))
118  {
120  }
121  if (boost::iequals(inString, "density"))
122  {
123  return PropertyType::density;
124  }
125  if (boost::iequals(inString, "drhodT"))
126  {
127  return PropertyType::drhodT;
128  }
129  if (boost::iequals(inString, "effective_stress"))
130  {
132  }
133  if (boost::iequals(inString, "entry_pressure"))
134  {
136  }
137  if (boost::iequals(inString, "fredlund_parameters"))
138  {
140  }
141  if (boost::iequals(inString, "heat_capacity"))
142  {
144  }
145  if (boost::iequals(inString, "longitudinal_dispersivity"))
146  {
148  }
149  if (boost::iequals(inString, "molar_mass"))
150  {
152  }
153  if (boost::iequals(inString, "mole_fraction"))
154  {
156  }
157  if (boost::iequals(inString, "molecular_diffusion"))
158  {
160  }
161  if (boost::iequals(inString, "name"))
162  {
163  return PropertyType::name;
164  }
165  if (boost::iequals(inString, "permeability"))
166  {
168  }
169  if (boost::iequals(inString, "porosity"))
170  {
171  return PropertyType::porosity;
172  }
173  if (boost::iequals(inString, "phase_velocity"))
174  {
176  }
177  if (boost::iequals(inString, "reference_density"))
178  {
180  }
181  if (boost::iequals(inString, "reference_temperature"))
182  {
184  }
185  if (boost::iequals(inString, "reference_pressure"))
186  {
188  }
189  if (boost::iequals(inString, "relative_permeability"))
190  {
192  }
193  if (boost::iequals(inString, "residual_gas_saturation"))
194  {
196  }
197  if (boost::iequals(inString, "residual_liquid_saturation"))
198  {
200  }
201  if (boost::iequals(inString, "saturation"))
202  {
204  }
205  if (boost::iequals(inString, "specific_heat_capacity"))
206  {
208  }
209  if (boost::iequals(inString, "thermal_conductivity"))
210  {
212  }
213  if (boost::iequals(inString, "thermal_expansivity"))
214  {
216  }
217  if (boost::iequals(inString, "transversal_dispersivity"))
218  {
220  }
221  if (boost::iequals(inString, "viscosity"))
222  {
224  }
225 
226  OGS_FATAL(
227  "The property name '%s' does not correspond to any known property",
228  inString.c_str());
229 
230  return PropertyType::number_of_properties; // to avoid the 'no return'
231  // warning
232 }
233 
234 static const std::array<std::string, PropertyType::number_of_properties>
235  property_enum_to_string{{"acentric_factor",
236  "binary_interaction_coefficient",
237  "biot_coefficient",
238  "brooks_corey_exponent",
239  "bulk_modulus",
240  "critical_density",
241  "critical_pressure",
242  "critical_temperature",
243  "compressibility",
244  "density",
245  "drhodT",
246  "effective_stress",
247  "entry_pressure",
248  "fredlund_parameters",
249  "heat_capacity",
250  "longitudinal_dispersivity",
251  "molar_mass",
252  "mole_fraction",
253  "molecular_diffusion",
254  "name",
255  "permeability",
256  "phase_velocity",
257  "porosity",
258  "reference_density",
259  "reference_temperature",
260  "reference_pressure",
261  "relative_permeability",
262  "residual_gas_saturation",
263  "residual_liquid_saturation",
264  "saturation",
265  "specific_heat_capacity",
266  "thermal_conductivity",
267  "thermal_expansivity",
268  "transversal_dispersivity",
269  "viscosity"}};
270 
274 using PropertyArray =
275  std::array<std::unique_ptr<Property>, PropertyType::number_of_properties>;
276 
277 } // 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:235
used to compute the hydrodynamic dispersion tensor.
Definition: PropertyType.h:53
PropertyType convertStringToProperty(std::string const &inString)
Definition: PropertyType.h:83
used to compute the hydrodynamic dispersion tensor.
Definition: PropertyType.h:73
std::array< std::unique_ptr< Property >, PropertyType::number_of_properties > PropertyArray
#define OGS_FATAL(fmt,...)
Definition: Error.h:71