Commit 4d844681 authored by Martin Schneider's avatar Martin Schneider

Merge branch 'feature/char-to-string' into 'master'

[cleanup] char* to std::string for type safety

See merge request !33
parents 4dd0c102 08a8cf1c
......@@ -14,7 +14,7 @@
struct TabulatedDensityTraits {
typedef double Scalar;
static const char *name;
static const std::string name;
static const int numTempSteps = 50;
static constexpr Scalar minTemp = 2.900000000000000e+02;
static constexpr Scalar maxTemp = 3.400000000000000e+02;
......@@ -24,7 +24,7 @@ struct TabulatedDensityTraits {
static const Scalar vals[numTempSteps][numPressSteps];
};
const char *TabulatedDensityTraits::name = "density";
const std::string TabulatedDensityTraits::name = "density";
const double TabulatedDensityTraits::vals[50][495] =
{
......@@ -5084,7 +5084,7 @@ typedef TabulatedCO2Properties< TabulatedDensityTraits > TabulatedDensity;
struct TabulatedEnthalpyTraits {
typedef double Scalar;
static const char *name;
static const std::string name;
static const int numTempSteps = 50;
static constexpr Scalar minTemp = 2.900000000000000e+02;
static constexpr Scalar maxTemp = 3.400000000000000e+02;
......@@ -5094,7 +5094,7 @@ struct TabulatedEnthalpyTraits {
static const Scalar vals[numTempSteps][numPressSteps];
};
const char *TabulatedEnthalpyTraits::name = "enthalpy";
const std::string TabulatedEnthalpyTraits::name = "enthalpy";
const double TabulatedEnthalpyTraits::vals[50][495] =
{
......@@ -174,7 +174,7 @@ public:
*
* This is used as a prefix for files generated by the simulation.
*/
const char *name() const
std::string name() const
{
return "lens-2p2c";
}
......
......@@ -186,7 +186,7 @@ public:
*
* This is used as a prefix for files generated by the simulation.
*/
const char *name() const
std::string name() const
{ return "lens-2p"; }
/*!
......
......@@ -192,7 +192,7 @@ public:
*
* This is used as a prefix for files generated by the simulation.
*/
const char *name() const
std::string name() const
{ return "lens-2p"; }
/*!
......
......@@ -202,7 +202,7 @@ public:
*
* This is used as a prefix for files generated by the simulation.
*/
const char *name() const
std::string name() const
{ return "lens-2p"; }
/*!
......
......@@ -214,7 +214,7 @@ public:
*
* This is used as a prefix for files generated by the simulation.
*/
const char *name() const
std::string name() const
{ return "groundwater"; }
bool shouldWriteRestartFile() const
......
......@@ -41,7 +41,7 @@ public:
/*!
* \brief A human readable name for the water.
*/
static const char *name()
static std::string name()
{ return "H2O"; }
/*!
......
......@@ -43,7 +43,7 @@ public:
/*!
* \brief A human readable name for the water.
*/
static const char *name()
static std::string name()
{ return "Oil"; }
/*!
......
......@@ -131,7 +131,7 @@ public:
*
* This is used as a prefix for files generated by the simulation.
*/
const char *name() const
std::string name() const
{ return "columnxylol"; }
......
......@@ -137,7 +137,7 @@ public:
*
* This is used as a prefix for files generated by the simulation.
*/
const char *name() const
std::string name() const
{ return "columnxylol"; }
......
......@@ -137,7 +137,7 @@ public:
*
* This is used as a prefix for files generated by the simulation.
*/
const char *name() const
std::string name() const
{ return "heatpipe"; }
void sourceAtPos(PrimaryVariables &values,
......
......@@ -136,7 +136,7 @@ public:
*
* This is used as a prefix for files generated by the simulation.
*/
const char *name() const
std::string name() const
{ return "Henry1p2c"; }
/*!
......
......@@ -77,10 +77,10 @@ public:
*
* \param phaseIdx The index of the fluid phase to consider
*/
static const char *phaseName(int phaseIdx)
static std::string phaseName(int phaseIdx)
{
static const char *name[] = {
"l"
static const std::string name[] = {
std::string("l")
};
assert(0 <= phaseIdx && phaseIdx < numPhases);
......@@ -153,11 +153,11 @@ public:
*
* \param compIdx The index of the component to consider
*/
static const char *componentName(int compIdx)
static std::string componentName(int compIdx)
{
static const char *name[] = {
"Water",
"Salt"
static const std::string name[] = {
std::string("Water"),
std::string("Salt")
};
assert(0 <= compIdx && compIdx < numComponents);
......
......@@ -181,7 +181,7 @@ public:
*
* This is used as a prefix for files generated by the simulation.
*/
const char *name() const
std::string name() const
{ return "Henry2p"; }
/*!
......
......@@ -52,7 +52,7 @@ public:
/*!
* \brief A human readable name for the water.
*/
static const char *name()
static std::string name()
{ return "H2O"; }
/*!
......
......@@ -186,7 +186,7 @@ public:
/*!
* \brief Return the human readable name of a phase (used in indices)
*/
static const char *phaseName(int phaseIdx)
static std::string phaseName(int phaseIdx)
{
switch (phaseIdx) {
case wPhaseIdx: return "w";
......@@ -199,7 +199,7 @@ public:
/*!
* \brief Return the human readable name of a component (used in indices)
*/
static const char *componentName(int compIdx)
static std::string componentName(int compIdx)
{
switch (compIdx) {
case H2OIdx: return H2O::name();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment