5#define BOOST_TEST_DYN_LINK
7#include <boost/test/unit_test.hpp>
8#include <DCPSE/DcpseRhs.hpp>
9#include "../../openfpm_numerics/src/DMatrix/EMatrix.hpp"
11BOOST_AUTO_TEST_SUITE(DcpseRhs_tests)
16 BOOST_AUTO_TEST_CASE(DcpseRhs_dx_test)
22 EMatrix<double, Eigen::Dynamic, 1> b(mb.size());
25 rhs.getVector<
double>(b);
35 BOOST_REQUIRE_CLOSE(b(0), -Dmb.getElement(0).evaluate(p0), 1e-16);
36 BOOST_REQUIRE_CLOSE(b(1), -Dmb.getElement(1).evaluate(p0), 1e-16);
37 BOOST_REQUIRE_CLOSE(b(2), -Dmb.getElement(2).evaluate(p0), 1e-16);
38 BOOST_REQUIRE_CLOSE(b(3), -Dmb.getElement(3).evaluate(p0), 1e-16);
39 BOOST_REQUIRE_CLOSE(b(4), -Dmb.getElement(4).evaluate(p0), 1e-16);
40 BOOST_REQUIRE_CLOSE(b(5), -Dmb.getElement(5).evaluate(p0), 1e-16);
43 BOOST_AUTO_TEST_CASE(DcpseRhs_dxdy_test)
49 EMatrix<double, Eigen::Dynamic, Eigen::Dynamic> b(mb.size(), 1);
52 rhs.getVector<
double>(b);
62 BOOST_REQUIRE_CLOSE(b(0), Dmb.getElement(0).evaluate(p0), 1e-16);
63 BOOST_REQUIRE_CLOSE(b(1), Dmb.getElement(1).evaluate(p0), 1e-16);
64 BOOST_REQUIRE_CLOSE(b(2), Dmb.getElement(2).evaluate(p0), 1e-16);
65 BOOST_REQUIRE_CLOSE(b(3), Dmb.getElement(3).evaluate(p0), 1e-16);
66 BOOST_REQUIRE_CLOSE(b(4), Dmb.getElement(4).evaluate(p0), 1e-16);
67 BOOST_REQUIRE_CLOSE(b(5), Dmb.getElement(5).evaluate(p0), 1e-16);
68 BOOST_REQUIRE_CLOSE(b(6), Dmb.getElement(6).evaluate(p0), 1e-16);
69 BOOST_REQUIRE_CLOSE(b(7), Dmb.getElement(7).evaluate(p0), 1e-16);
70 BOOST_REQUIRE_CLOSE(b(8), Dmb.getElement(8).evaluate(p0), 1e-16);
74 BOOST_AUTO_TEST_CASE(DcpseRhs_laplacian_test)
80 EMatrix<double, Eigen::Dynamic, Eigen::Dynamic> b(mb.size(), 1);
83 rhs.getVector<
double>(b);
89 BOOST_REQUIRE_CLOSE(b(0), Dmb.getElement(0).evaluate(p0), 1e-16);
90 BOOST_REQUIRE_CLOSE(b(1), Dmb.getElement(1).evaluate(p0), 1e-16);
91 BOOST_REQUIRE_CLOSE(b(2), Dmb.getElement(2).evaluate(p0), 1e-16);
92 BOOST_REQUIRE_CLOSE(b(3), Dmb.getElement(3).evaluate(p0), 1e-16);
93 BOOST_REQUIRE_CLOSE(b(4), Dmb.getElement(4).evaluate(p0), 1e-16);
94 BOOST_REQUIRE_CLOSE(b(5), Dmb.getElement(5).evaluate(p0), 1e-16);
95 BOOST_REQUIRE_CLOSE(b(6), Dmb.getElement(6).evaluate(p0), 1e-16);
96 BOOST_REQUIRE_CLOSE(b(7), Dmb.getElement(7).evaluate(p0), 1e-16);
97 BOOST_REQUIRE_CLOSE(b(8), Dmb.getElement(8).evaluate(p0), 1e-16);
98 BOOST_REQUIRE_CLOSE(b(9), Dmb.getElement(9).evaluate(p0), 1e-16);
99 BOOST_REQUIRE_CLOSE(b(10), Dmb.getElement(10).evaluate(p0), 1e-16);
100 BOOST_REQUIRE_CLOSE(b(11), Dmb.getElement(11).evaluate(p0), 1e-16);
101 BOOST_REQUIRE_CLOSE(b(12), Dmb.getElement(12).evaluate(p0), 1e-16);
102 BOOST_REQUIRE_CLOSE(b(13), Dmb.getElement(13).evaluate(p0), 1e-16);
103 BOOST_REQUIRE_CLOSE(b(14), Dmb.getElement(14).evaluate(p0), 1e-16);
104 BOOST_REQUIRE_CLOSE(b(15), Dmb.getElement(15).evaluate(p0), 1e-16);
105 BOOST_REQUIRE_CLOSE(b(16), Dmb.getElement(16).evaluate(p0), 1e-16);
106 BOOST_REQUIRE_CLOSE(b(17), Dmb.getElement(17).evaluate(p0), 1e-16);
107 BOOST_REQUIRE_CLOSE(b(18), Dmb.getElement(18).evaluate(p0), 1e-16);
108 BOOST_REQUIRE_CLOSE(b(19), Dmb.getElement(19).evaluate(p0), 1e-16);
113BOOST_AUTO_TEST_SUITE_END()
This class implement the point shape in an N-dimensional space.