<commit_before>#ifndef DUNE_DETAILED_SOLVERS_LINEARELLIPTIC_MODEL_HH
#define DUNE_DETAILED_SOLVERS_LINEARELLIPTIC_MODEL_HH

#include <dune/common/exceptions.hh>
#include <dune/common/parametertree.hh>

#include <dune/stuff/common/color.hh>

#include "model/interface.hh"
#include "model/default.hh"
#include "model/thermalblock.hh"
#include "model/affineparametric/default.hh"
#include "model/affineparametric/twophase.hh"
#include "model/affineparametric/thermalblock.hh"

namespace Dune {
namespace DetailedSolvers {
namespace LinearElliptic {


template< class DomainFieldType, int dimDomain, class RangeFieldType, int dimRange >
class Models
{
public:
  static std::vector< std::string > available()
  {
    return {
        "model.linearelliptic.default"
        , "model.linearelliptic.thermalblock"
        , "model.linearelliptic.affineparametric.default"
        , "model.linearelliptic.affineparametric.twophase"
        , "model.linearelliptic.affineparametric.thermalblock"
    };
  } // ... available()

  static Dune::ParameterTree createSampleDescription(const std::string type)
  {
    if (type == "model.linearelliptic.default")
      return ModelDefault< DomainFieldType, dimDomain, RangeFieldType, dimRange >::createSampleDescription();
    else if (type == "model.linearelliptic.thermalblock")
      return ModelThermalblock< DomainFieldType, dimDomain, RangeFieldType, dimRange >::createSampleDescription();
    else if (type == "model.linearelliptic.affineparametric.default")
      return ModelAffineParametricDefault<  DomainFieldType, dimDomain,
                                            RangeFieldType, dimRange >::createSampleDescription();
    else if (type == "model.linearelliptic.affineparametric.twophase")
      return ModelAffineParametricTwoPhase< DomainFieldType, dimDomain,
                                            RangeFieldType, dimRange >::createSampleDescription();
    else if (type == "model.linearelliptic.affineparametric.thermalblock")
      return ModelAffineParametricThermalblock< DomainFieldType, dimDomain,
                                                RangeFieldType, dimRange >::createSampleDescription();
    else
      DUNE_THROW(Dune::RangeError,
                 "\n" << Dune::Stuff::Common::colorStringRed("ERROR:") << " unknown model '" << type << "' requested!");
  } // ... createSampleDescription(...)

  static ModelInterface< DomainFieldType, dimDomain, RangeFieldType, dimRange >*
  create(const std::string type = available()[0],
           const Dune::ParameterTree description = Dune::ParameterTree())
  {
    if (type == "model.linearelliptic.default")
      return ModelDefault< DomainFieldType, dimDomain, RangeFieldType, dimRange >::create(description);
    else if (type == "model.linearelliptic.thermalblock")
      return ModelThermalblock< DomainFieldType, dimDomain, RangeFieldType, dimRange >::create(description);
    else if (type == "model.linearelliptic.affineparametric.default")
      return ModelAffineParametricDefault<  DomainFieldType, dimDomain,<commit_msg>[linearelliptic.model] added subname to createSampleDescription()<commit_after>#ifndef DUNE_DETAILED_SOLVERS_LINEARELLIPTIC_MODEL_HH
#define DUNE_DETAILED_SOLVERS_LINEARELLIPTIC_MODEL_HH

#include <dune/common/exceptions.hh>
#include <dune/common/parametertree.hh>

#include <dune/stuff/common/color.hh>

#include "model/interface.hh"
#include "model/default.hh"
#include "model/thermalblock.hh"
#include "model/affineparametric/default.hh"
#include "model/affineparametric/twophase.hh"
#include "model/affineparametric/thermalblock.hh"

namespace Dune {
namespace DetailedSolvers {
namespace LinearElliptic {


template< class DomainFieldType, int dimDomain, class RangeFieldType, int dimRange >
class Models
{
public:
  static std::vector< std::string > available()
  {
    return {
        "model.linearelliptic.default"
        , "model.linearelliptic.thermalblock"
        , "model.linearelliptic.affineparametric.default"
        , "model.linearelliptic.affineparametric.twophase"
        , "model.linearelliptic.affineparametric.thermalblock"
    };
  } // ... available()

  static Dune::ParameterTree createSampleDescription(const std::string type, const std::string subname = "")
  {
    if (type == "model.linearelliptic.default")
      return ModelDefault< DomainFieldType, dimDomain, RangeFieldType, dimRange >::createSampleDescription(subname);
    else if (type == "model.linearelliptic.thermalblock")
      return ModelThermalblock< DomainFieldType, dimDomain, RangeFieldType, dimRange >::createSampleDescription(subname);
    else if (type == "model.linearelliptic.affineparametric.default")
      return ModelAffineParametricDefault<  DomainFieldType, dimDomain,
                                            RangeFieldType, dimRange >::createSampleDescription(subname);
    else if (type == "model.linearelliptic.affineparametric.twophase")
      return ModelAffineParametricTwoPhase< DomainFieldType, dimDomain,
                                            RangeFieldType, dimRange >::createSampleDescription(subname);
    else if (type == "model.linearelliptic.affineparametric.thermalblock")
      return ModelAffineParametricThermalblock< DomainFieldType, dimDomain,
                                                RangeFieldType, dimRange >::createSampleDescription(subname);
    else
      DUNE_THROW(Dune::RangeError,
                 "\n" << Dune::Stuff::Common::colorStringRed("ERROR:") << " unknown model '" << type << "' requested!");
  } // ... createSampleDescription(...)

  static ModelInterface< DomainFieldType, dimDomain, RangeFieldType, dimRange >*
  create(const std::string type = available()[0],
           const Dune::ParameterTree description = Dune::ParameterTree())
  {
    if (type == "model.linearelliptic.default")
      return ModelDefault< DomainFieldType, dimDomain, RangeFieldType, dimRange >::create(description);
    else if (type == "model.linearelliptic.thermalblock")
      return ModelThermalblock< DomainFieldType, dimDomain, RangeFieldType, dimRange >::create(description);
    else if (type == "model.linearelliptic.affineparametric.default")
      return ModelAffineParametricDefault<  DomainFieldType, dimDomain,
{'fraction_non_alphanumeric': 0.10843373493975904, 'fraction_numerical': 0.000321285140562249, 'mean_word_length': 4.124279835390946, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3622079', 'n_tokens_mistral': 1844, 'n_tokens_neox': 1736, 'n_words': 330}