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

further test dev

parent 82af39c5
......@@ -7,41 +7,59 @@
class TestCirculantEmbedding : public Test {
protected:
Meshes *meshes;
int maxLevel = 10;
CirculantEmbedding2D mlCircEmb;
int samples = 10;
TestCirculantEmbedding() :
meshes(MeshesCreator("Square").
WithPLevel(0).
WithLevel(1).
Create()),
mlCircEmb(*meshes) {
TestCirculantEmbedding() {
std::filesystem::remove_all("data/vtu/");
std::filesystem::create_directory("data/vtu/");
}
void TearDown() override {
delete meshes;
PPM->Barrier(0);
}
};
TEST_F(TestCirculantEmbedding, TestDrawSample) {
SampleID idFine(Level(1), 0, 0, "Kappa");
mlCircEmb.DrawSample(idFine);
std::string file = "data/vtu/" + idFine.IdString() + ".vtu";
EXPECT_TRUE(std::filesystem::exists(file));
SampleID idCoarse(Level(1), 1, 1, "Kappa");
mlCircEmb.DrawSample(idCoarse);
file = "data/vtu/" + idCoarse.IdString() + ".vtu";
EXPECT_TRUE(std::filesystem::exists(file));
for (int level = 7; level <= maxLevel; level++) {
Meshes *meshes = MeshesCreator("Square").
WithPLevel(level - 1).
WithLevel(level).
Create();
double sigma = 1.0;
std::vector<double> lambda{0.15, 0.15};
double smoothing = 1.8;
int norm_p = 2;
auto covariance = CovarianceFunction2D(sigma, lambda, smoothing, norm_p);
CirculantEmbedding2D circEmb(*meshes, covariance);
for (int sample = 0; sample < samples; sample++) {
SampleID idFine(Level(level), sample, 0, "Kappa");
circEmb.DrawSample(idFine);
PPM->Barrier(0);
std::string file = "data/vtu/" + idFine.IdString() + ".vtu";
EXPECT_TRUE(std::filesystem::exists(file));
SampleID idCoarse(Level(level), sample, 1, "Kappa");
circEmb.DrawSample(idCoarse);
PPM->Barrier(0);
file = "data/vtu/" + idCoarse.IdString() + ".vtu";
EXPECT_TRUE(std::filesystem::exists(file));
}
delete meshes;
}
}
int main(int argc, char **argv) {
return MppTest(MppTestBuilder(argc, argv).
WithConfigEntry("GeneratorPlotting", 1).
WithConfigEntry("GeneratorVerbose", 1).
WithConfigEntry("GeneratorVerbose", 0).
WithScreenLogging().
WithPPM()
).RUN_ALL_MPP_TESTS();
......
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