Skip to content
Snippets Groups Projects
Commit 6efb2ee5 authored by Stefan Girke's avatar Stefan Girke
Browse files

fix selection of pass ids

model parameters has got ids from 0 ... modelParameterSize-1,
start pass (u) has got id modelParameterSize and so on...
parent 9db151ad
No related branches found
No related tags found
No related merge requests found
......@@ -78,7 +78,7 @@ namespace Fem
typedef ProblemInterfaceType ProblemType;
typedef ProblemInterfaceType InitialDataType;
typedef HeatEqnModel< GridType, InitialDataType,
std::tuple<> > ModelType;
std::tuple<__f > > ModelType;
template< class Solution, class Model, class ExactFunction, class TimeProvider >
static void addEOCErrors ( TimeProvider& tp, Solution &u, Model &model, ExactFunction &f )
......
......@@ -33,7 +33,7 @@ namespace Fem
static const int thisId = getId<i>();
public:
static const int size = PassIdGenerator<i-1,T>::size + thisId;
static const int id = (thisId <= 0) ? -1 : size;
static const int id = (thisId <= 0) ? -1 : size-1;
};
template< bool... b >
......@@ -42,8 +42,8 @@ namespace Fem
typedef std::tuple< _bool<b>... > T;
public:
//start id
static const int size = -1;
static const int id = size;
static const int size = 0;
static const int id = -1;
};
......
......@@ -31,7 +31,7 @@ namespace Fem
public Fem::SpaceOperatorInterface< typename Traits::DestinationType >
{
// choose ids for the three passes (including start pass) different to the tuple entries
enum PassIdType { u = Traits::ModelType::modelParameterSize + 1 , gradPass = u+1, advectPass = u + 2 };
enum PassIdType { u = Traits::ModelType::modelParameterSize, gradPass = u+1, advectPass = u + 2 };
struct GradientTraits
: public Traits
......@@ -213,7 +213,7 @@ namespace Fem
struct LDGAdvectionTraits : public Traits
{
// choose ids for the two passes (including start pass) different to the tuple entries
enum PassIdType { u = Traits::ModelType::modelParameterSize + 1 , cdgpass = u + 1 };
enum PassIdType { u = Traits::ModelType::modelParameterSize, cdgpass = u + 1 };
typedef AdvectionDiffusionDGPrimalModel
// put a method_none here to avoid diffusion
......@@ -314,7 +314,7 @@ namespace Fem
< typename Traits :: DestinationType >
{
// choose ids for the three passes (including start pass) different to the tuple entries
enum PassIdType { u = Traits::ModelType::modelParameterSize + 1 ,
enum PassIdType { u = Traits::ModelType::modelParameterSize,
limitPassId = u + 1,
gradPassId = u + 2,
advectPassId = u + 3 };
......@@ -530,7 +530,7 @@ namespace Fem
struct AdaptationIndicatorTraits : public Traits
{
// choose ids for the two passes (including start pass) different to the tuple entries
enum PassIdType { u = Traits::ModelType::modelParameterSize + 1 , cdgpass = u + 1 };
enum PassIdType { u = Traits::ModelType::modelParameterSize, cdgpass = u + 1 };
typedef AdaptiveAdvectionDiffusionDGPrimalModel
< Traits, u, advection, diffusion> DiscreteModelType;
......
......@@ -57,7 +57,7 @@ namespace Fem
typedef typename std::tuple_element< i-1, Tuple >::type DiscreteFunction;
typedef Dune::Fem::InsertFunctionPass< DiscreteFunction, PreviousPass, i > PassType;
typedef Dune::Fem::InsertFunctionPass< DiscreteFunction, PreviousPass, i-1 > PassType;
template< class ExtraArgImp >
static std::shared_ptr< PassType > createPass( const std::shared_ptr< ExtraArgImp >& tuple )
......
......@@ -30,7 +30,7 @@ namespace Fem
struct CDGAdvectionDiffusionTraits : public Traits
{
// choose ids different to the tuple entries
enum { u = Traits::ModelType::modelParameterSize + 1 , cdgpass = u + 1 };
enum { u = Traits::ModelType::modelParameterSize , cdgpass = u + 1 };
typedef AdvectionDiffusionDGPrimalModel< Traits, advection, diffusion, u> DiscreteModelType;
};
......@@ -179,7 +179,7 @@ namespace Fem
struct CDGAdaptationIndicatorTraits : public Traits
{
// choose ids different to the tuple entries
enum { u = Traits::ModelType::modelParameterSize + 1 , cdgpass = u + 1 };
enum { u = Traits::ModelType::modelParameterSize, cdgpass = u + 1 };
typedef AdaptiveAdvectionDiffusionDGPrimalModel< Traits, advection, diffusion, u> DiscreteModelType;
};
......
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