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