Commit 700d8de4 authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

pdesolver creator taking more responsibility on how object is set up by also...

pdesolver creator taking more responsibility on how object is set up by also considering config entries
parent c99fada5
......@@ -7,7 +7,7 @@ PDESolver *PDESolverCreator::Create(Meshes &meshes) {
new LagrangeEllipticAssemble(
new LagrangeDiscretization(meshes, _degree),
CreateStochasticEllipticProblem(_problem, meshes)
), _quantity, _costMeasure, _verbose, _plotting
), meshes, _quantity, _costMeasure, _verbose, _plotting
);
if (_model == "MixedElliptic")
......@@ -15,7 +15,7 @@ PDESolver *PDESolverCreator::Create(Meshes &meshes) {
new MixedEllipticAssemble(
new RTLagrangeDiscretization(meshes, 0, 0),
CreateStochasticEllipticProblem(_problem, meshes)
), _quantity, _costMeasure, _verbose, _plotting
), meshes, _quantity, _costMeasure, _verbose, _plotting
);
if (_model == "HybridElliptic")
......@@ -23,7 +23,7 @@ PDESolver *PDESolverCreator::Create(Meshes &meshes) {
new HybridEllipticAssemble(
new RTLagrangeDiscretization(meshes, 0, 0),
CreateStochasticEllipticProblem(_problem, meshes)
), _quantity, _costMeasure, _verbose, _plotting
), meshes, _quantity, _costMeasure, _verbose, _plotting
);
if (_model == "DGElliptic")
......@@ -31,7 +31,7 @@ PDESolver *PDESolverCreator::Create(Meshes &meshes) {
new DGEllipticAssemble(
new DGDiscretization(meshes, _degree),
CreateStochasticEllipticProblem(_problem, meshes)
), _quantity, _costMeasure, _verbose, _plotting
), meshes, _quantity, _costMeasure, _verbose, _plotting
);
if (_model == "DGTransport")
......@@ -39,7 +39,7 @@ PDESolver *PDESolverCreator::Create(Meshes &meshes) {
new DGTransportAssemble(
new DGDiscretization(meshes, _degree),
CreateStochasticTransportProblem(_problem, meshes)
), _quantity, _costMeasure, _verbose, _plotting
), meshes, _quantity, _costMeasure, _verbose, _plotting
);
if (_model == "PGTransport")
......@@ -50,7 +50,7 @@ PDESolver *PDESolverCreator::Create(Meshes &meshes) {
new IStochasticDummyAssemble(
new LagrangeDiscretization(meshes, _degree),
CreateStochasticDummyProblem(_problem, meshes)
), _quantity, _costMeasure, _verbose, _plotting
), meshes, _quantity, _costMeasure, _verbose, _plotting
);
Exit(_model + " not found")
......
......@@ -9,7 +9,7 @@ private:
std::string _pc;
std::string _model = "StochasticDummyProblem";
std::string _problem = "DummyPDESolver";
std::string _quantity = "L2";
std::string _quantity = "GeneratorValue";
std::string _costMeasure = "size";
std::string _linearSolver;
......@@ -21,7 +21,15 @@ private:
public:
PDESolverCreator(int verbose = 1, int plotting = 1)
:_verbose(verbose), _plotting(plotting) {}
:_verbose(verbose), _plotting(plotting) {
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) {
if (!model.empty())
......@@ -50,6 +58,15 @@ public:
return *this;
}
std::string GetMeshName() {
if (_problem.find("1D") != string::npos)
return "Interval";
else if (_problem.find("2D") != string::npos)
return "Square";
else
return "Interval";
}
PDESolver *Create(Meshes &meshes);
};
......
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