Skip to content
Snippets Groups Projects
Commit 0f51b794 authored by Robert Kloefkorn's avatar Robert Kloefkorn
Browse files

make problem a template parameter.

parent f8abc91f
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,7 @@
// local includes
#include <dune/fem-dg/models/defaultmodel.hh>
#include <dune/fem-dg/operator/limiter/limitpass.hh>
#include "thermodynamics.hh"
#include "ns_model_spec.hh"
......@@ -18,10 +19,11 @@ namespace Dune {
// NAVIER-STOKES EQNS
//
//////////////////////////////////////////////////////
template< class GridPart >
template< class GridPart, class Problem >
class NSModelTraits
{
public:
typedef Problem ProblemType;
typedef GridPart GridPartType;
typedef typename GridPart :: GridType GridType;
enum { dimDomain = GridType :: dimensionworld };
......@@ -57,12 +59,12 @@ class NSModelTraits
template< class GridPartType , class ProblemImp >
class NSModel : public DefaultModel < NSModelTraits< GridPartType > >
class NSModel : public DefaultModel < NSModelTraits< GridPartType, ProblemImp > >
{
public:
typedef ProblemImp ProblemType;
typedef typename GridPartType::GridType GridType;
typedef NSModelTraits< GridPartType > Traits;
typedef NSModelTraits< GridPartType, ProblemType > Traits;
typedef NSFlux< Traits > FluxType ;
......
......@@ -21,6 +21,7 @@ class NSFlux
enum { dimGradRange = dimRange * dimDomain };
public:
typedef typename Traits::ProblemType ProblemType;
typedef typename Traits::DomainType DomainType;
typedef typename Traits::RangeType RangeType;
typedef Dune::FieldVector< double, dimGradRange > GradientRangeType;
......@@ -31,7 +32,7 @@ public:
ConvertedJacobianRangeType;
typedef Dune::FieldMatrix< double, dimDomain, dimDomain > VelocityGradientType;
NSFlux( const NSProblemType& problem )
NSFlux( const ProblemType& problem )
: eulerFlux_()
, problem_( problem )
, gamma_( problem.gamma() )
......@@ -78,7 +79,7 @@ public:
protected:
const EulerAnalyticalFlux<dimDomain> eulerFlux_;
const NSProblemType& problem_;
const ProblemType& problem_;
const double gamma_;
const double R_d_inv_;
const double Re_inv_;
......
......@@ -14,7 +14,7 @@
// local includes
#include <dune/fem-dg/operator/fluxes/eulerfluxes.hh>
#include <dune/fem-dg/operator/fluxes/diffusionflux.hh>
#include "problemtype.hh"
#include "nswaves.hh"
#include "ns_model.hh"
#include <dune/fem-dg/stepper/base.hh>
......@@ -23,12 +23,12 @@
template< class GridType >
struct ProblemGenerator
{
typedef NSProblemType ProblemType;
typedef NSWaves< GridType > ProblemType;
template< class GridPart >
struct Traits
{
typedef ProblemType InitialDataType;
typedef ProblemType InitialDataType;
typedef Dune::NSModel< GridPart, InitialDataType > ModelType;
// choice of diffusion flux (see diffusionflux.hh for methods)
static const Dune :: DGDiffusionFluxIdentifier PrimalDiffusionFluxId
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment