Skip to content

Commit

Permalink
Updated tests for MakeHole with shape support
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipovicLado committed Jan 27, 2025
1 parent 1d97bd0 commit 96c0ccf
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions tests/hole/hole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,36 @@ namespace viennacore {

using namespace viennaps;

template <class NumericType, int D> void RunTest() {
template <class NumericType, int D>
void RunTest() {
auto domain = SmartPointer<Domain<NumericType, D>>::New();

MakeHole<NumericType, D>(domain, 1., 10., 10., 2.5, 5., 10., 1., false, true,
// Test with HoleShape::Full
MakeHole<NumericType, D>(domain, 1., 10., 10., 2.5, 5., 10., 1., HoleShape::Full, false, true,
Material::Si)
.apply();

VC_TEST_ASSERT(domain->getLevelSets().size() == 2);
VC_TEST_ASSERT(domain->getMaterialMap());
VC_TEST_ASSERT(domain->getMaterialMap()->size() == 2);

LSTEST_ASSERT_VALID_LS(domain->getLevelSets().back(), NumericType, D);

// Test with HoleShape::Quarter
domain->clear(); // Reset the domain for a new test
MakeHole<NumericType, D>(domain, 1., 10., 10., 2.5, 5., 10., 1., HoleShape::Quarter, false, true,
Material::Si)
.apply();

VC_TEST_ASSERT(domain->getLevelSets().size() == 2);
VC_TEST_ASSERT(domain->getMaterialMap());
VC_TEST_ASSERT(domain->getMaterialMap()->size() == 2);

LSTEST_ASSERT_VALID_LS(domain->getLevelSets().back(), NumericType, D);

// Test with HoleShape::Half
domain->clear(); // Reset the domain for a new test
MakeHole<NumericType, D>(domain, 1., 10., 10., 2.5, 5., 10., 1., HoleShape::Half, false, true,
Material::Si)
.apply();

Expand All @@ -24,3 +50,4 @@ template <class NumericType, int D> void RunTest() {
} // namespace viennacore

int main() { VC_RUN_ALL_TESTS }

0 comments on commit 96c0ccf

Please sign in to comment.