Skip to content

Commit

Permalink
Adds TestBoundaryConditions unit test.
Browse files Browse the repository at this point in the history
  • Loading branch information
Edward Palmer committed Jun 28, 2024
1 parent aa3ad12 commit 2d3c86c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
9 changes: 9 additions & 0 deletions unit/platypus-unit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
DMETHOD: dbg
Werror: reorder
compiler_type: gcc
documentation: true
installation_type: in_tree
registered_apps:
- WASPAPP
- PLATYPUSUNITAPP
- PLATYPUSUNITTESTAPP
20 changes: 20 additions & 0 deletions unit/src/TestBoundaryConditions.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include "boundary_conditions.h"
#include "mfem.hpp"
#include "gtest/gtest.h"

TEST(CheckData, boundaryConditions)
{
platypus::BCMap bc_map;
mfem::Array<int> bdr_attrs({1, 2, 3});

bc_map.Register(
"tangential_dEdt",
std::make_shared<platypus::BoundaryCondition>(std::string("boundary_1"), bdr_attrs));

mfem::Array<int> ess_bdr = bc_map.Get("tangential_dEdt")->_bdr_attributes;

for (int i = 0; i < bdr_attrs.Size(); ++i)
{
EXPECT_EQ(bdr_attrs[i], ess_bdr[i]);
}
}

0 comments on commit 2d3c86c

Please sign in to comment.