Commit 0de57930 authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

removed verbose and plotting from constructor

parent 07375dff
......@@ -57,13 +57,15 @@ protected:
virtual void createOtherMatrixGraphs() {}
public:
PDESolver(Meshes &meshes, const std::string &quantity, const std::string &costMeasure,
int verbose, int plotting) :
meshes(meshes), quantity(quantity), costMeasure(costMeasure),
verbose(verbose), plotting(plotting) {}
PDESolver(Meshes &meshes, const std::string &quantity,
const std::string &costMeasure) :
meshes(meshes), quantity(quantity), costMeasure(costMeasure) {
config.get("PDESolverVerbose", verbose);
config.get("PDESolverPlotting", plotting);
}
virtual ~PDESolver() {
if(!solMGraphs) delete solMGraphs;
if (!solMGraphs) delete solMGraphs;
};
MatrixGraphs *MGraphs() {
......@@ -112,10 +114,8 @@ public:
DummyPDESolver(IStochasticDummyAssemble *assemble,
Meshes &meshes,
const std::string &quantity = "L2",
const std::string &costMeasure = "size",
int verbose = 1, int plotting = 1) :
PDESolver(meshes, quantity, costMeasure, verbose, plotting),
assemble(assemble) {
const std::string &costMeasure = "size") :
PDESolver(meshes, quantity, costMeasure), assemble(assemble) {
solMGraphs = CreateSolutionMatrixGraphs();
}
......@@ -170,11 +170,9 @@ public:
Meshes &meshes,
const std::string &quantity = "L2",
const std::string &costMeasure = "size",
int verbose = 1, int plotting = 1,
const std::string &pc = "SuperLU",
const std::string &linearSolver = "GMRES") :
PDESolver(meshes, quantity, costMeasure, verbose, plotting),
assemble(assemble),
PDESolver(meshes, quantity, costMeasure), assemble(assemble),
solver(Solver(GetPC(pc), linearSolver)),
newton(Newton(solver)) {
solMGraphs = CreateSolutionMatrixGraphs();
......@@ -235,10 +233,8 @@ public:
TransportPDESolver(IStochasticTransportAssemble *assemble,
Meshes &meshes,
const std::string &quantity = "L2",
const std::string &costMeasure = "size",
int verbose = 1, int plotting = 1) :
PDESolver(meshes, quantity, costMeasure, verbose, plotting),
assemble(assemble),
const std::string &costMeasure = "size") :
PDESolver(meshes, quantity, costMeasure), assemble(assemble),
// T(assemble) Todo make T and t0 Problem Properties
solver(Solver(GetPC("PointBlockGaussSeidel"), "GMRES")),
timeInt(TimeIntegrator(solver, -102)) {
......
......@@ -7,7 +7,7 @@ PDESolver *PDESolverCreator::Create(Meshes &meshes) {
new LagrangeEllipticAssemble(
new LagrangeDiscretization(meshes, _degree),
CreateStochasticEllipticProblem(_problem, meshes)
), meshes, _quantity, _costMeasure, _verbose, _plotting
), meshes, _quantity, _costMeasure
);
if (_model == "MixedElliptic")
......@@ -15,7 +15,7 @@ PDESolver *PDESolverCreator::Create(Meshes &meshes) {
new MixedEllipticAssemble(
new RTLagrangeDiscretization(meshes, 0, 0),
CreateStochasticEllipticProblem(_problem, meshes)
), meshes, _quantity, _costMeasure, _verbose, _plotting
), meshes, _quantity, _costMeasure
);
if (_model == "HybridElliptic")
......@@ -23,7 +23,7 @@ PDESolver *PDESolverCreator::Create(Meshes &meshes) {
new HybridEllipticAssemble(
new RTLagrangeDiscretization(meshes, 0, 0),
CreateStochasticEllipticProblem(_problem, meshes)
), meshes, _quantity, _costMeasure, _verbose, _plotting
), meshes, _quantity, _costMeasure
);
if (_model == "DGElliptic")
......@@ -31,7 +31,7 @@ PDESolver *PDESolverCreator::Create(Meshes &meshes) {
new DGEllipticAssemble(
new DGDiscretization(meshes, _degree),
CreateStochasticEllipticProblem(_problem, meshes)
), meshes, _quantity, _costMeasure, _verbose, _plotting
), meshes, _quantity, _costMeasure
);
if (_model == "DGTransport")
......@@ -39,7 +39,7 @@ PDESolver *PDESolverCreator::Create(Meshes &meshes) {
new DGTransportAssemble(
new DGDiscretization(meshes, _degree),
CreateStochasticTransportProblem(_problem, meshes)
), meshes, _quantity, _costMeasure, _verbose, _plotting
), meshes, _quantity, _costMeasure
);
if (_model == "PGTransport")
......@@ -50,7 +50,7 @@ PDESolver *PDESolverCreator::Create(Meshes &meshes) {
new IStochasticDummyAssemble(
new LagrangeDiscretization(meshes, _degree),
CreateStochasticDummyProblem(_problem, meshes)
), meshes, _quantity, _costMeasure, _verbose, _plotting
), meshes, _quantity, _costMeasure
);
Exit(_model + " not found")
......
......@@ -13,22 +13,15 @@ private:
std::string _costMeasure = "size";
std::string _linearSolver;
int _verbose;
int _plotting;
int _degree = 1;
public:
PDESolverCreator(int verbose = 1, int plotting = 1)
:_verbose(verbose), _plotting(plotting) {
PDESolverCreator() {
config.get("Model", _model);
config.get("degree", _degree);
config.get("Problem", _problem);
config.get("Quantity", _quantity);
config.get("CostMeasure", _costMeasure);
config.get("PDESolverVerbose", _verbose);
config.get("PDESolverPlotting", _plotting);
}
PDESolverCreator WithModel(const std::string &model) {
......
Markdown is supported
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