Commit 785b291c authored by Timo Koch's avatar Timo Koch
Browse files

[navierstokes][problem] Do not expose discretization methods in problem

This created some unresolved dependenices due to the cyclic interdependency
of problem and coupling manager. This worked before because the discretizaiton
method was always one specific type. With tags the actual type has to be known,
so both problems and the coupling manager have to be instatiated before this
information can be accessed.
parent 5a5764b6
......@@ -32,41 +32,6 @@
#include <dumux/discretization/method.hh>
#include <dumux/freeflow/navierstokes/momentum/boundarytypes.hh>
namespace Dumux::Detail {
//! Helper class to get the discretization method of the mass and momentum model
//! Helps to make the Navier-Stokes problem usable in an uncoupled context
template<class CouplingManager>
class DiscMethod
{
public:
static constexpr DiscretizationMethod momentum()
{
if constexpr (std::is_empty_v<CouplingManager>)
return DiscretizationMethod::none;
else
return discMethod_(CouplingManager::freeFlowMomentumIndex);
}
static constexpr DiscretizationMethod mass()
{
if constexpr (std::is_empty_v<CouplingManager>)
return DiscretizationMethod::none;
else
return discMethod_(CouplingManager::freeFlowMassIndex);
}
private:
template<class IdxType>
static constexpr DiscretizationMethod discMethod_(IdxType idx)
{
using GridGeometry = std::decay_t<decltype(std::declval<CouplingManager>().problem(idx).gridGeometry())>;
return GridGeometry::discMethod;
}
};
} // end namespace Dumux::Detail
namespace Dumux {
//! The implementation is specialized for the different discretizations
......@@ -146,12 +111,6 @@ public:
//! This problem is used for the momentum balance model.
static constexpr bool isMomentumProblem() { return true; }
//! Export the discretization method for the momentum problem.
static constexpr DiscretizationMethod momentumDiscretizationMethod = GridGeometry::discMethod;
//! Export the discretization method for the mass problem.
static constexpr DiscretizationMethod massDiscretizationMethod = Detail::DiscMethod<CouplingManager>::mass();
/*!
* \brief The constructor
* \param gridGeometry The finite volume grid geometry
......@@ -614,12 +573,6 @@ public:
//! this problem is used for the mass balance model
static constexpr bool isMomentumProblem() { return false; }
//! Export the discretization method for the momentum problem.
static constexpr DiscretizationMethod momentumDiscretizationMethod = Detail::DiscMethod<CouplingManager>::momentum();
//! Export the discretization method for the mass problem.
static constexpr DiscretizationMethod massDiscretizationMethod = GridGeometry::discMethod;
/*!
* \brief The constructor
* \param gridGeometry The finite volume grid geometry
......
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