Skip to content
Snippets Groups Projects
Commit a7ef1e62 authored by Robert K's avatar Robert K
Browse files

[cleanup] renamed U0P123 to RiemannProblem and make initial data available via parameter

file.
parent 9631012e
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
......@@ -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
......
# 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
#-----------------
......
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