Commit 8551920d authored by Kilian Weishaupt's avatar Kilian Weishaupt
Browse files

Removed try and catch blocks from test problem files.

Reviewed by Gabriele and Johannes


git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@14323 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent 4f7ba464
...@@ -58,8 +58,6 @@ public: ...@@ -58,8 +58,6 @@ public:
OnePTestSpatialParams(const GridView& gridView) OnePTestSpatialParams(const GridView& gridView)
: ParentType(gridView) : ParentType(gridView)
{ {
try
{
lensLowerLeft_[0] = GET_RUNTIME_PARAM(TypeTag, Scalar, SpatialParams.LensLowerLeftX); lensLowerLeft_[0] = GET_RUNTIME_PARAM(TypeTag, Scalar, SpatialParams.LensLowerLeftX);
if (dimWorld > 1) if (dimWorld > 1)
lensLowerLeft_[1] = GET_RUNTIME_PARAM(TypeTag, Scalar, SpatialParams.LensLowerLeftY); lensLowerLeft_[1] = GET_RUNTIME_PARAM(TypeTag, Scalar, SpatialParams.LensLowerLeftY);
...@@ -74,15 +72,6 @@ public: ...@@ -74,15 +72,6 @@ public:
permeability_ = GET_RUNTIME_PARAM(TypeTag, Scalar, SpatialParams.Permeability); permeability_ = GET_RUNTIME_PARAM(TypeTag, Scalar, SpatialParams.Permeability);
permeabilityLens_=GET_RUNTIME_PARAM(TypeTag, Scalar, SpatialParams.PermeabilityLens); permeabilityLens_=GET_RUNTIME_PARAM(TypeTag, Scalar, SpatialParams.PermeabilityLens);
}
catch (Dumux::ParameterException &e) {
std::cerr << e << ". Abort!\n";
exit(1) ;
}
catch (...) {
std::cerr << "Unknown exception thrown!\n";
exit(1);
}
} }
/*! /*!
......
...@@ -98,21 +98,10 @@ public: ...@@ -98,21 +98,10 @@ public:
LensSpatialParams(const GridView& gridView) LensSpatialParams(const GridView& gridView)
: ParentType(gridView) : ParentType(gridView)
{ {
try
{
lensLowerLeft_[0] = GET_RUNTIME_PARAM(TypeTag, Scalar, SpatialParams.LensLowerLeftX); lensLowerLeft_[0] = GET_RUNTIME_PARAM(TypeTag, Scalar, SpatialParams.LensLowerLeftX);
lensLowerLeft_[1] = GET_RUNTIME_PARAM(TypeTag, Scalar, SpatialParams.LensLowerLeftY); lensLowerLeft_[1] = GET_RUNTIME_PARAM(TypeTag, Scalar, SpatialParams.LensLowerLeftY);
lensUpperRight_[0] = GET_RUNTIME_PARAM(TypeTag, Scalar, SpatialParams.LensUpperRightX); lensUpperRight_[0] = GET_RUNTIME_PARAM(TypeTag, Scalar, SpatialParams.LensUpperRightX);
lensUpperRight_[1] = GET_RUNTIME_PARAM(TypeTag, Scalar, SpatialParams.LensUpperRightY); lensUpperRight_[1] = GET_RUNTIME_PARAM(TypeTag, Scalar, SpatialParams.LensUpperRightY);
}
catch (Dumux::ParameterException &e) {
std::cerr << e << ". Abort!\n";
exit(1) ;
}
catch (...) {
std::cerr << "Unknown exception thrown!\n";
exit(1);
}
// residual saturations // residual saturations
lensMaterialParams_.setSwr(0.18); lensMaterialParams_.setSwr(0.18);
......
...@@ -177,8 +177,6 @@ public: ...@@ -177,8 +177,6 @@ public:
noFlowBoundary_(4), noFlowBoundary_(4),
intersectionToVertexBC_(*this) intersectionToVertexBC_(*this)
{ {
try
{
nTemperature_ = GET_RUNTIME_PARAM(TypeTag, int, FluidSystem.NTemperature); nTemperature_ = GET_RUNTIME_PARAM(TypeTag, int, FluidSystem.NTemperature);
nPressure_ = GET_RUNTIME_PARAM(TypeTag, int, FluidSystem.NPressure); nPressure_ = GET_RUNTIME_PARAM(TypeTag, int, FluidSystem.NPressure);
pressureLow_ = GET_RUNTIME_PARAM(TypeTag, Scalar, FluidSystem.PressureLow); pressureLow_ = GET_RUNTIME_PARAM(TypeTag, Scalar, FluidSystem.PressureLow);
...@@ -188,15 +186,6 @@ public: ...@@ -188,15 +186,6 @@ public:
depthBOR_ = GET_RUNTIME_PARAM(TypeTag, Scalar, Problem.DepthBOR); depthBOR_ = GET_RUNTIME_PARAM(TypeTag, Scalar, Problem.DepthBOR);
name_ = GET_RUNTIME_PARAM(TypeTag, std::string, Problem.Name); name_ = GET_RUNTIME_PARAM(TypeTag, std::string, Problem.Name);
injectionRate_ = GET_RUNTIME_PARAM(TypeTag, Scalar, Problem.InjectionRate); injectionRate_ = GET_RUNTIME_PARAM(TypeTag, Scalar, Problem.InjectionRate);
}
catch (Dumux::ParameterException &e) {
std::cerr << e << ". Abort!\n";
exit(1) ;
}
catch (...) {
std::cerr << "Unknown exception thrown!\n";
exit(1);
}
/* Alternative syntax: /* Alternative syntax:
* typedef typename GET_PROP(TypeTag, ParameterTree) ParameterTree; * typedef typename GET_PROP(TypeTag, ParameterTree) ParameterTree;
......
...@@ -181,8 +181,6 @@ public: ...@@ -181,8 +181,6 @@ public:
noFlowBoundary_(4), noFlowBoundary_(4),
intersectionToVertexBC_(*this) intersectionToVertexBC_(*this)
{ {
try
{
nTemperature_ = GET_RUNTIME_PARAM(TypeTag, int, FluidSystem.NTemperature); nTemperature_ = GET_RUNTIME_PARAM(TypeTag, int, FluidSystem.NTemperature);
nPressure_ = GET_RUNTIME_PARAM(TypeTag, int, FluidSystem.NPressure); nPressure_ = GET_RUNTIME_PARAM(TypeTag, int, FluidSystem.NPressure);
pressureLow_ = GET_RUNTIME_PARAM(TypeTag, Scalar, FluidSystem.PressureLow); pressureLow_ = GET_RUNTIME_PARAM(TypeTag, Scalar, FluidSystem.PressureLow);
...@@ -194,15 +192,6 @@ public: ...@@ -194,15 +192,6 @@ public:
injectionRate_ = GET_RUNTIME_PARAM(TypeTag, Scalar, Problem.InjectionRate); injectionRate_ = GET_RUNTIME_PARAM(TypeTag, Scalar, Problem.InjectionRate);
injectionPressure_ = GET_RUNTIME_PARAM(TypeTag, Scalar, Problem.InjectionPressure); injectionPressure_ = GET_RUNTIME_PARAM(TypeTag, Scalar, Problem.InjectionPressure);
injectionTemperature_ = GET_RUNTIME_PARAM(TypeTag, Scalar, Problem.InjectionTemperature); injectionTemperature_ = GET_RUNTIME_PARAM(TypeTag, Scalar, Problem.InjectionTemperature);
}
catch (Dumux::ParameterException &e) {
std::cerr << e << ". Abort!\n";
exit(1) ;
}
catch (...) {
std::cerr << "Unknown exception thrown!\n";
exit(1);
}
/* Alternative syntax: /* Alternative syntax:
* typedef typename GET_PROP(TypeTag, ParameterTree) ParameterTree; * typedef typename GET_PROP(TypeTag, ParameterTree) ParameterTree;
......
...@@ -241,8 +241,6 @@ public: ...@@ -241,8 +241,6 @@ public:
void init() void init()
{ {
try
{
eps_ = 1e-6; eps_ = 1e-6;
outputName_ = GET_RUNTIME_PARAM(TypeTag, std::string, Constants.outputName); outputName_ = GET_RUNTIME_PARAM(TypeTag, std::string, Constants.outputName);
nRestart_ = GET_RUNTIME_PARAM(TypeTag, int, Constants.nRestart); nRestart_ = GET_RUNTIME_PARAM(TypeTag, int, Constants.nRestart);
...@@ -255,16 +253,6 @@ public: ...@@ -255,16 +253,6 @@ public:
massFluxInjectedPhase_ = GET_RUNTIME_PARAM(TypeTag, Scalar,BoundaryConditions.massFluxInjectedPhase); massFluxInjectedPhase_ = GET_RUNTIME_PARAM(TypeTag, Scalar,BoundaryConditions.massFluxInjectedPhase);
heatFluxFromRight_ = GET_RUNTIME_PARAM(TypeTag, Scalar,BoundaryConditions.heatFluxFromRight); heatFluxFromRight_ = GET_RUNTIME_PARAM(TypeTag, Scalar,BoundaryConditions.heatFluxFromRight);
coldTime_ = GET_RUNTIME_PARAM(TypeTag, Scalar,BoundaryConditions.coldTime); coldTime_ = GET_RUNTIME_PARAM(TypeTag, Scalar,BoundaryConditions.coldTime);
}
catch (Dumux::ParameterException &e) {
std::cerr << e << ". Abort!\n";
exit(1);
}
catch (...) {
std::cerr << "Unknown exception thrown!\n";
exit(1);
}
this->spatialParams().setInputInitialize(); this->spatialParams().setInputInitialize();
......
...@@ -115,10 +115,8 @@ public: ...@@ -115,10 +115,8 @@ public:
//! load parameters from input file and initialize parameter values //! load parameters from input file and initialize parameter values
void setInputInitialize() void setInputInitialize()
{ {
try
{
eps_ = 1e-6; eps_ = 1e-6;
// BEWARE! First the input values have to be set, than the material parameters can be set // BEWARE! First the input values have to be set, then the material parameters can be set
// this is the parameter value from file part // this is the parameter value from file part
porosity_ = GET_RUNTIME_PARAM(TypeTag, Scalar, SpatialParams.PorousMedium.porosity); porosity_ = GET_RUNTIME_PARAM(TypeTag, Scalar, SpatialParams.PorousMedium.porosity);
...@@ -143,15 +141,6 @@ public: ...@@ -143,15 +141,6 @@ public:
factorMassTransfer_ = GET_RUNTIME_PARAM(TypeTag, Scalar, SpatialParams.PorousMedium.factorMassTransfer); factorMassTransfer_ = GET_RUNTIME_PARAM(TypeTag, Scalar, SpatialParams.PorousMedium.factorMassTransfer);
lengthPM_ = GET_RUNTIME_PARAM(TypeTag, Scalar,Grid.lengthPM); lengthPM_ = GET_RUNTIME_PARAM(TypeTag, Scalar,Grid.lengthPM);
}
catch (Dumux::ParameterException &e) {
std::cerr << e << ". Abort!\n";
exit(1) ;
}
catch (...) {
std::cerr << "Unknown exception thrown!\n";
exit(1);
}
// residual saturations // residual saturations
materialParams_.setSwr(Swr_) ; materialParams_.setSwr(Swr_) ;
......
...@@ -260,8 +260,6 @@ public: ...@@ -260,8 +260,6 @@ public:
void init() void init()
{ {
try
{
eps_ = 1e-6; eps_ = 1e-6;
percentOfEquil_ = GET_RUNTIME_PARAM(TypeTag, Scalar,BoundaryConditions.percentOfEquil); percentOfEquil_ = GET_RUNTIME_PARAM(TypeTag, Scalar,BoundaryConditions.percentOfEquil);
nTemperature_ = GET_RUNTIME_PARAM(TypeTag, int, FluidSystem.nTemperature); nTemperature_ = GET_RUNTIME_PARAM(TypeTag, int, FluidSystem.nTemperature);
...@@ -275,16 +273,6 @@ public: ...@@ -275,16 +273,6 @@ public:
pnInjection_ = GET_RUNTIME_PARAM(TypeTag, Scalar,InitialConditions.pnInjection); pnInjection_ = GET_RUNTIME_PARAM(TypeTag, Scalar,InitialConditions.pnInjection);
TInject_ = GET_RUNTIME_PARAM(TypeTag, Scalar,BoundaryConditions.TInject); TInject_ = GET_RUNTIME_PARAM(TypeTag, Scalar,BoundaryConditions.TInject);
massFluxInjectedPhase_ = GET_RUNTIME_PARAM(TypeTag, Scalar,BoundaryConditions.massFluxInjectedPhase); massFluxInjectedPhase_ = GET_RUNTIME_PARAM(TypeTag, Scalar,BoundaryConditions.massFluxInjectedPhase);
}
catch (Dumux::ParameterException &e) {
std::cerr << e << ". Abort!\n";
exit(1) ;
}
catch (...) {
std::cerr << "Unknown exception thrown!\n";
exit(1);
}
this->spatialParams().setInputInitialize(); this->spatialParams().setInputInitialize();
......
...@@ -198,8 +198,6 @@ public: ...@@ -198,8 +198,6 @@ public:
// load parameters from input file and initialize parameter values // load parameters from input file and initialize parameter values
void setInputInitialize() void setInputInitialize()
{ {
try
{
eps_ = 1e-6; eps_ = 1e-6;
heightPM_ = GET_RUNTIME_PARAM(TypeTag, Scalar, Grid.InterfacePos); heightPM_ = GET_RUNTIME_PARAM(TypeTag, Scalar, Grid.InterfacePos);
heightDomain_ = GET_RUNTIME_PARAM(TypeTag, Scalar, Grid.YMax); heightDomain_ = GET_RUNTIME_PARAM(TypeTag, Scalar, Grid.YMax);
...@@ -234,15 +232,6 @@ public: ...@@ -234,15 +232,6 @@ public:
characteristicLengthPM_ = GET_RUNTIME_PARAM(TypeTag, Scalar, SpatialParams.PorousMedium.meanPoreSize); characteristicLengthPM_ = GET_RUNTIME_PARAM(TypeTag, Scalar, SpatialParams.PorousMedium.meanPoreSize);
factorEnergyTransfer_ = GET_RUNTIME_PARAM(TypeTag, Scalar, SpatialParams.PorousMedium.factorEnergyTransfer); factorEnergyTransfer_ = GET_RUNTIME_PARAM(TypeTag, Scalar, SpatialParams.PorousMedium.factorEnergyTransfer);
factorMassTransfer_ = GET_RUNTIME_PARAM(TypeTag, Scalar, SpatialParams.PorousMedium.factorMassTransfer); factorMassTransfer_ = GET_RUNTIME_PARAM(TypeTag, Scalar, SpatialParams.PorousMedium.factorMassTransfer);
}
catch (Dumux::ParameterException &e) {
std::cerr << e << ". Abort!\n";
exit(1) ;
}
catch (...) {
std::cerr << "Unknown exception thrown!\n";
exit(1);
}
// residual saturations // residual saturations
materialParamsFF_.setSwr(0.0); materialParamsFF_.setSwr(0.0);
......
...@@ -155,20 +155,9 @@ public: ...@@ -155,20 +155,9 @@ public:
Forchheimer1pProblem(TimeManager &timeManager, const GridView &gridView) Forchheimer1pProblem(TimeManager &timeManager, const GridView &gridView)
: ParentType(timeManager, gridView) : ParentType(timeManager, gridView)
{ {
try
{
pMax_ = GET_RUNTIME_PARAM(TypeTag, Scalar, Problem.pMax); pMax_ = GET_RUNTIME_PARAM(TypeTag, Scalar, Problem.pMax);
pMin_ = GET_RUNTIME_PARAM(TypeTag, Scalar, Problem.pMin); pMin_ = GET_RUNTIME_PARAM(TypeTag, Scalar, Problem.pMin);
outputName_ = GET_RUNTIME_PARAM(TypeTag, std::string, Problem.outputName); outputName_ = GET_RUNTIME_PARAM(TypeTag, std::string, Problem.outputName);
}
catch (Dumux::ParameterException &e) {
std::cerr << e << ". Abort!\n";
exit(1) ;
}
catch (...) {
std::cerr << "Unknown exception thrown!\n";
exit(1);
}
eps_ = 1e-6; eps_ = 1e-6;
temperature_ = 273.15 + 25; // -> 25°C temperature_ = 273.15 + 25; // -> 25°C
......
...@@ -151,20 +151,9 @@ public: ...@@ -151,20 +151,9 @@ public:
Forchheimer2pProblem(TimeManager &timeManager, const GridView &gridView) Forchheimer2pProblem(TimeManager &timeManager, const GridView &gridView)
: ParentType(timeManager, gridView) : ParentType(timeManager, gridView)
{ {
try
{
pMax_ = GET_RUNTIME_PARAM(TypeTag, Scalar, Problem.pMax); pMax_ = GET_RUNTIME_PARAM(TypeTag, Scalar, Problem.pMax);
pMin_ = GET_RUNTIME_PARAM(TypeTag, Scalar, Problem.pMin); pMin_ = GET_RUNTIME_PARAM(TypeTag, Scalar, Problem.pMin);
outputName_ = GET_RUNTIME_PARAM(TypeTag, std::string, Problem.outputName); outputName_ = GET_RUNTIME_PARAM(TypeTag, std::string, Problem.outputName);
}
catch (Dumux::ParameterException &e) {
std::cerr << e << ". Abort!\n";
exit(1) ;
}
catch (...) {
std::cerr << "Unknown exception thrown!\n";
exit(1);
}
eps_ = 1e-6; eps_ = 1e-6;
temperature_ = 273.15 + 25; // -> 25°C temperature_ = 273.15 + 25; // -> 25°C
......
...@@ -160,8 +160,6 @@ int start_(int argc, ...@@ -160,8 +160,6 @@ int start_(int argc,
int gridRefinement; int gridRefinement;
bool useInterfaceMeshCreator; bool useInterfaceMeshCreator;
try
{
dgfFileName = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, std::string, Grid, File); dgfFileName = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, std::string, Grid, File);
dt = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, TimeManager, DtInitial); dt = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, TimeManager, DtInitial);
tEnd = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, TimeManager, TEnd); tEnd = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, TimeManager, TEnd);
...@@ -172,15 +170,7 @@ int start_(int argc, ...@@ -172,15 +170,7 @@ int start_(int argc,
gradingFactor = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, Grid, Grading); gradingFactor = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, Grid, Grading);
gridRefinement = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, Grid, Refinement); gridRefinement = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, Grid, Refinement);
useInterfaceMeshCreator = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, bool, Grid, UseInterfaceMeshCreator); useInterfaceMeshCreator = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, bool, Grid, UseInterfaceMeshCreator);
}
catch (Dumux::ParameterException &e) {
std::cerr << e << ". Abort!\n";
exit(1) ;
}
catch (...) {
std::cerr << "Unknown exception thrown!\n";
exit(1);
}
std::cout << "Starting with timestep size = " << dt << "s, simulation end = " << tEnd << "s\n"; std::cout << "Starting with timestep size = " << dt << "s, simulation end = " << tEnd << "s\n";
GridPointer gridPtr; GridPointer gridPtr;
......
Supports Markdown
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