Newer
Older
Jacques Xing
committed
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE TestDirichlet
#include <boost/test/tools/output_test_stream.hpp>
#include <boost/test/unit_test.hpp>
#include <iostream>
#include <memory>
#include "Operators/OperatorDirBndCond.hpp"
#include "init_dirichletfields.hpp"
BOOST_AUTO_TEST_SUITE(TestDirichlet)
BOOST_FIXTURE_TEST_CASE(dirichlet1d_seg, Helmholtz1D_Seg)
Jacques Xing
committed
{
Configure();
auto DirBndCondOp = DirBndCond<>::create(fixt_explist, "");
DirBndCondOp->apply(*fixt_out);
ExpectedSolution(fixt_expected->GetBlocks(),
fixt_expected->GetStorage().GetCPUPtr());
BOOST_TEST(fixt_out->compare(*fixt_expected, 1.0E-12));
boost::test_tools::output_test_stream output;
{
OutputIfNotMatch(fixt_out->GetStorage().GetCPUPtr(),
fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12);
}
}
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
BOOST_FIXTURE_TEST_CASE(dirichlet2d_tri_quad, Helmholtz2D_Tri_Quad)
{
Configure();
auto DirBndCondOp = DirBndCond<>::create(fixt_explist, "");
DirBndCondOp->apply(*fixt_out);
ExpectedSolution(fixt_expected->GetBlocks(),
fixt_expected->GetStorage().GetCPUPtr());
BOOST_TEST(fixt_out->compare(*fixt_expected, 1.0E-12));
boost::test_tools::output_test_stream output;
{
OutputIfNotMatch(fixt_out->GetStorage().GetCPUPtr(),
fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12);
}
}
BOOST_FIXTURE_TEST_CASE(dirichlet3d_hex, Helmholtz3D_Hex)
{
Configure();
auto DirBndCondOp = DirBndCond<>::create(fixt_explist, "");
DirBndCondOp->apply(*fixt_out);
ExpectedSolution(fixt_expected->GetBlocks(),
fixt_expected->GetStorage().GetCPUPtr());
BOOST_TEST(fixt_out->compare(*fixt_expected, 1.0E-12));
boost::test_tools::output_test_stream output;
{
OutputIfNotMatch(fixt_out->GetStorage().GetCPUPtr(),
fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12);
}
}
BOOST_FIXTURE_TEST_CASE(dirichlet3d_prism, Helmholtz3D_Prism)
{
Configure();
auto DirBndCondOp = DirBndCond<>::create(fixt_explist, "");
DirBndCondOp->apply(*fixt_out);
ExpectedSolution(fixt_expected->GetBlocks(),
fixt_expected->GetStorage().GetCPUPtr());
BOOST_TEST(fixt_out->compare(*fixt_expected, 1.0E-12));
boost::test_tools::output_test_stream output;
{
OutputIfNotMatch(fixt_out->GetStorage().GetCPUPtr(),
fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12);
}
}
BOOST_FIXTURE_TEST_CASE(dirichlet3d_pyr, Helmholtz3D_Pyr)
{
Configure();
auto DirBndCondOp = DirBndCond<>::create(fixt_explist, "");
DirBndCondOp->apply(*fixt_out);
ExpectedSolution(fixt_expected->GetBlocks(),
fixt_expected->GetStorage().GetCPUPtr());
BOOST_TEST(fixt_out->compare(*fixt_expected, 1.0E-12));
boost::test_tools::output_test_stream output;
{
OutputIfNotMatch(fixt_out->GetStorage().GetCPUPtr(),
fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12);
}
}
BOOST_FIXTURE_TEST_CASE(dirichlet3d_tet, Helmholtz3D_Tet)
Jacques Xing
committed
{
Configure();
auto DirBndCondOp = DirBndCond<>::create(fixt_explist, "");
DirBndCondOp->apply(*fixt_out);
ExpectedSolution(fixt_expected->GetBlocks(),
fixt_expected->GetStorage().GetCPUPtr());
BOOST_TEST(fixt_out->compare(*fixt_expected, 1.0E-12));
boost::test_tools::output_test_stream output;
{
OutputIfNotMatch(fixt_out->GetStorage().GetCPUPtr(),
fixt_expected->GetStorage().GetCPUPtr(), 1.0E-12);
}
}
BOOST_AUTO_TEST_SUITE_END()