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:
OnePTestSpatialParams(const GridView& gridView)
: ParentType(gridView)
{
try
{
lensLowerLeft_[0] = GET_RUNTIME_PARAM(TypeTag, Scalar, SpatialParams.LensLowerLeftX);
if (dimWorld > 1)
lensLowerLeft_[1] = GET_RUNTIME_PARAM(TypeTag, Scalar, SpatialParams.LensLowerLeftY);
......@@ -74,15 +72,6 @@ public:
permeability_ = GET_RUNTIME_PARAM(TypeTag, Scalar, SpatialParams.Permeability);
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:
LensSpatialParams(const GridView& gridView)
: ParentType(gridView)
{
try
{
lensLowerLeft_[0] = GET_RUNTIME_PARAM(TypeTag, Scalar, SpatialParams.LensLowerLeftX);
lensLowerLeft_[1] = GET_RUNTIME_PARAM(TypeTag, Scalar, SpatialParams.LensLowerLeftY);
lensUpperRight_[0] = GET_RUNTIME_PARAM(TypeTag, Scalar, SpatialParams.LensUpperRightX);
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
lensMaterialParams_.setSwr(0.18);
......
......@@ -177,8 +177,6 @@ public:
noFlowBoundary_(4),
intersectionToVertexBC_(*this)
{
try
{
nTemperature_ = GET_RUNTIME_PARAM(TypeTag, int, FluidSystem.NTemperature);
nPressure_ = GET_RUNTIME_PARAM(TypeTag, int, FluidSystem.NPressure);
pressureLow_ = GET_RUNTIME_PARAM(TypeTag, Scalar, FluidSystem.PressureLow);
......@@ -188,15 +186,6 @@ public:
depthBOR_ = GET_RUNTIME_PARAM(TypeTag, Scalar, Problem.DepthBOR);
name_ = GET_RUNTIME_PARAM(TypeTag, std::string, Problem.Name);
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:
* typedef typename GET_PROP(TypeTag, ParameterTree) ParameterTree;
......
......@@ -181,8 +181,6 @@ public:
noFlowBoundary_(4),
intersectionToVertexBC_(*this)
{
try
{
nTemperature_ = GET_RUNTIME_PARAM(TypeTag, int, FluidSystem.NTemperature);
nPressure_ = GET_RUNTIME_PARAM(TypeTag, int, FluidSystem.NPressure);
pressureLow_ = GET_RUNTIME_PARAM(TypeTag, Scalar, FluidSystem.PressureLow);
......@@ -194,15 +192,6 @@ public:
injectionRate_ = GET_RUNTIME_PARAM(TypeTag, Scalar, Problem.InjectionRate);
injectionPressure_ = GET_RUNTIME_PARAM(TypeTag, Scalar, Problem.InjectionPressure);
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:
* typedef typename GET_PROP(TypeTag, ParameterTree) ParameterTree;
......
......@@ -241,8 +241,6 @@ public:
void init()
{
try
{
eps_ = 1e-6;
outputName_ = GET_RUNTIME_PARAM(TypeTag, std::string, Constants.outputName);
nRestart_ = GET_RUNTIME_PARAM(TypeTag, int, Constants.nRestart);
......@@ -255,16 +253,6 @@ public:
massFluxInjectedPhase_ = GET_RUNTIME_PARAM(TypeTag, Scalar,BoundaryConditions.massFluxInjectedPhase);
heatFluxFromRight_ = GET_RUNTIME_PARAM(TypeTag, Scalar,BoundaryConditions.heatFluxFromRight);
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();
......
......@@ -115,10 +115,8 @@ public:
//! load parameters from input file and initialize parameter values
void setInputInitialize()
{
try
{
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
porosity_ = GET_RUNTIME_PARAM(TypeTag, Scalar, SpatialParams.PorousMedium.porosity);
......@@ -143,15 +141,6 @@ public:
factorMassTransfer_ = GET_RUNTIME_PARAM(TypeTag, Scalar, SpatialParams.PorousMedium.factorMassTransfer);
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
materialParams_.setSwr(Swr_) ;
......
......@@ -260,8 +260,6 @@ public:
void init()
{
try
{
eps_ = 1e-6;
percentOfEquil_ = GET_RUNTIME_PARAM(TypeTag, Scalar,BoundaryConditions.percentOfEquil);
nTemperature_ = GET_RUNTIME_PARAM(TypeTag, int, FluidSystem.nTemperature);
......@@ -275,16 +273,6 @@ public:
pnInjection_ = GET_RUNTIME_PARAM(TypeTag, Scalar,InitialConditions.pnInjection);
TInject_ = GET_RUNTIME_PARAM(TypeTag, Scalar,BoundaryConditions.TInject);
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();
......
......@@ -198,8 +198,6 @@ public:
// load parameters from input file and initialize parameter values
void setInputInitialize()
{
try
{
eps_ = 1e-6;
heightPM_ = GET_RUNTIME_PARAM(TypeTag, Scalar, Grid.InterfacePos);
heightDomain_ = GET_RUNTIME_PARAM(TypeTag, Scalar, Grid.YMax);
......@@ -234,15 +232,6 @@ public:
characteristicLengthPM_ = GET_RUNTIME_PARAM(TypeTag, Scalar, SpatialParams.PorousMedium.meanPoreSize);
factorEnergyTransfer_ = GET_RUNTIME_PARAM(TypeTag, Scalar, SpatialParams.PorousMedium.factorEnergyTransfer);
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
materialParamsFF_.setSwr(0.0);
......
......@@ -155,20 +155,9 @@ public:
Forchheimer1pProblem(TimeManager &timeManager, const GridView &gridView)
: ParentType(timeManager, gridView)
{
try
{
pMax_ = GET_RUNTIME_PARAM(TypeTag, Scalar, Problem.pMax);
pMin_ = GET_RUNTIME_PARAM(TypeTag, Scalar, Problem.pMin);
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;
temperature_ = 273.15 + 25; // -> 25°C
......
......@@ -151,20 +151,9 @@ public:
Forchheimer2pProblem(TimeManager &timeManager, const GridView &gridView)
: ParentType(timeManager, gridView)
{
try
{
pMax_ = GET_RUNTIME_PARAM(TypeTag, Scalar, Problem.pMax);
pMin_ = GET_RUNTIME_PARAM(TypeTag, Scalar, Problem.pMin);
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;
temperature_ = 273.15 + 25; // -> 25°C
......
......@@ -160,8 +160,6 @@ int start_(int argc,
int gridRefinement;
bool useInterfaceMeshCreator;
try
{
dgfFileName = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, std::string, Grid, File);
dt = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, TimeManager, DtInitial);
tEnd = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, TimeManager, TEnd);
......@@ -172,15 +170,7 @@ int start_(int argc,
gradingFactor = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, Grid, Grading);
gridRefinement = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, Grid, Refinement);
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";
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