Skip to content

Commit

Permalink
added tetVol test
Browse files Browse the repository at this point in the history
  • Loading branch information
Brig Bagley committed Jun 8, 2016
1 parent fceaf55 commit a067e76
Show file tree
Hide file tree
Showing 8 changed files with 56,982 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@ endfunction()
#the tests
newtest(sanity2D)
newtest(sanity3D)
newtest(tetVol)
4 changes: 1 addition & 3 deletions src/test/sanity2D.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ TEST(SanityTests, EggCarton2D) {
cfg.readMatlabArray(std::string(TEST_DATA_DIR) + "/simpleTriAns.mat", &x_answer);
//look for error
double error = 0.f;
std::vector<double> x_actual, err;
std::vector<double> x_actual;
for (int i = 0; i < x_answer.size(); i++) {
error += (x_h[i] - x_answer[i]) * (x_h[i] - x_answer[i]);
x_actual.push_back(x_h[i]);
err.push_back(std::abs(x_h[i] - x_answer[i]));
}
std::cout << "The error is : " << std::sqrt(error) << std::endl;
cfg.writeVTK(x_actual, "test_egg_carton1");
ASSERT_TRUE(std::sqrt(error) < 100.);
}
1 change: 0 additions & 1 deletion src/test/sanity3D.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@ TEST(SanityTests, EggCarton3D) {
x_actual.push_back(x_h[i]);
}
std::cout << "The error is : " << std::sqrt(error) << std::endl;
cfg.writeVTK(x_actual, "test_egg_carton2");
ASSERT_TRUE(std::sqrt(error) < 1.);
}
Loading

0 comments on commit a067e76

Please sign in to comment.