Skip to content
Snippets Groups Projects
Forked from agnumpde / dune-tectonic
140 commits behind the upstream repository.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
enum_friction_model.cc 365 B
#include <dune/common/exceptions.hh>

#include "enums.hh"

template <> struct StringToEnum<Config::FrictionModel> {
  static Config::FrictionModel convert(std::string const &s) {
    if (s == "Truncated")
      return Config::Truncated;

    if (s == "Regularised")
      return Config::Regularised;

    DUNE_THROW(Dune::Exception, "failed to parse enum");
  }
};