Skip to content
Snippets Groups Projects
Select Git revision
  • e3fe3b4d84a2bf690bd0b83bb3ef38d9bfe088c2
  • master default
  • 6.5.5
  • 6.5.4
  • 6.5.3
  • 6.5.2
  • 6.5.1
  • 6.5.0
  • 6.4.4
  • 6.4.3
  • 6.4.2
  • 6.4.1
  • 6.4.0
  • 6.3.3
  • data-explorer-5
  • 6.3.2
  • 6.3.1
  • 6.3.0
  • 6.2.2
  • 6.2.1
  • 6.2.0
  • 6.2.0-rc1
22 results
An error occurred while fetching branches. Retry the search.

VariableType.cpp

Blame
  • Forked from ogs / ogs
    15687 commits behind the upstream repository.
    Thomas Fischer's avatar
    Tom Fischer authored and Dmitri Naumov committed
    e3fe3b4d
    History
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    VariableType.cpp 1.38 KiB
    /**
     * \file
     *
     * \copyright
     * Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org)
     *            Distributed under a Modified BSD License.
     *              See accompanying file LICENSE.txt or
     *              http://www.opengeosys.org/project/license
     *
     */
    
    #include "VariableType.h"
    #include <boost/algorithm/string/predicate.hpp>
    #include "BaseLib/Error.h"
    
    namespace MaterialPropertyLib
    {
    Variables convertStringToVariable(std::string const& input)
    {
        if (boost::iequals(input, "phase_pressure"))
        {
            return Variables::phase_pressure;
        }
        if (boost::iequals(input, "capillary_pressure"))
        {
            return Variables::capillary_pressure;
        }
        if (boost::iequals(input, "gas_density"))
        {
            return Variables::gas_density;
        }
        if (boost::iequals(input, "liquid_density"))
        {
            return Variables::liquid_density;
        }
        if (boost::iequals(input, "temperature"))
        {
            return Variables::temperature;
        }
        if (boost::iequals(input, "liquid_saturation"))
        {
            return Variables::liquid_saturation;
        }
        if (boost::iequals(input, "u"))
        {
            return Variables::u;
        }
    
        OGS_FATAL(
            "The variable name '%s' does not correspond to any known variable",
            input.c_str());
    
        return Variables::number_of_variables;  // to avoid the 'no return' warning
    }
    }  // namespace MaterialPropertyLib