Commit 559ea5c5 authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

splitted PDESolver Tests and started with commSplit

parent 26ba42d6
Pipeline #158614 passed with stages
in 13 minutes and 35 seconds
......@@ -41,6 +41,7 @@ public:
PrintInfoEntry("Cost measure", costMeasure));
newton->PrintInfo();
assemble->PrintInfo();
assemble->GetDisc()->GetMeshes().PrintInfo();
}
}
......
......@@ -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)
......
#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
......@@ -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},
// 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 //TESTTRANSPORTPDESOLVER_HPP
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