7 #define BOOST_TEST_DYN_LINK
8 #define BOOST_TEST_MODULE "Tests mesh interpolation"
10 #include <boost/test/unit_test.hpp>
54 boost::shared_ptr<ParallelDistribution> hash = allocate_component<ParallelDistribution>(
"hash");
55 BOOST_CHECK_EQUAL(hash->name(),
"hash");
62 boost::shared_ptr<ParallelDistribution> hash = allocate_component<ParallelDistribution>(
"hash");
63 hash->options().set(
"nb_obj", (
Uint) 11);
64 hash->options().set(
"nb_parts", (
Uint) 3);
68 BOOST_CHECK_EQUAL(hash->part_of_obj(0), (
Uint) 0);
69 BOOST_CHECK_EQUAL(hash->part_of_obj(2), (
Uint) 0);
70 BOOST_CHECK_EQUAL(hash->part_of_obj(3), (
Uint) 1);
71 BOOST_CHECK_EQUAL(hash->part_of_obj(5), (
Uint) 1);
72 BOOST_CHECK_EQUAL(hash->part_of_obj(6), (
Uint) 2);
73 BOOST_CHECK_EQUAL(hash->part_of_obj(10), (
Uint) 2);
75 BOOST_CHECK_EQUAL(hash->start_idx_in_part(0), (
Uint) 0);
76 BOOST_CHECK_EQUAL(hash->start_idx_in_part(1), (
Uint) 3);
77 BOOST_CHECK_EQUAL(hash->start_idx_in_part(2), (
Uint) 6);
79 BOOST_CHECK_EQUAL(hash->end_idx_in_part(0), (
Uint) 3);
80 BOOST_CHECK_EQUAL(hash->end_idx_in_part(1), (
Uint) 6);
81 BOOST_CHECK_EQUAL(hash->end_idx_in_part(2), (
Uint) 11);
83 BOOST_CHECK_EQUAL(hash->nb_objects_in_part(0), (
Uint) 3);
84 BOOST_CHECK_EQUAL(hash->nb_objects_in_part(1), (
Uint) 3);
85 BOOST_CHECK_EQUAL(hash->nb_objects_in_part(2), (
Uint) 5);
92 boost::shared_ptr<MergedParallelDistribution> hash = allocate_component<MergedParallelDistribution>(
"hash");
93 std::vector<Uint> num_obj(2);
96 hash->options().set(
"nb_parts", (
Uint) 3);
97 hash->options().set(
"nb_obj", num_obj);
101 BOOST_CHECK_EQUAL(hash->subhash(0).part_of_obj(0), (
Uint) 0);
102 BOOST_CHECK_EQUAL(hash->subhash(0).part_of_obj(3), (
Uint) 1);
103 BOOST_CHECK_EQUAL(hash->subhash(0).part_of_obj(6), (
Uint) 2);
104 BOOST_CHECK_EQUAL(hash->subhash(1).part_of_obj(0), (
Uint) 0);
105 BOOST_CHECK_EQUAL(hash->subhash(1).part_of_obj(2), (
Uint) 1);
106 BOOST_CHECK_EQUAL(hash->subhash(1).part_of_obj(4), (
Uint) 2);
108 BOOST_CHECK_EQUAL(hash->subhash(0).part_size(), (
Uint) 3);
109 BOOST_CHECK_EQUAL(hash->subhash(1).part_size(), (
Uint) 2);
110 BOOST_CHECK_EQUAL(hash->part_size(), (
Uint) 5);
112 BOOST_CHECK_EQUAL(hash->part_of_obj(0), (
Uint) 0);
113 BOOST_CHECK_EQUAL(hash->part_of_obj(2), (
Uint) 0);
114 BOOST_CHECK_EQUAL(hash->part_of_obj(3), (
Uint) 0);
115 BOOST_CHECK_EQUAL(hash->part_of_obj(4), (
Uint) 0);
116 BOOST_CHECK_EQUAL(hash->part_of_obj(5), (
Uint) 1);
117 BOOST_CHECK_EQUAL(hash->part_of_obj(7), (
Uint) 1);
118 BOOST_CHECK_EQUAL(hash->part_of_obj(8), (
Uint) 1);
119 BOOST_CHECK_EQUAL(hash->part_of_obj(9), (
Uint) 1);
120 BOOST_CHECK_EQUAL(hash->part_of_obj(10), (
Uint) 2);
121 BOOST_CHECK_EQUAL(hash->part_of_obj(13), (
Uint) 2);
122 BOOST_CHECK_EQUAL(hash->part_of_obj(14), (
Uint) 2);
123 BOOST_CHECK_EQUAL(hash->part_of_obj(16), (
Uint) 2);
125 BOOST_CHECK_EQUAL(hash->start_idx_in_part(0), (
Uint) 0);
126 BOOST_CHECK_EQUAL(hash->start_idx_in_part(1), (
Uint) 5);
127 BOOST_CHECK_EQUAL(hash->start_idx_in_part(2), (
Uint) 10);
129 BOOST_CHECK_EQUAL(hash->end_idx_in_part(0), (
Uint) 5);
130 BOOST_CHECK_EQUAL(hash->end_idx_in_part(1), (
Uint) 10);
131 BOOST_CHECK_EQUAL(hash->end_idx_in_part(2), (
Uint) 18);
133 BOOST_CHECK_EQUAL(hash->nb_objects_in_part(0), (
Uint) 5);
134 BOOST_CHECK_EQUAL(hash->nb_objects_in_part(1), (
Uint) 5);
135 BOOST_CHECK_EQUAL(hash->nb_objects_in_part(2), (
Uint) 8);
138 BOOST_CHECK_EQUAL(hash->subhash_of_obj(0), (
Uint) 0);
139 BOOST_CHECK_EQUAL(hash->subhash_of_obj(2), (
Uint) 0);
140 BOOST_CHECK_EQUAL(hash->subhash_of_obj(3), (
Uint) 1);
141 BOOST_CHECK_EQUAL(hash->subhash_of_obj(4), (
Uint) 1);
142 BOOST_CHECK_EQUAL(hash->subhash_of_obj(5), (
Uint) 0);
143 BOOST_CHECK_EQUAL(hash->subhash_of_obj(7), (
Uint) 0);
144 BOOST_CHECK_EQUAL(hash->subhash_of_obj(8), (
Uint) 1);
145 BOOST_CHECK_EQUAL(hash->subhash_of_obj(9), (
Uint) 1);
146 BOOST_CHECK_EQUAL(hash->subhash_of_obj(10), (
Uint) 0);
147 BOOST_CHECK_EQUAL(hash->subhash_of_obj(13), (
Uint) 0);
148 BOOST_CHECK_EQUAL(hash->subhash_of_obj(14), (
Uint) 1);
149 BOOST_CHECK_EQUAL(hash->subhash_of_obj(16), (
Uint) 1);
156 BOOST_AUTO_TEST_SUITE_END()
~TestParallelDistribution_Fixture()
common tear-down for each test case
BOOST_AUTO_TEST_CASE(Constructors)
Basic Classes for Mesh applications used by COOLFluiD.
Top-level namespace for coolfluid.
TestParallelDistribution_Fixture()
common setup for each test case
unsigned int Uint
typedef for unsigned int
Most basic kernel library.