Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • dumux dumux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 100
    • Issues 100
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 92
    • Merge requests 92
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • dumux-repositoriesdumux-repositories
  • dumuxdumux
  • Issues
  • #448
Closed
Open
Issue created Feb 15, 2018 by Timo Koch@timokOwner

Discussion: Reintroduce model class as a way to specify model properties / Remove TypeTag as template argument whereever feasible

I think it might make sense to reintroduce the model class as a place to specify things associated with a specific mathematical model, e.g. 2-phase 2-component porousmedium flow. In contrast to the old model class this class would know nothing about the linear algebra (solution, Jacobian), temporal or spatial discretization. Its member functions / data members would probably most all be static and constexpr. An idea would be something like


namespace Properties {
SET_PROP(TwoPTwoC, Model)
{
private: 
  // Some easy customization points through the property system
  using FluidSystem = GET_PROP_TYPE(TypeTag, FluidSystem);
  using ...
public:
  // there are quite many template arguments but they can be conveniently set through the property system
  using type = TwoPNCModel<FluidSystem, FluidState, ...>;
};
} // end namespace Properties

template<FSystem, BalanceTraits, ...>
class TwoPNCModel
{
   // model specific constants
   static constexpr std::size_t numEq() { return 2; }
   static constexpr std::size_t numComponents() { return FSystem::numComponents; }

   ....

   // model specific options, template parameters offer customization points through Traits/Policies
   static constexpr bool useMoles() { return BalanceTraits::useMoles(); }

   ...

   // model specific types   
   enum class Index // might be also a struct templated by formulation
   { 
        pressureIdx = 0,
        saturationIdx = 1
   };

   ...

   // model specific functions
   template<typename Scalar>
   static constexpr void checkPhysicalBounds(Scalar priVar, Index i)
   { ... }

   static constexpr void defaultParams(Dune::ParameterTree& params, const std::string& paramGroup = "")
   { ... }

   ...
};

Other classes could get the model as a template parameter and extract a lot of types and other information from it.

Edited Aug 26, 2020 by Bernd Flemisch
Assignee
Assign to
Time tracking