Commit 978f326b authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

adapted pdesolver tp name change

parent 6ef0d0f4
......@@ -97,7 +97,7 @@ void EllipticPDESolver::createOtherMatrixGraphs() {
}
void TransportPDESolver::run(SampleSolution &solution) {
TimeSeries timeSeries = createTimeSeries(solution);
auto timeSeries = assemble->GetTimeSeries(solution.U);
timeInt.operator()(assemble, timeSeries, solution.U);
}
......@@ -123,9 +123,4 @@ void TransportPDESolver::plotSolution(SampleSolution &solution) {
void TransportPDESolver::setUpPlot(SampleSolution &solution) {
plotMap.UpdateMap(solution);
assemble->SetPlot(plotMap[plotMap.GetLevelInteger(solution)]);
}
TimeSeries TransportPDESolver::createTimeSeries(SampleSolution &solution) {
double h_max = solution.U.GetMesh().MeshWidth().second;
return TimeSeries(t0, T, CFL * h_max, "UniformTimeSeries");
}
}
\ No newline at end of file
......@@ -17,9 +17,9 @@
// Mpp imports
#include "dof/BasicDoFs.hpp"
#include "solver/Solver.hpp"
#include "solver/Newton.hpp"
#include "timestepping/TimeIntegrator.hpp"
#include "Solver.hpp"
#include "Newton.hpp"
#include "TimeIntegrator.hpp"
// Standard library
#include <typeinfo>
......@@ -117,6 +117,7 @@ public:
const std::string &costMeasure = "size") :
PDESolver(meshes, quantity, costMeasure), assemble(assemble) {
solMGraphs = CreateSolutionMatrixGraphs();
PrintInfo();
}
~DummyPDESolver() {
......@@ -177,6 +178,7 @@ public:
newton(Newton(solver)) {
solMGraphs = CreateSolutionMatrixGraphs();
PrintInfo();
solver.PrintInfo();
}
~EllipticPDESolver() {
......@@ -205,12 +207,6 @@ public:
class TransportPDESolver : public PDESolver {
private:
double CFL = 1.0 / 2.0; // tau < C * h
double t0 = 0.0;
double T = 0.0;
Solver solver;
TimeIntegrator timeInt;
......@@ -228,21 +224,17 @@ protected:
void setUpPlot(SampleSolution &solution) override;
TimeSeries createTimeSeries(SampleSolution &solution); // Todo shouldn't be here
public:
TransportPDESolver(IStochasticTransportAssemble *assemble,
Meshes &meshes,
const std::string &quantity = "L2",
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")),
solver(Solver(GetPC("PointBlockJacobi_dG"), "GMRES")),
timeInt(TimeIntegrator(solver, -102)) {
solMGraphs = CreateSolutionMatrixGraphs();
config.get("CFL", CFL);
config.get("t0", t0);
config.get("T", T);
solver.PrintInfo();
PrintInfo();
}
~TransportPDESolver() {
......
......@@ -20,6 +20,7 @@ public:
: IStochasticTransportAssemble(problem),
disc(dynamic_cast<DGDiscretization *> (disc)) {
config.get("flux_alpha", flux_alpha);
PrintInfo();
}
IDiscretization *GetDisc() override {
......
......@@ -14,6 +14,7 @@ int main(int argc, char **argv) {
MppTestBuilder(argc, argv).
WithConfigEntry("PDESolverPlotting", 1).
WithConfigEntry("PDESolverVerbose", 1).
WithConfigEntry("AssembleVerbose", 1).
WithScreenLogging().
WithPPM()).
RUN_ALL_MPP_TESTS();
......
......@@ -20,6 +20,11 @@ struct TestParams {
if (model.find("DG") != -1) return "dG1";
else return "NoOverlap";
}
int GetDegree() const {
if (model.find("Laplace") != -1) return 1;
else return 2;
}
};
std::ostream &operator<<(std::ostream &s, const TestParams &testParams) {
......@@ -38,7 +43,7 @@ protected:
TestPDESolver(const std::string &meshName, int commSplit = 0) {
// Todo use googletest number as m!
id = SampleID(5, 0, false);
id = SampleID(4, 0, false);
meshes = MeshesCreator(meshName).
WithOverlap(GetParam().GetOverlap()).
......@@ -49,9 +54,10 @@ protected:
Create();
pdeSolver = PDESolverCreator().
WithModel(GetParam().model).
WithProblem(GetParam().problem).
WithDegree(GetParam().GetDegree()).
WithQuantity(GetParam().quantity).
WithProblem(GetParam().problem).
WithModel(GetParam().model).
Create(*meshes);
}
......@@ -144,12 +150,18 @@ public:
};
INSTANTIATE_TEST_SUITE_P(TestPDESolver, TestTransport2D, Values(
TestParams{"DGTransport", "Pollution2D", "Mass", 1.0},
TestParams{"DGTransport", "PollutionCosHat2D", "Mass", 1.0},
// TestParams{"DGTransport", "Pollution2D", "Mass", 1.0}
// TestParams{"DGTransport", "PollutionCosHat2D", "Mass", 1.0},
TestParams{"DGTransport", "GaussHat2D", "Mass", 1.0}
));
#define PDESOLVERTEST_TESTRUN(TestClass) \
TEST_P(TestTransport2D, TestInitialValue) {
SampleSolution solution(pdeSolver->MGraphs(), id);
pdeSolver->Run(solution);
EXPECT_NEAR(solution.Q, GetParam().Q, PDESOLVER_TEST_TOLERANCE);
}
#define PDESOLVERTEST_TESTRUN(TestClass)\
\
TEST_P(TestClass, TestRun) {\
SampleSolution solution(pdeSolver->MGraphs(), id);\
......
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