Commit cc2d208a authored by Thomas Fetzer's avatar Thomas Fetzer
Browse files

[freeflow]

- defaulted superlu and umfpack as linear solver
- added macros to skip test if the two above mentioned solvers are not
  installed
- removed duplicate property definition
- beautified comments

reviewed by gruenich and hommel


git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@15051 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent 5e8fae77
......@@ -63,6 +63,7 @@ class StokesFluxVariables
typedef typename FVElementGeometry::SubControlVolumeFace SCVFace;
public:
//! \brief The constructor
StokesFluxVariables(const Problem &problem,
const Element &element,
const FVElementGeometry &fvGeometry,
......
......@@ -78,6 +78,8 @@ SET_TYPE_PROP(BoxStokes, NewtonController, StokesNewtonController<TypeTag>);
#if HAVE_SUPERLU
SET_TYPE_PROP(BoxStokes, LinearSolver, SuperLUBackend<TypeTag>);
#elif HAVE_UMFPACK
SET_TYPE_PROP(BoxStokes, LinearSolver, UMFPackBackend<TypeTag>);
#endif
//! the Model property
......
......@@ -68,13 +68,11 @@ namespace Dumux
// Set calculation to Navier-Stokes, not Stokes
SET_BOOL_PROP(NavierStokesTestProblem, EnableNavierStokes, true);
SET_PROP(NavierStokesTestProblem, Fluid)
{
private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
public:
typedef Dumux::GasPhase<Scalar, Dumux::N2ConstViscosity<Scalar> > type;
};
// Use nitrogen with a constant viscosity as gas phase
SET_TYPE_PROP(NavierStokesTestProblem, Fluid,
Dumux::GasPhase<typename GET_PROP_TYPE(TypeTag, Scalar),
Dumux::N2ConstViscosity<typename GET_PROP_TYPE(TypeTag, Scalar)> >);
// Scalar is set to type double
SET_TYPE_PROP(BoxStokes, Scalar, double);
}
......
......@@ -55,7 +55,8 @@ int main(int argc, char** argv)
typedef TTAG(NavierStokesTestProblem) ProblemTypeTag;
return Dumux::start<ProblemTypeTag>(argc, argv, usage);
#else
std::cout << "Test skipped, it needs SuperLU and ALUGrid or UG." << std::endl;
#warning "You need to have SuperLU and ALUGrid or UG to run this test."
std::cout << "You need to have SuperLU and ALUGrid or UG to run this test." << std::endl;
return 77;
#endif
}
......@@ -49,18 +49,10 @@ SET_TYPE_PROP(StokesTestProblem, Grid, Dune::YaspGrid<2>);
// Set the problem property
SET_TYPE_PROP(StokesTestProblem, Problem, Dumux::StokesTestProblem<TypeTag>);
SET_PROP(StokesTestProblem, Fluid)
{
private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
public:
typedef Dumux::GasPhase<Scalar, Dumux::N2<Scalar> > type;
};
//! Scalar is set to type long double for higher accuracy
SET_TYPE_PROP(BoxStokes, Scalar, double);
//! Disable unsymmetrized velocity gradient by default
SET_BOOL_PROP(StokesTestProblem, EnableUnsymmetrizedVelocityGradient, false);
// Use nitrogen as gas phase
SET_TYPE_PROP(StokesTestProblem, Fluid,
Dumux::GasPhase<typename GET_PROP_TYPE(TypeTag, Scalar),
Dumux::N2<typename GET_PROP_TYPE(TypeTag, Scalar)> >);
}
/*!
......
......@@ -39,8 +39,8 @@ void usage(const char *progName, const std::string &errorMsg)
errorMessageOut += " [options]\n";
errorMessageOut += errorMsg;
errorMessageOut += "\n\nThe List of Mandatory arguments for this program is:\n"
"\t-TimeManager.TEnd The end of the simulation. [s] \n"
"\t-TimeManager.DtInitial The initial timestep size. [s] \n"
"\t-TimeManager.TEnd The end of the simulation. [s] \n"
"\t-TimeManager.DtInitial The initial timestep size. [s] \n"
"\t-Grid.File The file name of the file containing the grid \n"
"\t definition in DGF format\n";
......@@ -51,12 +51,12 @@ void usage(const char *progName, const std::string &errorMsg)
int main(int argc, char** argv)
{
#if HAVE_SUPERLU
#if (HAVE_SUPERLU || HAVE_UMFPACK)
typedef TTAG(StokesTestProblem) ProblemTypeTag;
return Dumux::start<ProblemTypeTag>(argc, argv, usage);
#else
#warning "No SuperLU installed. Stokes currently only works with SuperLU."
std::cout << "No SuperLU installed. Stokes currently only works with SuperLU." << std::endl;
return 1;
#warning "You need to have SuperLU or UMFPack installed to run this test."
std::cerr << "You need to have SuperLU or UMFPack installed to run this test\n";
return 77;
#endif
}
......@@ -48,15 +48,9 @@ SET_TYPE_PROP(Stokes2cTestProblem, Grid, Dune::YaspGrid<2>);
// Set the problem property
SET_TYPE_PROP(Stokes2cTestProblem, Problem, Dumux::Stokes2cTestProblem<TypeTag>);
//! Select the fluid system
SET_PROP(BoxStokesnc, FluidSystem)
{
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef Dumux::FluidSystems::H2OAir<Scalar> type;
};
//! Scalar is set to type long double for higher accuracy
//SET_TYPE_PROP(BoxStokes, Scalar, long double);
// Select the fluid system
SET_TYPE_PROP(Stokes2cTestProblem, FluidSystem,
Dumux::FluidSystems::H2OAir<typename GET_PROP_TYPE(TypeTag, Scalar)>);
}
/*!
......
......@@ -39,8 +39,8 @@ void usage(const char *progName, const std::string &errorMsg)
errorMessageOut += " [options]\n";
errorMessageOut += errorMsg;
errorMessageOut += "\n\nThe List of Mandatory arguments for this program is:\n"
"\t-TimeManager.TEnd The end of the simulation. [s] \n"
"\t-TimeManager.DtInitial The initial timestep size. [s] \n"
"\t-TimeManager.TEnd The end of the simulation. [s] \n"
"\t-TimeManager.DtInitial The initial timestep size. [s] \n"
"\t-Grid.File The file name of the file containing the grid \n"
"\t definition in DGF format\n";
......@@ -51,12 +51,12 @@ void usage(const char *progName, const std::string &errorMsg)
int main(int argc, char** argv)
{
#if HAVE_SUPERLU
#if (HAVE_SUPERLU || HAVE_UMFPACK)
typedef TTAG(Stokes2cTestProblem) ProblemTypeTag;
return Dumux::start<ProblemTypeTag>(argc, argv, usage);
#else
#warning "No SuperLU installed. Stokes currently only works with SuperLU."
std::cout << "No SuperLU installed. Stokes currently only works with SuperLU." << std::endl;
return 1;
#warning "You need to have SuperLU or UMFPack installed to run this test."
std::cerr << "You need to have SuperLU or UMFPack installed to run this test\n";
return 77;
#endif
}
......@@ -52,22 +52,15 @@ SET_TYPE_PROP(Stokes2cniTestProblem, Grid, Dune::YaspGrid<2>);
// Set the problem property
SET_TYPE_PROP(Stokes2cniTestProblem, Problem, Stokes2cniTestProblem<TypeTag>);
//! Select the fluid system
SET_PROP(Stokes2cniTestProblem, FluidSystem)
{
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef Dumux::FluidSystems::H2OAir<Scalar> type;
};
#if HAVE_UMFPACK
SET_TYPE_PROP(Stokes2cniTestProblem, LinearSolver, UMFPackBackend<TypeTag>);
#endif
//! Scalar is set to type long double for higher accuracy
//SET_TYPE_PROP(Stokes2cniTestProblem, Scalar, long double);
// Select the fluid system
SET_TYPE_PROP(Stokes2cniTestProblem, FluidSystem,
Dumux::FluidSystems::H2OAir<typename GET_PROP_TYPE(TypeTag, Scalar)>);
// Use Pardiso as linear solver, if available
#if HAVE_PARDISO
SET_TYPE_PROP(Stokes2cniTestProblem, LinearSolver, PardisoBackend<TypeTag>);
#elif HAVE_UMFPACK
SET_TYPE_PROP(Stokes2cniTestProblem, LinearSolver, UMFPackBackend<TypeTag>);
#endif
}
......
......@@ -39,8 +39,8 @@ void usage(const char *progName, const std::string &errorMsg)
errorMessageOut += " [options]\n";
errorMessageOut += errorMsg;
errorMessageOut += "\n\nThe List of Mandatory arguments for this program is:\n"
"\t-TimeManager.TEnd The end of the simulation. [s] \n"
"\t-TimeManager.DtInitial The initial timestep size. [s] \n"
"\t-TimeManager.TEnd The end of the simulation. [s] \n"
"\t-TimeManager.DtInitial The initial timestep size. [s] \n"
"\t-Grid.File The file name of the file containing the grid \n"
"\t definition in DGF format\n";
......@@ -51,12 +51,12 @@ void usage(const char *progName, const std::string &errorMsg)
int main(int argc, char** argv)
{
#if HAVE_SUPERLU
#if (HAVE_PARDISO || HAVE_UMFPACK)
typedef TTAG(Stokes2cniTestProblem) ProblemTypeTag;
return Dumux::start<ProblemTypeTag>(argc, argv, usage);
#else
#warning "No SuperLU installed. Stokes currently only works with SuperLU."
std::cout << "No SuperLU installed. Stokes currently only works with SuperLU." << std::endl;
return 1;
#warning "You need to have Pardiso or UMFPack installed to run this test."
std::cerr << "You need to have Pardiso or UMFPack installed to run this test\n";
return 77;
#endif
}
......@@ -56,6 +56,12 @@ void usage(const char *progName, const std::string &errorMsg)
int main(int argc, char** argv)
{
#if (HAVE_SUPERLU || HAVE_UMFPACK)
typedef TTAG(ZeroEqTestProblem) ProblemTypeTag;
return Dumux::start<ProblemTypeTag>(argc, argv, usage);
#else
#warning "You need to have SuperLU or UMFPack installed to run this test."
std::cerr << "You need to have SuperLU or UMFPack installed to run this test\n";
return 77;
#endif
}
......@@ -57,6 +57,12 @@ void usage(const char *progName, const std::string &errorMsg)
int main(int argc, char** argv)
{
#if HAVE_UMFPACK
typedef TTAG(ZeroEqChannelTestProblem) ProblemTypeTag;
return Dumux::start<ProblemTypeTag>(argc, argv, usage);
#else
#warning "You need to have UMFPack installed to run this test."
std::cerr << "You need to have UMFPack installed to run this test\n";
return 77;
#endif
}
......@@ -55,14 +55,10 @@ SET_TYPE_PROP(ZeroEqChannelTestProblem, Grid, Dune::YaspGrid<2>);
// Set the problem property
SET_TYPE_PROP(ZeroEqChannelTestProblem, Problem, Dumux::ZeroEqChannelTestProblem<TypeTag>);
// Set the fluids
SET_PROP(ZeroEqChannelTestProblem, Fluid)
{
private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
public:
typedef Dumux::GasPhase<Scalar, Dumux::Air<Scalar> > type;
};
// Set the air as the gas phase
SET_TYPE_PROP(ZeroEqChannelTestProblem, Fluid,
Dumux::GasPhase<typename GET_PROP_TYPE(TypeTag, Scalar),
Dumux::Air<typename GET_PROP_TYPE(TypeTag, Scalar)> >);
// Disable gravity
SET_BOOL_PROP(ZeroEqChannelTestProblem, ProblemEnableGravity, false);
......@@ -72,6 +68,11 @@ SET_BOOL_PROP(ZeroEqChannelTestProblem, BBoxMaxIsWall, false);
// Do not write sub-control volume data
SET_SCALAR_PROP(ZeroEqChannelTestProblem, ZeroEqWriteAllSCVData, -1);
#if HAVE_UMFPACK
// Use UMFPack as linear solver
SET_TYPE_PROP(ZeroEqChannelTestProblem, LinearSolver, UMFPackBackend<TypeTag>);
#endif
}
/*!
......
......@@ -58,14 +58,10 @@ SET_TYPE_PROP(ZeroEqTestProblem, Grid, Dune::YaspGrid<2>);
// Set the problem property
SET_TYPE_PROP(ZeroEqTestProblem, Problem, Dumux::ZeroEqTestProblem<TypeTag>);
// Set the fluids
SET_PROP(ZeroEqTestProblem, Fluid)
{
private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
public:
typedef Dumux::GasPhase<Scalar, Dumux::Air<Scalar> > type;
};
// Set the air as the gas phase
SET_TYPE_PROP(ZeroEqTestProblem, Fluid,
Dumux::GasPhase<typename GET_PROP_TYPE(TypeTag, Scalar),
Dumux::Air<typename GET_PROP_TYPE(TypeTag, Scalar)> >);
// Disable gravity
SET_BOOL_PROP(ZeroEqTestProblem, ProblemEnableGravity, false);
......
......@@ -59,6 +59,12 @@ void usage(const char *progName, const std::string &errorMsg)
int main(int argc, char** argv)
{
#if (HAVE_SUPERLU || HAVE_UMFPACK)
typedef TTAG(ZeroEq2cTestProblem) ProblemTypeTag;
return Dumux::start<ProblemTypeTag>(argc, argv, usage);
#else
#warning "You need to have SuperLU or UMFPack installed to run this test."
std::cerr << "You need to have SuperLU or UMFPack installed to run this test\n";
return 77;
#endif
}
......@@ -56,13 +56,8 @@ SET_TYPE_PROP(ZeroEq2cTestProblem, Grid, Dune::YaspGrid<2>);
SET_TYPE_PROP(ZeroEq2cTestProblem, Problem, Dumux::ZeroEq2cTestProblem<TypeTag>);
// Select the fluid system
SET_PROP(ZeroEq2cTestProblem, FluidSystem)
{
private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
public:
typedef Dumux::FluidSystems::H2OAir<Scalar> type;
};
SET_TYPE_PROP(ZeroEq2cTestProblem, FluidSystem,
Dumux::FluidSystems::H2OAir<typename GET_PROP_TYPE(TypeTag, Scalar)>);
// Disable gravity
SET_BOOL_PROP(ZeroEq2cTestProblem, ProblemEnableGravity, false);
......
......@@ -62,6 +62,12 @@ void usage(const char *progName, const std::string &errorMsg)
int main(int argc, char** argv)
{
#if (HAVE_SUPERLU || HAVE_UMFPACK)
typedef TTAG(ZeroEq2cniTestProblem) ProblemTypeTag;
return Dumux::start<ProblemTypeTag>(argc, argv, usage);
#else
#warning "You need to have SuperLU or UMFPack installed to run this test."
std::cerr << "You need to have SuperLU or UMFPack installed to run this test\n";
return 77;
#endif
}
......@@ -56,13 +56,8 @@ SET_TYPE_PROP(ZeroEq2cniTestProblem, Grid, Dune::YaspGrid<2>);
SET_TYPE_PROP(ZeroEq2cniTestProblem, Problem, Dumux::ZeroEq2cniTestProblem<TypeTag>);
// Select the fluid system
SET_PROP(ZeroEq2cniTestProblem, FluidSystem)
{
private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
public:
typedef Dumux::FluidSystems::H2OAir<Scalar> type;
};
SET_TYPE_PROP(ZeroEq2cniTestProblem, FluidSystem,
Dumux::FluidSystems::H2OAir<typename GET_PROP_TYPE(TypeTag, Scalar)>);
// Disable gravity
SET_BOOL_PROP(ZeroEq2cniTestProblem, ProblemEnableGravity, false);
......
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