diff --git a/dune/fem-dg/examples/euler/problems.hh b/dune/fem-dg/examples/euler/problems.hh index 422af3df05a14303eef8a9e60b0922cb8cd6cb93..5b6425a17612e9fa23b306789d3110116802edb1 100644 --- a/dune/fem-dg/examples/euler/problems.hh +++ b/dune/fem-dg/examples/euler/problems.hh @@ -14,8 +14,10 @@ namespace Fem static ProblemInterfaceType* apply() { + //const std::string problemNames [] + // = { "sod" , "smooth1d" , "ffs" , "diffraction" , "shockbubble", "p123" }; const std::string problemNames [] - = { "sod" , "withman", "withmansmooth", "smooth1d" , "ffs" , "diffraction" , "shockbubble", "p123" }; + = { "sod" , "smooth1d" , "ffs" , "diffraction" , "shockbubble", "riemann" }; const int problemNumber = Fem :: Parameter :: getEnum ( "problem" , problemNames ); @@ -27,8 +29,9 @@ namespace Fem return new U0Smooth1D< GridImp > (); else if( problemNames[ problemNumber ] == "ffs" ) return new U0FFS< GridImp > (); - else if( problemNames[ problemNumber ] == "p123" ) - return new U0P123< GridImp >(); + else if( problemNames[ problemNumber ] == "riemann" ) + return new RiemannProblem< GridImp >(); + std::cerr << "Error: Problem " << problemNames[ problemNumber ] << " not implemented." << std::endl; diff --git a/dune/fem-dg/examples/euler/problems/problems.hh b/dune/fem-dg/examples/euler/problems/problems.hh index ba81d8860fd1876a378a982321e48151c5d01872..82b661791b8750930b2c23592b1836b6abb48856 100644 --- a/dune/fem-dg/examples/euler/problems/problems.hh +++ b/dune/fem-dg/examples/euler/problems/problems.hh @@ -427,7 +427,7 @@ namespace Fem * \ingroup EulerProblems */ template< class Grid > - class U0P123 + class RiemannProblem : public ProblemBase< Grid > { typedef ProblemBase< Grid > BaseType; @@ -435,7 +435,9 @@ namespace Fem static const int dimension = Grid::dimension; double T, startTime; - Dune::Fem::FieldVectorAdapter< FieldVector< double, 6 > > Ulr; + + typedef Dune::Fem::FieldVectorAdapter< FieldVector< double, 6 > > RiemannDataType; + RiemannDataType Ulr; public: typedef typename BaseType::RangeType RangeType; @@ -450,21 +452,23 @@ namespace Fem static const int dimRange = dimDomain + 2; static const int energ = dimRange - 1; - U0P123 () - : T( 0.4 ), - startTime( 0 ) + RiemannProblem () + : T( 0.15 ), startTime( 0 ) { - myName = "RP-123"; + myName = "RP"; - Ulr[0] = 1.0; - Ulr[3] = 1.0; - Ulr[1] = -2.0; - Ulr[4] = 2.0; - Ulr[2] = 0.4; - Ulr[5] = 0.4; + FieldVector<double,6> data; + data[ 0 ] = 1.0; + data[ 3 ] = 1.0; + data[ 1 ] = -2.0; + data[ 4 ] = 2.0; + data[ 2 ] = 0.4; + data[ 5 ] = 0.4; T = ParameterType::template getValue<double>( "femdg.stepper.endtime"/*, T*/ ); ParameterType::get( "femdg.stepper.starttime", startTime, startTime ); + data = ParameterType::getValue("riemanndata", data ); + for(int i=0; i<6; ++i ) Ulr[ i ] = data[ i ]; } int boundaryId ( const int id ) const @@ -536,7 +540,6 @@ namespace Fem }; - #if 0 /*****************************************************************/ // Diffraction diff --git a/dune/fem-dg/examples/euler/test/parameter_cmake b/dune/fem-dg/examples/euler/test/parameter_cmake index dbb276161bb07527b5aa7c1caa36ad394f9acfa7..7996efeac5f52040fec031832aeedfa44cd68cd1 100644 --- a/dune/fem-dg/examples/euler/test/parameter_cmake +++ b/dune/fem-dg/examples/euler/test/parameter_cmake @@ -1,9 +1,9 @@ # PROBLEM SELECTION #------------------ # possible: "sod" , "withman", "withmansmooth", "smooth1d" , "ffs" , "diffraction" , "shockbubble" -problem: sod +problem: riemann # problemflag: 0 -# riemanndata: [1., -1., 1., 1., 1., 1.] +# riemanndata: [1., -2., 0.4, 1., 2., 0.4] # LIMITER SETTINGS #-----------------