Commit b55f4a7b authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

Merge branch '39-test-pdesolver-for-commsplit' into 'feature'

Resolve "Test PDESolver for CommSplit"

Closes #39

See merge request !51
parents 4bc3650f c1bdf5f1
Pipeline #159454 passed with stages
in 12 minutes and 8 seconds
......@@ -30,7 +30,7 @@ public:
CreateUnique();
}
int Run() {
int Run() const {
config.PrintInfo();
mout.StartBlock(estimator->Name() + " Experiment");
mout << "Start" << endl;
......
......@@ -41,6 +41,7 @@ public:
PrintInfoEntry("Cost measure", costMeasure));
newton->PrintInfo();
assemble->PrintInfo();
assemble->GetDisc()->GetMeshes().PrintInfo();
}
}
......
......@@ -36,7 +36,7 @@ double LagrangeEllipticAssemble::Energy(const Vector &u) const {
energy += w * K_DU * DU;
}
}
return sqrt(PPM->SumOnCommSplit(energy, u.GetMesh().CommSplit()));
return sqrt(PPM->SumOnCommSplit(energy, u.CommSplit()));
}
void LagrangeEllipticAssemble::Residual(const cell &c, const Vector &u, Vector &r) const {
......@@ -203,7 +203,7 @@ double LagrangeEllipticAssemble::FluxError(const Vector &u) const {
}
}
}
return sqrt(PPM->SumOnCommSplit(flux_error, u.GetMesh().CommSplit()));
return sqrt(PPM->SumOnCommSplit(flux_error, u.CommSplit()));
}
double LagrangeEllipticAssemble::FaceError(const Vector &u) const {
......@@ -219,7 +219,7 @@ double LagrangeEllipticAssemble::FaceError(const Vector &u) const {
}
}
}
return sqrt(PPM->SumOnCommSplit(face_error, u.GetMesh().CommSplit()));
return sqrt(PPM->SumOnCommSplit(face_error, u.CommSplit()));
}
FluxPair LagrangeEllipticAssemble::InflowOutflow(const Vector &u) const {
......@@ -241,8 +241,8 @@ FluxPair LagrangeEllipticAssemble::InflowOutflow(const Vector &u) const {
}
}
}
return {PPM->SumOnCommSplit(inflow, u.GetMesh().CommSplit()),
PPM->SumOnCommSplit(outflow, u.GetMesh().CommSplit())};
return {PPM->SumOnCommSplit(inflow, u.CommSplit()),
PPM->SumOnCommSplit(outflow, u.CommSplit())};
}
FluxPair LagrangeEllipticAssemble::PrescribedInflowOutflow(const Vector &u) const {
......@@ -263,8 +263,8 @@ FluxPair LagrangeEllipticAssemble::PrescribedInflowOutflow(const Vector &u) cons
}
}
}
return {PPM->SumOnCommSplit(inflow, u.GetMesh().CommSplit()),
PPM->SumOnCommSplit(outflow, u.GetMesh().CommSplit())};
return {PPM->SumOnCommSplit(inflow, u.CommSplit()),
PPM->SumOnCommSplit(outflow, u.CommSplit())};
}
FluxPair LagrangeEllipticAssemble::OutflowLeftRight(const Vector &u) const {
......@@ -286,8 +286,8 @@ FluxPair LagrangeEllipticAssemble::OutflowLeftRight(const Vector &u) const {
}
}
}
return {PPM->SumOnCommSplit(outflowLeft, u.GetMesh().CommSplit()),
PPM->SumOnCommSplit(outflowRight, u.GetMesh().CommSplit())};
return {PPM->SumOnCommSplit(outflowLeft, u.CommSplit()),
PPM->SumOnCommSplit(outflowRight, u.CommSplit())};
}
double LagrangeEllipticAssemble::GoalFunctional(const Vector &u) const {
......@@ -310,7 +310,7 @@ double LagrangeEllipticAssemble::GoalFunctional(const Vector &u) const {
}
}
}
return PPM->SumOnCommSplit(goal, u.GetMesh().CommSplit());
return PPM->SumOnCommSplit(goal, u.CommSplit());
}
void LagrangeEllipticAssemble::SetExactSolution(Vector &uEx) const {
......
......@@ -18,7 +18,6 @@ add_mpp_test(generators/TestHybridFluxGenerator GENERATORS)
# Add tests for problems!
add_mpp_test(pdesolvers/TestPDESolver PDESOLVERS)
add_mpp_test(pdesolvers/TestPlotting PDESOLVERS)
add_mpp_test(estimators/datastructure/TestLevelMaps ESTIMATORS)
......@@ -29,7 +28,11 @@ add_mpp_test(estimators/TestStochasticCollocation ESTIMATORS)
# ------- MPI Tests -------
add_mpi_test(generators/TestSPRNG5 GENERATORS)
add_mpi_test(pdesolvers/TestPDESolver PDESOLVERS)
add_mpi_test(pdesolvers/TestEllipticPDESolver PDESOLVERS)
add_mpi_test(pdesolvers/TestTransportPDESolver PDESOLVERS)
add_mpi_test(pdesolvers/TestParabolicPDESolver PDESOLVERS)
add_mpi_test(estimators/TestMonteCarlo ESTIMATORS)
add_mpi_test(estimators/TestMultilevelMonteCarlo ESTIMATORS)
......
......@@ -75,7 +75,7 @@ protected:
WithParallel(true).
CreateUnique()) {}
void TearDown() { PPM->Barrier(0); }
void TearDown() override { PPM->Barrier(0); }
};
class TestMonteCarloWithoutEpsilon : public TestMonteCarlo {
......
......@@ -10,11 +10,11 @@ INSTANTIATE_TEST_SUITE_P(
INSTANTIATE_TEST_SUITE_P(
TestMultilevelMonteCarlo, TestMultilevelMonteCarloWithEpsilon, Values(
//INSTANTIATE_TEST_SUITE_P(
// TestMultilevelMonteCarlo, TestMultilevelMonteCarloWithEpsilon, Values(
// TestParams{"StochasticLaplace1D", "L2", "LagrangeElliptic"},
TestParams{"StochasticLaplace2D", "L2", "LagrangeElliptic"}
));
// TestParams{"StochasticLaplace2D", "L2", "LagrangeElliptic"}
//));
TEST_P(TestMultilevelMonteCarloWithoutEpsilon, TestSeriellAgainstParallel) {
mout << GetParam() << endl;
......@@ -45,22 +45,22 @@ TEST_P(TestMultilevelMonteCarloWithoutEpsilon, TestSeriellAgainstParallel) {
EXPECT_NEAR(mlmcParallel->aggregate.sVar.Y, mlmcSeriell->aggregate.sVar.Y, SVarTol());
}
TEST_P(TestMultilevelMonteCarloWithEpsilon, TestWithEpsilon) {
mout << GetParam() << endl;
mout.StartBlock("Monte Carlo parallel");
mout << "Start" << endl;
mlmcParallel->Method();
mout.EndBlock();
mout << endl;
mlmcParallel->EstimatorResults();
mlmcParallel->MultilevelResults();
mlmcParallel->ExponentResults();
EXPECT_LE(mlmcSeriell->TotalError(), epsilon);
EXPECT_LE(mlmcParallel->TotalError(), epsilon);
}
//TEST_P(TestMultilevelMonteCarloWithEpsilon, TestWithEpsilon) {
// mout << GetParam() << endl;
//
// mout.StartBlock("Monte Carlo parallel");
// mout << "Start" << endl;
// mlmcParallel->Method();
// mout.EndBlock();
// mout << endl;
//
// mlmcParallel->EstimatorResults();
// mlmcParallel->MultilevelResults();
// mlmcParallel->ExponentResults();
//
// EXPECT_LE(mlmcSeriell->TotalError(), epsilon);
// EXPECT_LE(mlmcParallel->TotalError(), epsilon);
//}
int main(int argc, char **argv) {
return MppTest(
......
......@@ -54,6 +54,8 @@ protected:
WithEpsilon(epsilon).
WithParallel(true).
CreateUnique()) {}
void TearDown() override { PPM->Barrier(0); }
};
class TestMultilevelMonteCarloWithoutEpsilon : public TestMultilevelMonteCarlo {
......
#include "TestEllipticPDESolver.hpp"
#include "TestPDESolver.hpp"
/*
* 1D Elliptic
*/
ELLIPTICPDESOLVER1D_TESTRUN(TestLaplace1D)
ELLIPTICPDESOLVER1D_TESTRUN(TestLaplace1DWithSplit)
ELLIPTICPDESOLVER1D_TESTRUN(TestLaplace1DWithDoubleSplit)
ELLIPTICPDESOLVER1D_TESTRUN(TestLaplace1DWithFullSplit)
/*
* 2D Elliptic
*/
ELLIPTICPDESOLVER2D_TESTRUN(TestLaplace2D)
ELLIPTICPDESOLVER2D_TESTRUN(TestLaplace2DWithSplit)
ELLIPTICPDESOLVER2D_TESTRUN(TestLaplace2DWithDoubleSplit)
//ELLIPTICPDESOLVER2D_TESTRUN(TestLaplace2DWithFullSplit)
int main(int argc, char **argv) {
return MppTest(
MppTestBuilder(argc, argv).
WithConfigEntry("PDESolverPlotting", 1).
WithConfigEntry("PDESolverVerbose", 1).
WithConfigEntry("AssembleVerbose", 1).
WithConfigEntry("MeshesVerbose", 2).
WithConfigEntry("NewtonVerbose", 1).
WithConfigEntry("LinearVerbose", 1).
WithConfigEntry("MeshVerbose", 2).
WithScreenLogging().
WithPPM()).
RUN_ALL_MPP_TESTS();
}
\ No newline at end of file
#ifndef TESTELLIPTICPDESOLVER_HPP
#define TESTELLIPTICPDESOLVER_HPP
#include "TestPDESolver.hpp"
class TestLaplace1D : public TestPDESolver {
public:
explicit TestLaplace1D(int commSplit = 0) :
TestPDESolver("Interval", commSplit) {};
};
class TestLaplace1DWithSplit : public TestLaplace1D {
protected:
TestLaplace1DWithSplit() : TestLaplace1D(1) {}
};
class TestLaplace1DWithDoubleSplit : public TestLaplace1D {
protected:
TestLaplace1DWithDoubleSplit() : TestLaplace1D(2) {}
};
class TestLaplace1DWithFullSplit : public TestLaplace1D {
protected:
TestLaplace1DWithFullSplit() : TestLaplace1D(-1) {}
};
#define ELLIPTICPDESOLVER1D_TESTRUN(TestClass)\
\
INSTANTIATE_TEST_SUITE_P(TestPDESolver, TestClass, Values(\
TestParams{"LagrangeElliptic", "Laplace1D", "L2Error", 0.0},\
TestParams{"LagrangeElliptic", "Laplace1D", "EnergyError", 0.0},\
TestParams{"LagrangeElliptic", "Laplace1D", "FluxError", 0.0},\
TestParams{"LagrangeElliptic", "Laplace1D", "Inflow", -1.0},\
TestParams{"LagrangeElliptic", "Laplace1D", "Outflow", 1.0},\
\
TestParams{"MixedElliptic", "Laplace1D", "L2CellAverageError", 0.0},\
TestParams{"MixedElliptic", "Laplace1D", "EnergyError", 0.0},\
TestParams{"MixedElliptic", "Laplace1D", "FluxError", 0.0},\
TestParams{"MixedElliptic", "Laplace1D", "Inflow", -1.0},\
TestParams{"MixedElliptic", "Laplace1D", "Outflow", 1.0},\
\
TestParams{"HybridElliptic", "Laplace1D", "L2CellAverageError", 0.0},\
TestParams{"HybridElliptic", "Laplace1D", "Inflow", -1.0},\
TestParams{"HybridElliptic", "Laplace1D", "Outflow", 1.0},\
TestParams{"HybridElliptic", "Laplace1D", "EnergyError", 0.0},\
TestParams{"HybridElliptic", "Laplace1D", "FluxError", 0.0},\
\
TestParams{"DGElliptic", "Laplace1D", "L2Error", 0.0},\
TestParams{"DGElliptic", "Laplace1D", "EnergyError", 0.0},\
TestParams{"DGElliptic", "Laplace1D", "FluxError", 0.0},\
TestParams{"DGElliptic", "Laplace1D", "Inflow", -1.0},\
TestParams{"DGElliptic", "Laplace1D", "Outflow", 1.0}\
));\
\
TEST_P(TestClass, TestRun) {\
SampleSolution solution(pdeSolver->GetDisc(), id);\
pdeSolver->Run(solution);\
EXPECT_NEAR(solution.Q, GetParam().Q, PDESOLVER_TEST_TOLERANCE);\
}\
class TestLaplace2D : public TestPDESolver {
public:
explicit TestLaplace2D(int commSplit = 0) :
TestPDESolver("Square", commSplit) {};
};
class TestLaplace2DWithSplit : public TestLaplace2D {
protected:
TestLaplace2DWithSplit() : TestLaplace2D(1) {}
};
class TestLaplace2DWithDoubleSplit : public TestLaplace2D {
protected:
TestLaplace2DWithDoubleSplit() : TestLaplace2D(2) {}
};
class TestLaplace2DWithFullSplit : public TestLaplace2D {
protected:
TestLaplace2DWithFullSplit() : TestLaplace2D(-1) {}
};
#define ELLIPTICPDESOLVER2D_TESTRUN(TestClass)\
\
INSTANTIATE_TEST_SUITE_P(TestPDESolver, TestClass, Values(\
TestParams{"LagrangeElliptic", "Laplace2D", "L2Error", 0.0},\
TestParams{"LagrangeElliptic", "Laplace2D", "EnergyError", 0.0},\
TestParams{"LagrangeElliptic", "Laplace2D", "FluxError", 0.0},\
TestParams{"LagrangeElliptic", "Laplace2D", "Inflow", -1.0},\
TestParams{"LagrangeElliptic", "Laplace2D", "Outflow", 1.0},\
\
TestParams{"MixedElliptic", "Laplace2D", "L2CellAverageError", 0.0},\
TestParams{"MixedElliptic", "Laplace2D", "EnergyError", 0.0},\
TestParams{"MixedElliptic", "Laplace2D", "FluxError", 0.0},\
TestParams{"MixedElliptic", "Laplace2D", "Inflow", -1.0},\
TestParams{"MixedElliptic", "Laplace2D", "Outflow", 1.0},\
\
TestParams{"HybridElliptic", "Laplace2D", "L2CellAverageError", 0.0},\
TestParams{"HybridElliptic", "Laplace2D", "EnergyError", 0.0},\
TestParams{"HybridElliptic", "Laplace2D", "FluxError", 0.0},\
TestParams{"HybridElliptic", "Laplace2D", "Inflow", -1.0},\
TestParams{"HybridElliptic", "Laplace2D", "Outflow", 1.0},\
\
TestParams{"DGElliptic", "Laplace2D", "L2Error", 0.0},\
TestParams{"DGElliptic", "Laplace2D", "EnergyError", 0.0},\
TestParams{"DGElliptic", "Laplace2D", "FluxError", 0.0},\
TestParams{"DGElliptic", "Laplace2D", "Inflow", -1.0},\
TestParams{"DGElliptic", "Laplace2D", "Outflow", 1.0}\
));\
\
TEST_P(TestClass, TestRun) {\
SampleSolution solution(pdeSolver->GetDisc(), id);\
pdeSolver->Run(solution);\
EXPECT_NEAR(solution.Q, GetParam().Q, PDESOLVER_TEST_TOLERANCE);\
}\
#endif //TESTELLIPTICPDESOLVER_HPP
#include "TestPDESolver.hpp"
/*
* Todo : Tests for CommSplit
*/
PDESOLVERTEST_TESTRUN(TestLaplace1D)
PDESOLVERTEST_TESTRUN(TestLaplace2D)
//PDESOLVERTEST_TESTRUN(TestTransport1D)
PDESOLVERTEST_TESTRUN(TestTransport2D)
int main(int argc, char **argv) {
return MppTest(
MppTestBuilder(argc, argv).
WithConfigEntry("PDESolverPlotting", 1).
WithConfigEntry("PDESolverVerbose", 1).
WithConfigEntry("AssembleVerbose", 1).
WithConfigEntry("NewtonVerbose", 1).
WithConfigEntry("LinearVerbose", 1).
WithScreenLogging().
WithPPM()).
RUN_ALL_MPP_TESTS();
}
\ No newline at end of file
......@@ -41,8 +41,8 @@ protected:
std::unique_ptr<PDESolver> pdeSolver;
explicit TestPDESolver(const std::string &meshName, int commSplit = 0) {
std::filesystem::remove_all("data/vtk/");
std::filesystem::create_directory("data/vtk/");
std::filesystem::remove_all("data/vtu/");
std::filesystem::create_directory("data/vtu/");
id = SampleID(4, 0, false);
......@@ -68,124 +68,4 @@ protected:
}
};
class TestLaplace1D : public TestPDESolver {
public:
TestLaplace1D() : TestPDESolver("Interval") {};
};
INSTANTIATE_TEST_SUITE_P(TestPDESolver, TestLaplace1D, Values(
TestParams{"LagrangeElliptic", "Laplace1D", "L2Error", 0.0},
TestParams{"LagrangeElliptic", "Laplace1D", "EnergyError", 0.0},
TestParams{"LagrangeElliptic", "Laplace1D", "FluxError", 0.0},
TestParams{"LagrangeElliptic", "Laplace1D", "Inflow", -1.0},
TestParams{"LagrangeElliptic", "Laplace1D", "Outflow", 1.0},
TestParams{"MixedElliptic", "Laplace1D", "L2CellAverageError", 0.0},
TestParams{"MixedElliptic", "Laplace1D", "EnergyError", 0.0},
TestParams{"MixedElliptic", "Laplace1D", "FluxError", 0.0},
TestParams{"MixedElliptic", "Laplace1D", "Inflow", -1.0},
TestParams{"MixedElliptic", "Laplace1D", "Outflow", 1.0},
TestParams{"HybridElliptic", "Laplace1D", "L2CellAverageError", 0.0},
TestParams{"HybridElliptic", "Laplace1D", "Inflow", -1.0},
TestParams{"HybridElliptic", "Laplace1D", "Outflow", 1.0},
TestParams{"HybridElliptic", "Laplace1D", "EnergyError", 0.0},
TestParams{"HybridElliptic", "Laplace1D", "FluxError", 0.0},
TestParams{"DGElliptic", "Laplace1D", "L2Error", 0.0},
TestParams{"DGElliptic", "Laplace1D", "EnergyError", 0.0},
TestParams{"DGElliptic", "Laplace1D", "FluxError", 0.0},
TestParams{"DGElliptic", "Laplace1D", "Inflow", -1.0},
TestParams{"DGElliptic", "Laplace1D", "Outflow", 1.0}
));
class TestLaplace2D : public TestPDESolver {
public:
TestLaplace2D() : TestPDESolver("Square") {};
};
INSTANTIATE_TEST_SUITE_P(TestPDESolver, TestLaplace2D, Values(
TestParams{"LagrangeElliptic", "Laplace2D", "L2Error", 0.0},
TestParams{"LagrangeElliptic", "Laplace2D", "EnergyError", 0.0},
TestParams{"LagrangeElliptic", "Laplace2D", "FluxError", 0.0},
TestParams{"LagrangeElliptic", "Laplace2D", "Inflow", -1.0},
TestParams{"LagrangeElliptic", "Laplace2D", "Outflow", 1.0},
TestParams{"MixedElliptic", "Laplace2D", "L2CellAverageError", 0.0},
TestParams{"MixedElliptic", "Laplace2D", "EnergyError", 0.0},
TestParams{"MixedElliptic", "Laplace2D", "FluxError", 0.0},
TestParams{"MixedElliptic", "Laplace2D", "Inflow", -1.0},
TestParams{"MixedElliptic", "Laplace2D", "Outflow", 1.0},
TestParams{"HybridElliptic", "Laplace2D", "L2CellAverageError", 0.0},
TestParams{"HybridElliptic", "Laplace2D", "EnergyError", 0.0},
TestParams{"HybridElliptic", "Laplace2D", "FluxError", 0.0},
TestParams{"HybridElliptic", "Laplace2D", "Inflow", -1.0},
TestParams{"HybridElliptic", "Laplace2D", "Outflow", 1.0},
TestParams{"DGElliptic", "Laplace2D", "L2Error", 0.0},
TestParams{"DGElliptic", "Laplace2D", "EnergyError", 0.0},
TestParams{"DGElliptic", "Laplace2D", "FluxError", 0.0},
TestParams{"DGElliptic", "Laplace2D", "Inflow", -1.0},
TestParams{"DGElliptic", "Laplace2D", "Outflow", 1.0}
));
class TestTransport1D : public TestPDESolver {
public:
TestTransport1D() : TestPDESolver("Interval") {};
};
INSTANTIATE_TEST_SUITE_P(TestPDESolver, TestTransport1D, Values(
TestParams{"DGTransport", "Pollution1D", "Energy", 1.0},
TestParams{"DGTransport", "Pollution1D", "Mass", 1.0},
TestParams{"DGTransport", "Pollution1D", "Error", 1.0},
TestParams{"DGTransport", "Pollution1D", "Inflow", 1.0},
TestParams{"DGTransport", "Pollution1D", "Outflow", 1.0},
TestParams{"DGTransport", "PollutionCosHat1D", "Energy", 1.0},
TestParams{"DGTransport", "PollutionCosHat1D", "Mass", 1.0},
TestParams{"DGTransport", "PollutionCosHat1D", "Error", 1.0},
TestParams{"DGTransport", "PollutionCosHat1D", "Inflow", 1.0},
TestParams{"DGTransport", "PollutionCosHat1D", "Outflow", 1.0}
));
class TestTransport2D : public TestPDESolver {
public:
TestTransport2D() : TestPDESolver("Square") {};
};
INSTANTIATE_TEST_SUITE_P(TestPDESolver, TestTransport2D, Values(
// TestParams{"DGTransport", "Pollution2D", "Mass", 0.036012725},
// TestParams{"DGTransport", "Pollution2D", "Energy", 0.036012725},
// TestParams{"DGTransport", "Pollution2D", "Inflow", 0.036012725},
// TestParams{"DGTransport", "Pollution2D", "Outflow", 0.036012725},
// TestParams{"DGTransport", "Pollution2D", "Error", 0.036012725},
//
// TestParams{"DGTransport", "PollutionCosHat2D", "Mass", 0.036012725},
// TestParams{"DGTransport", "PollutionCosHat2D", "Energy", 0.036012725},
// TestParams{"DGTransport", "PollutionCosHat2D", "Inflow", 0.036012725},
// TestParams{"DGTransport", "PollutionCosHat2D", "Outflow", 0.036012725},
// TestParams{"DGTransport", "PollutionCosHat2D", "Error", 0.036012725},
//
// TestParams{"DGTransport", "GaussHat2D", "Mass", 0.036012725},
// TestParams{"DGTransport", "GaussHat2D", "Energy", 0.036012725},
// TestParams{"DGTransport", "GaussHat2D", "Inflow", 0.036012725},
// TestParams{"DGTransport", "GaussHat2D", "Outflow", 0.036012725},
// TestParams{"DGTransport", "GaussHat2D", "Error", 0.036012725},
//
TestParams{"DGTransport", "CosHat2D", "Mass", 0.036012725}
// TestParams{"DGTransport", "CosHat2D", "Energy", 0.036012725},
// TestParams{"DGTransport", "CosHat2D", "Inflow", 0.036012725},
// TestParams{"DGTransport", "CosHat2D", "Outflow", 0.036012725},
// TestParams{"DGTransport", "CosHat2D", "Error", 0.036012725}
));
#define PDESOLVERTEST_TESTRUN(TestClass)\
\
TEST_P(TestClass, TestRun) {\
SampleSolution solution(pdeSolver->GetDisc(), id);\
pdeSolver->Run(solution);\
EXPECT_NEAR(solution.Q, GetParam().Q, PDESOLVER_TEST_TOLERANCE);\
}\
#endif //TESTPDESOLVER_HPP
#include "TestParabolicPDESolver.hpp"
//PDESOLVERTEST_TESTRUN(TestTransport1D)
//PDESOLVERTEST_TESTRUN(TestTransport2D)
int main(int argc, char **argv) {
return MppTest(
MppTestBuilder(argc, argv).
WithConfigEntry("PDESolverPlotting", 1).
WithConfigEntry("PDESolverVerbose", 1).
WithConfigEntry("AssembleVerbose", 1).
WithConfigEntry("MeshesVerbose", 2).
WithConfigEntry("NewtonVerbose", 1).
WithConfigEntry("LinearVerbose", 1).
WithConfigEntry("MeshVerbose", 2).
WithScreenLogging().
WithPPM()).
RUN_ALL_MPP_TESTS();
}
\ No newline at end of file
#ifndef TESTPARABOLICPDESOLVER_HPP
#define TESTPARABOLICPDESOLVER_HPP
#include "TestPDESolver.hpp"
#endif //TESTPARABOLICPDESOLVER_HPP
#include "TestTransportPDESolver.hpp"
//PDESOLVERTEST_TESTRUN(TestTransport1D)
PDESOLVERTEST_TESTRUN(TestTransport2D)
int main(int argc, char **argv) {
return MppTest(
MppTestBuilder(argc, argv).
WithConfigEntry("PDESolverPlotting", 1).
WithConfigEntry("PDESolverVerbose", 1).
WithConfigEntry("AssembleVerbose", 1).
WithConfigEntry("MeshesVerbose", 2).
WithConfigEntry("NewtonVerbose", 1).
WithConfigEntry("LinearVerbose", 1).
WithConfigEntry("MeshVerbose", 2).
WithScreenLogging().
WithPPM()).
RUN_ALL_MPP_TESTS();
}
\ No newline at end of file
#ifndef TESTTRANSPORTPDESOLVER_HPP
#define TESTTRANSPORTPDESOLVER_HPP
#include "TestPDESolver.hpp"
class TestTransport1D : public TestPDESolver {
public:
TestTransport1D() : TestPDESolver("Interval") {};
};
INSTANTIATE_TEST_SUITE_P(TestPDESolver, TestTransport1D, Values(
TestParams{"DGTransport", "Pollution1D", "Energy", 1.0},
TestParams{"DGTransport", "Pollution1D", "Mass", 1.0},
TestParams{"DGTransport", "Pollution1D", "Error", 1.0},
TestParams{"DGTransport", "Pollution1D", "Inflow", 1.0},
TestParams{"DGTransport", "Pollution1D", "Outflow", 1.0},
TestParams{"DGTransport", "PollutionCosHat1D", "Energy", 1.0},
TestParams{"DGTransport", "PollutionCosHat1D", "Mass", 1.0},
TestParams{"DGTransport", "PollutionCosHat1D", "Error", 1.0},
TestParams{"DGTransport", "PollutionCosHat1D", "Inflow", 1.0},
TestParams{"DGTransport", "PollutionCosHat1D", "Outflow", 1.0}
));
class TestTransport2D : public TestPDESolver {
public:
TestTransport2D() : TestPDESolver("Square") {};
};
INSTANTIATE_TEST_SUITE_P(TestPDESolver, TestTransport2D, Values(
// TestParams{"DGTransport", "Pollution2D", "Mass", 0.036012725}
// TestParams{"DGTransport", "Pollution2D", "Energy", 0.036012725},
// TestParams{"DGTransport", "Pollution2D", "Inflow", 0.036012725},
// TestParams{"DGTransport", "Pollution2D", "Outflow", 0.036012725},
// TestParams{"DGTransport", "Pollution2D", "Error", 0.036012725},
//
// TestParams{"DGTransport", "PollutionCosHat2D", "Mass", 0.036012725},
// TestParams{"DGTransport", "PollutionCosHat2D", "Energy", 0.036012725},
// TestParams{"DGTransport", "PollutionCosHat2D", "Inflow", 0.036012725},
// TestParams{"DGTransport", "PollutionCosHat2D", "Outflow", 0.036012725},