10#ifndef VTKWRITER_UNIT_TESTS_HPP_
11#define VTKWRITER_UNIT_TESTS_HPP_
13#include "data_type/aggregate.hpp"
15#include "VTKWriter.hpp"
16#include "util/SimpleRNG.hpp"
18BOOST_AUTO_TEST_SUITE( vtk_writer_test )
26 typedef boost::fusion::vector<float,float,float,float,size_t,double,unsigned char,long int>
type;
34 static const std::string name[];
41 static const unsigned int x = 0;
43 static const unsigned int y = 1;
45 static const unsigned int z = 2;
47 static const unsigned int prp1 = 3;
49 static const unsigned int prp2 = 4;
51 static const unsigned int prp3 = 5;
53 static const unsigned int prp4 = 6;
55 static const unsigned int prp5 = 7;
58 static const unsigned int max_prop = 8;
69 static inline bool noPointers()
83 boost::fusion::at_c<vertex::x>(data) = x;
84 boost::fusion::at_c<vertex::y>(data) = y;
85 boost::fusion::at_c<vertex::z>(data) = z;
89const std::string vertex::attributes::name[] = {
"x",
"y",
"z",
"prp1",
"prp2",
"prp3",
"prp4",
"prp5"};
94 typedef boost::fusion::vector<float[3],size_t,double>
type;
102 static const std::string name[];
109 static const unsigned int x = 0;
110 static const unsigned int prp1 = 1;
111 static const unsigned int prp2 = 2;
125 static inline bool noPointers()
139 boost::fusion::at_c<vertex::x>(
data)[0] =
x;
140 boost::fusion::at_c<vertex::x>(
data)[1] = y;
141 boost::fusion::at_c<vertex::x>(
data)[2] = z;
148const std::string vertex2::attributes::name[] = {
"x",
"prp1",
"prp2"};
152BOOST_AUTO_TEST_CASE( vtk_writer_use_graph3D )
228 if (v_cl.
rank() != 0) {
return;}
229 std::string c2 = std::string(
"openfpm_io/test_data/vtk_graph_v2_test.vtk");
233 std::string c2 = std::string(
"test_data/vtk_graph_v2_test.vtk");
238 vtk.write(
"vtk_graph_v2.vtk");
242 bool test = compare(
"vtk_graph_v2.vtk",c2);
243 BOOST_REQUIRE_EQUAL(
true,test);
246BOOST_AUTO_TEST_CASE( vtk_writer_use_graph3D_edge )
322 if (v_cl.
rank() != 0) {
return;}
323 std::string c2 = std::string(
"openfpm_io/test_data/vtk_graph_v4_test.vtk");
327 std::string c2 = std::string(
"test_data/vtk_graph_v4_test.vtk");
332 vtk.write(
"vtk_graph_v4.vtk");
336 bool test = compare(
"vtk_graph_v4.vtk",c2);
337 BOOST_REQUIRE_EQUAL(
true,test);
343 typedef boost::fusion::vector<float[2],size_t,double>
type;
351 static const std::string name[];
358 static const unsigned int x = 0;
359 static const unsigned int prp1 = 1;
360 static const unsigned int prp2 = 2;
374 static inline bool noPointers()
386 boost::fusion::at_c<vertex::x>(
data)[0] =
x;
387 boost::fusion::at_c<vertex::x>(
data)[1] = y;
394const std::string vertex3::attributes::name[] = {
"x",
"prp1",
"prp2"};
396BOOST_AUTO_TEST_CASE( vtk_writer_use_graph2D )
425 if (v_cl.
rank() != 0) {
return;}
426 std::string c2 = std::string(
"openfpm_io/test_data/vtk_graph_v3_test.vtk");
430 std::string c2 = std::string(
"test_data/vtk_graph_v3_test.vtk");
435 vtk.write(
"vtk_graph_v3.vtk");
439 bool test = compare(
"vtk_graph_v3.vtk",c2);
440 BOOST_REQUIRE_EQUAL(
true,test);
443BOOST_AUTO_TEST_CASE( vtk_writer_use_graph)
452 std::cout <<
"Graph unit test start" <<
"\n";
519 if (v_cl.
rank() != 0) {
return;}
520 std::string c2 = std::string(
"openfpm_io/test_data/vtk_graph_test.vtk");
524 std::string c2 = std::string(
"test_data/vtk_graph_test.vtk");
531 vtk.write(
"vtk_graph.vtk");
535 bool test = compare(
"vtk_graph.vtk",c2);
536 BOOST_REQUIRE_EQUAL(
true,test);
539BOOST_AUTO_TEST_CASE( vtk_writer_use_vector_box)
548 if (v_cl.
rank() != 0) {
return;}
549 std::string c2 = std::string(
"openfpm_io/test_data/vtk_box_test.vtk");
550 std::string c3 = std::string(
"openfpm_io/test_data/vtk_box_3D_test.vtk");
551 std::string c4 = std::string(
"openfpm_io/test_data/vtk_box_3D_2_test.vtk");
555 std::string c2 = std::string(
"test_data/vtk_box_test.vtk");
556 std::string c3 = std::string(
"test_data/vtk_box_3D_test.vtk");
557 std::string c4 = std::string(
"test_data/vtk_box_3D_2_test.vtk");
574 vtk_box.write(
"vtk_box.vtk");
577 bool test = compare(
"vtk_box.vtk",c2);
578 BOOST_REQUIRE_EQUAL(test,
true);
593 vtk_box2.write(
"vtk_box_3D.vtk");
596 test = compare(
"vtk_box_3D.vtk",c3);
597 BOOST_REQUIRE_EQUAL(test,
true);
612 vtk_box3.write(
"vtk_box_3D_2.vtk");
615 test = compare(
"vtk_box_3D_2.vtk",c4);
616 BOOST_REQUIRE_EQUAL(test,
true);
624template<
typename gr
id_type>
void fill_grid_some_data(
grid_type & g)
628 auto it = g.getIterator();
632 g.template get<p::x>(it.get()) = it.
get().get(0);
634 {g.template get<p::y>(it.get()) = it.
get().get(1);}
636 {g.template get<p::y>(it.get()) = 0.0;}
637 g.template get<p::z>(it.get()) = 0;
638 g.template get<p::s>(it.get()) = 1.0;
639 g.template get<p::v>(it.get())[0] = g.getGrid().LinId(it.get());
640 g.template get<p::v>(it.get())[1] = g.getGrid().LinId(it.get());
641 g.template get<p::v>(it.get())[2] = g.getGrid().LinId(it.get());
643 g.template get<p::t>(it.get())[0][0] = g.getGrid().LinId(it.get());
644 g.template get<p::t>(it.get())[0][1] = g.getGrid().LinId(it.get());
645 g.template get<p::t>(it.get())[0][2] = g.getGrid().LinId(it.get());
646 g.template get<p::t>(it.get())[1][0] = g.getGrid().LinId(it.get());
647 g.template get<p::t>(it.get())[1][1] = g.getGrid().LinId(it.get());
648 g.template get<p::t>(it.get())[1][2] = g.getGrid().LinId(it.get());
649 g.template get<p::t>(it.get())[2][0] = g.getGrid().LinId(it.get());
650 g.template get<p::t>(it.get())[2][1] = g.getGrid().LinId(it.get());
651 g.template get<p::t>(it.get())[2][2] = g.getGrid().LinId(it.get());
666 auto it = g.getIterator();
670 g.template get<p::x>(it.get()) = it.
get().get(0);
671 g.template get<p::y>(it.get()) = it.
get().get(1);
672 g.template get<p::z>(it.get()) = 0;
673 g.template get<p::s>(it.get()) = 1.0;
674 g.template get<p::v>(it.get())[0] = g.getGrid().LinId(it.get());
675 g.template get<p::v>(it.get())[1] = g.getGrid().LinId(it.get());
676 g.template get<p::v>(it.get())[2] = g.getGrid().LinId(it.get());
678 g.template get<p::t>(it.get())[0][0] = g.getGrid().LinId(it.get());
679 g.template get<p::t>(it.get())[0][1] = g.getGrid().LinId(it.get());
680 g.template get<p::t>(it.get())[0][2] = g.getGrid().LinId(it.get());
681 g.template get<p::t>(it.get())[1][0] = g.getGrid().LinId(it.get());
682 g.template get<p::t>(it.get())[1][1] = g.getGrid().LinId(it.get());
683 g.template get<p::t>(it.get())[1][2] = g.getGrid().LinId(it.get());
684 g.template get<p::t>(it.get())[2][0] = g.getGrid().LinId(it.get());
685 g.template get<p::t>(it.get())[2][1] = g.getGrid().LinId(it.get());
686 g.template get<p::t>(it.get())[2][2] = g.getGrid().LinId(it.get());
700 auto it = g.getIterator();
704 g.template get<p::x>(it.get()) = it.
get().get(0);
705 g.template get<p::y>(it.get()) = it.
get().get(1);
706 g.template get<p::z>(it.get()) = 0;
707 g.template get<p::s>(it.get()) = 1.0;
713BOOST_AUTO_TEST_CASE( vtk_writer_use_grids)
722 if (v_cl.
rank() != 0) {
return;}
723 std::string c2 = std::string(
"openfpm_io/test_data/vtk_grids_test_1d.vtk");
724 std::string c3 = std::string(
"openfpm_io/test_data/vtk_grids_test.vtk");
725 std::string c4 = std::string(
"openfpm_io/test_data/vtk_grids_st_test.vtk");
726 std::string c5 = std::string(
"openfpm_io/test_data/vtk_grids_prp_test.vtk");
727 std::string c6 = std::string(
"openfpm_io/test_data/vtk_grids_test.vtk");
731 std::string c2 = std::string(
"test_data/vtk_grids_test_1d.vtk");
732 std::string c3 = std::string(
"test_data/vtk_grids_test.vtk");
733 std::string c4 = std::string(
"test_data/vtk_grids_st_test.vtk");
734 std::string c5 = std::string(
"test_data/vtk_grids_prp_test.vtk");
735 std::string c6 = std::string(
"test_data/vtk_grids_test.vtk");
764 fill_grid_some_data(g1);
767 fill_grid_some_data(g2);
770 fill_grid_some_data(g3);
773 fill_grid_some_data(g4);
775 g4.template get<Point_test<double>::s>(0) = 1.0/3.0;
779 vtk_g.add(g1,offset1,spacing1,d1);
780 vtk_g.add(g2,offset2,spacing2,d2);
781 vtk_g.add(g3,offset3,spacing3,d3);
782 vtk_g.add(g4,offset4,spacing4,d4);
785 vtk_g.write(
"vtk_grids_1d.vtk",prp_names);
790 bool test = compare(
"vtk_grids_1d.vtk",c2);
791 BOOST_REQUIRE_EQUAL(test,
true);
818 size_t sz[] = {16,16};
821 fill_grid_some_data(g1);
824 fill_grid_some_data(g2);
827 fill_grid_some_data(g3);
830 fill_grid_some_data(g4);
834 vtk_g.add(g1,offset1,spacing1,d1);
835 vtk_g.add(g2,offset2,spacing2,d2);
836 vtk_g.add(g3,offset3,spacing3,d3);
837 vtk_g.add(g4,offset4,spacing4,d4);
840 vtk_g.write(
"vtk_grids.vtk",prp_names);
845 bool test = compare(
"vtk_grids.vtk",c3);
846 BOOST_REQUIRE_EQUAL(test,
true);
872 size_t sz[] = {16,16};
875 fill_grid_some_data(g1);
878 fill_grid_some_data(g2);
881 fill_grid_some_data(g3);
884 fill_grid_some_data(g4);
894 vtk_g.add(0,g1,offset1,spacing1,d1,cmb);
895 vtk_g.add(0,g2,offset2,spacing2,d2,cmb);
896 vtk_g.add(1,g3,offset3,spacing3,d3,cmb);
897 vtk_g.add(1,g4,offset4,spacing4,d4,cmb2);
899 vtk_g.write(
"vtk_grids_st.vtk");
902 bool test = compare(
"vtk_grids_st.vtk",c4);
903 BOOST_REQUIRE_EQUAL(test,
true);
927 size_t sz[] = {16,16};
930 fill_grid_some_data_scal(g1);
933 fill_grid_some_data_scal(g2);
936 fill_grid_some_data_scal(g3);
939 fill_grid_some_data_scal(g4);
943 vtk_g.add(g1,offset1,spacing1,d1);
944 vtk_g.add(g2,offset2,spacing2,d2);
945 vtk_g.add(g3,offset3,spacing3,d3);
946 vtk_g.add(g4,offset4,spacing4,d4);
949 vtk_g.write(
"vtk_grids_prp.vtk",prp_names);
952 bool test = compare(
"vtk_grids_prp.vtk",c5);
953 BOOST_REQUIRE_EQUAL(test,
true);
977 size_t sz[] = {16,16};
980 fill_grid_some_data(g1);
983 fill_grid_some_data(g2);
986 fill_grid_some_data(g3);
989 fill_grid_some_data(g4);
993 vtk_g.add(g1,offset1,spacing1,d1);
994 vtk_g.add(g2,offset2,spacing2,d2);
995 vtk_g.add(g3,offset3,spacing3,d3);
996 vtk_g.add(g4,offset4,spacing4,d4);
999 vtk_g.write(
"vtk_grids_unk.vtk",prp_names);
1004 bool test = compare(
"vtk_grids_unk.vtk",c6);
1005 BOOST_REQUIRE_EQUAL(test,
true);
1015 BOOST_REQUIRE_EQUAL(ret,
true);
1017 BOOST_REQUIRE_EQUAL(ret,
true);
1020 BOOST_REQUIRE_EQUAL(dims,3);
1023 BOOST_REQUIRE_EQUAL(dims,1);
1029BOOST_AUTO_TEST_CASE( vtk_writer_use_point_set )
1038 if (v_cl.
rank() != 0) {
return;}
1039 std::string c2 = std::string(
"openfpm_io/test_data/vtk_points_test.vtk");
1040 std::string c3 = std::string(
"openfpm_io/test_data/vtk_points_pp_test.vtk");
1041 std::string c4 = std::string(
"openfpm_io/test_data/vtk_points_pp_header_test.vtk");
1045 std::string c2 = std::string(
"test_data/vtk_points_test.vtk");
1046 std::string c3 = std::string(
"test_data/vtk_points_pp_test.vtk");
1047 std::string c4 = std::string(
"test_data/vtk_points_pp_header_test.vtk");
1075 for (
size_t i = 0 ; i < v1ps.
size(); i++)
1077 v1ps.template get<0>(i)[0] = rng.GetUniform();
1078 v1ps.template get<0>(i)[1] = rng.GetUniform();
1079 v1ps.template get<0>(i)[2] = rng.GetUniform();
1081 v2ps.template get<0>(i)[0] = rng.GetUniform()*0.5;
1082 v2ps.template get<0>(i)[1] = rng.GetUniform()*0.5;
1083 v2ps.template get<0>(i)[2] = rng.GetUniform()*0.5;
1085 v3ps.template get<0>(i)[0] = rng.GetUniform()*0.3;
1086 v3ps.template get<0>(i)[1] = rng.GetUniform()*0.3;
1087 v3ps.template get<0>(i)[2] = rng.GetUniform()*0.3;
1089 v1pp.template get<0>(i) = rng.GetUniform();
1090 v1pp.template get<1>(i)[0] = rng.GetUniform();
1091 v1pp.template get<1>(i)[1] = rng.GetUniform();
1092 v1pp.template get<1>(i)[2] = rng.GetUniform();
1094 v2pp.template get<0>(i) = rng.GetUniform();
1095 v2pp.template get<1>(i)[0] = rng.GetUniform();
1096 v2pp.template get<1>(i)[1] = rng.GetUniform();
1097 v2pp.template get<1>(i)[2] = rng.GetUniform();
1099 v3pp.template get<0>(i) = rng.GetUniform();
1100 v3pp.template get<1>(i)[0] = rng.GetUniform();
1101 v3pp.template get<1>(i)[1] = rng.GetUniform();
1102 v3pp.template get<1>(i)[2] = rng.GetUniform();
1104 v4pp.template get<0>(i) = rng.GetUniform();
1105 v4pp.template get<1>(i).get(0) = rng.GetUniform();
1106 v4pp.template get<1>(i).get(1) = rng.GetUniform();
1107 v4pp.template get<1>(i).get(2) = rng.GetUniform();
1112 vtk_v.add(v1ps,v1pp,75);
1113 vtk_v.add(v2ps,v2pp,88);
1114 vtk_v.add(v3ps,v3pp,90);
1117 vtk_v.write(
"vtk_points.vtp",prp_names);
1120 vtk_v.write_pvtp(
"vtk_points",prp_names,2);
1128 test = compare(
"vtk_points.vtp",
"test_data/vtk_points_test.vtp");
1129 BOOST_REQUIRE_EQUAL(test,
true);
1132 test = compare(
"vtk_points.pvtp",
"test_data/pvtp_points_test.pvtp");
1133 BOOST_REQUIRE_EQUAL(test,
true);
1139 vtk_v2.add(v1ps,v4pp,75);
1141 vtk_v2.write(
"vtk_points_pp.vtp",prp_names);
1146 test = compare(
"vtk_points_pp.vtp",
"test_data/vtk_points_pp_test.vtp");
1147 BOOST_REQUIRE_EQUAL(test,
true);
1153 vtk_v3.add(v1ps,v4pp,75);
1155 vtk_v3.write(
"vtk_points_pp_header.vtp",prp_names,
"points",
"time=5.123");
1158 vtk_v3.write(
"vtk_points_pp_header_bin.vtp",prp_names,
"points",
"time=5.123",file_type::BINARY);
1163 test = compare(
"vtk_points_pp_header.vtp",
"test_data/vtk_points_pp_header_test.vtp");
1164 BOOST_REQUIRE_EQUAL(test,
true);
1166 test = compare(
"vtk_points_pp_header_bin.vtp",
"test_data/vtk_points_pp_header_bin_test.vtp");
1167 BOOST_REQUIRE_EQUAL(test,
true);
1174BOOST_AUTO_TEST_CASE( vtk_writer_use_point_set_properties )
1183 if (v_cl.
rank() != 0) {
return;}
1184 std::string c2 = std::string(
"openfpm_io/test_data/vtk_points_with_prp_names_test.vtk");
1188 std::string c2 = std::string(
"test_data/vtk_points_with_prp_names_test.vtk");
1205 for (
size_t i = 0 ; i < v1ps.
size(); i++)
1207 v1ps.template get<0>(i)[0] = rng.GetUniform();
1208 v1ps.template get<0>(i)[1] = rng.GetUniform();
1209 v1ps.template get<0>(i)[2] = rng.GetUniform();
1212 v1pp.template get<0>(i) = rng.GetUniform();
1213 v1pp.template get<1>(i)[0] = rng.GetUniform();
1214 v1pp.template get<1>(i)[1] = rng.GetUniform();
1215 v1pp.template get<1>(i)[2] = rng.GetUniform();
1222 vtk_v.add(v1ps,v1pp,75);
1224 vtk_v.write(
"vtk_points_with_prp_names.vtp",prp_names);
1229 bool test = compare(
"vtk_points_with_prp_names.vtp",
"test_data/vtk_points_with_prp_names_test.vtp");
1230 BOOST_REQUIRE_EQUAL(test,
true);
1237BOOST_AUTO_TEST_CASE( vtk_writer_use_point_set_check_out_precision )
1246 if (v_cl.
rank() != 0) {
return;}
1247 std::string c2 = std::string(
"openfpm_io/test_data/vtk_points_with_prp_names_prec_check_test.vtk");
1251 std::string c2 = std::string(
"test_data/vtk_points_with_prp_names_prec_check_test.vtk");
1264 for (
size_t i = 0 ; i < v1ps.
size(); i++)
1266 v1ps.template get<0>(i)[0] = std::numeric_limits<double>::max();
1267 v1ps.template get<0>(i)[1] = std::numeric_limits<double>::max();
1268 v1ps.template get<0>(i)[2] = std::numeric_limits<double>::max();
1271 v1pp.template get<0>(i) = std::numeric_limits<float>::max();
1272 v1pp.template get<1>(i)[0] = std::numeric_limits<double>::max();
1273 v1pp.template get<1>(i)[1] = std::numeric_limits<double>::max();
1274 v1pp.template get<1>(i)[2] = std::numeric_limits<double>::max();
1281 vtk_v.add(v1ps,v1pp,75);
1283 vtk_v.write(
"vtk_points_with_prp_names_prec_check.vtp",prp_names);
1288 bool test = compare(
"vtk_points_with_prp_names_prec_check.vtp",
"test_data/vtk_points_with_prp_names_prec_check_test.vtp");
1289 BOOST_REQUIRE_EQUAL(test,
true);
1296BOOST_AUTO_TEST_CASE( vtk_writer_use_point_set_binary )
1305 if (v_cl.
rank() != 0) {
return;}
1306 std::string c2 = std::string(
"openfpm_io/test_data/vtk_points_bin_test.vtk");
1307 std::string c3 = std::string(
"openfpm_io/test_data/vtk_points_pp_bin_test.vtk");
1308 std::string c4 = std::string(
"openfpm_io/test_data/vtk_points_2d_bin_test.vtk");
1309 std::string c5 = std::string(
"openfpm_io/test_data/vtk_points_2d_pp_bin_test.vtk");
1313 std::string c2 = std::string(
"test_data/vtk_points_bin_test.vtk");
1314 std::string c3 = std::string(
"test_data/vtk_points_pp_bin_test.vtk");
1315 std::string c4 = std::string(
"test_data/vtk_points_2d_bin_test.vtk");
1316 std::string c5 = std::string(
"test_data/vtk_points_2d_pp_bin_test.vtk");
1344 for (
size_t i = 0 ; i < v1ps.
size(); i++)
1346 v1ps.template get<0>(i)[0] = rng.GetUniform();
1347 v1ps.template get<0>(i)[1] = rng.GetUniform();
1348 v1ps.template get<0>(i)[2] = rng.GetUniform();
1350 v2ps.template get<0>(i)[0] = rng.GetUniform()*0.5;
1351 v2ps.template get<0>(i)[1] = rng.GetUniform()*0.5;
1352 v2ps.template get<0>(i)[2] = rng.GetUniform()*0.5;
1354 v3ps.template get<0>(i)[0] = rng.GetUniform()*0.3;
1355 v3ps.template get<0>(i)[1] = rng.GetUniform()*0.3;
1356 v3ps.template get<0>(i)[2] = rng.GetUniform()*0.3;
1358 v1pp.template get<0>(i) = rng.GetUniform();
1359 v1pp.template get<1>(i)[0] = rng.GetUniform();
1360 v1pp.template get<1>(i)[1] = rng.GetUniform();
1361 v1pp.template get<1>(i)[2] = rng.GetUniform();
1363 v2pp.template get<0>(i) = rng.GetUniform();
1364 v2pp.template get<1>(i)[0] = rng.GetUniform();
1365 v2pp.template get<1>(i)[1] = rng.GetUniform();
1366 v2pp.template get<1>(i)[2] = rng.GetUniform();
1368 v3pp.template get<0>(i) = rng.GetUniform();
1369 v3pp.template get<1>(i)[0] = rng.GetUniform();
1370 v3pp.template get<1>(i)[1] = rng.GetUniform();
1371 v3pp.template get<1>(i)[2] = rng.GetUniform();
1373 v4pp.template get<0>(i) = rng.GetUniform();
1374 v4pp.template get<1>(i).get(0) = rng.GetUniform();
1375 v4pp.template get<1>(i).get(1) = rng.GetUniform();
1376 v4pp.template get<1>(i).get(2) = rng.GetUniform();
1381 vtk_v.add(v1ps,v1pp,75);
1382 vtk_v.add(v2ps,v2pp,88);
1383 vtk_v.add(v3ps,v3pp,90);
1386 vtk_v.write(
"vtk_points_bin.vtp",prp_names,
"vtk output",
"",file_type::BINARY);
1387 vtk_v.write(
"vtk_points_bin2.vtp",prp_names,
"vtk output",
"",file_type::BINARY);
1394 test = compare(
"vtk_points_bin.vtp",
"test_data/vtk_points_bin_test.vtp");
1395 BOOST_REQUIRE_EQUAL(test,
true);
1396 test = compare(
"vtk_points_bin2.vtp",
"test_data/vtk_points_bin_test.vtp");
1397 BOOST_REQUIRE_EQUAL(test,
true);
1403 vtk_v2.add(v1ps,v4pp,75);
1405 vtk_v2.write(
"vtk_points_pp_bin.vtp",prp_names,
"vtk output",
"",file_type::BINARY);
1410 test = compare(
"vtk_points_pp_bin.vtp",
"test_data/vtk_points_pp_bin_test.vtp");
1411 BOOST_REQUIRE_EQUAL(test,
true);
1442 for (
size_t i = 0 ; i < v1ps.
size(); i++)
1444 v1ps.template get<0>(i)[0] = rng.GetUniform();
1445 v1ps.template get<0>(i)[1] = rng.GetUniform();
1447 v2ps.template get<0>(i)[0] = rng.GetUniform()*0.5;
1448 v2ps.template get<0>(i)[1] = rng.GetUniform()*0.5;
1450 v3ps.template get<0>(i)[0] = rng.GetUniform()*0.3;
1451 v3ps.template get<0>(i)[1] = rng.GetUniform()*0.3;
1453 v1pp.template get<0>(i) = rng.GetUniform();
1454 v1pp.template get<1>(i)[0][0] = rng.GetUniform();
1455 v1pp.template get<1>(i)[0][1] = rng.GetUniform();
1456 v1pp.template get<1>(i)[0][2] = rng.GetUniform();
1457 v1pp.template get<1>(i)[1][0] = rng.GetUniform();
1458 v1pp.template get<1>(i)[1][1] = rng.GetUniform();
1459 v1pp.template get<1>(i)[1][2] = rng.GetUniform();
1460 v1pp.template get<1>(i)[2][0] = rng.GetUniform();
1461 v1pp.template get<1>(i)[2][1] = rng.GetUniform();
1462 v1pp.template get<1>(i)[2][2] = rng.GetUniform();
1464 v2pp.template get<0>(i) = rng.GetUniform();
1465 v2pp.template get<1>(i)[0][0] = rng.GetUniform();
1466 v2pp.template get<1>(i)[0][1] = rng.GetUniform();
1467 v2pp.template get<1>(i)[0][2] = rng.GetUniform();
1468 v2pp.template get<1>(i)[1][0] = rng.GetUniform();
1469 v2pp.template get<1>(i)[1][1] = rng.GetUniform();
1470 v2pp.template get<1>(i)[1][2] = rng.GetUniform();
1471 v2pp.template get<1>(i)[2][0] = rng.GetUniform();
1472 v2pp.template get<1>(i)[2][1] = rng.GetUniform();
1473 v2pp.template get<1>(i)[2][2] = rng.GetUniform();
1475 v3pp.template get<0>(i) = rng.GetUniform();
1476 v3pp.template get<1>(i)[0][0] = rng.GetUniform();
1477 v3pp.template get<1>(i)[0][1] = rng.GetUniform();
1478 v3pp.template get<1>(i)[0][2] = rng.GetUniform();
1479 v3pp.template get<1>(i)[1][0] = rng.GetUniform();
1480 v3pp.template get<1>(i)[1][1] = rng.GetUniform();
1481 v3pp.template get<1>(i)[1][2] = rng.GetUniform();
1482 v3pp.template get<1>(i)[2][0] = rng.GetUniform();
1483 v3pp.template get<1>(i)[2][1] = rng.GetUniform();
1484 v3pp.template get<1>(i)[2][2] = rng.GetUniform();
1486 v4pp.template get<0>(i)[0] = rng.GetUniform();
1487 v4pp.template get<0>(i)[1] = rng.GetUniform();
1488 v4pp.template get<0>(i)[2] = rng.GetUniform();
1489 v4pp.template get<1>(i)[0] = rng.GetUniform();
1490 v4pp.template get<1>(i)[1] = rng.GetUniform();
1495 vtk_v.add(v1ps,v1pp,75);
1496 vtk_v.add(v2ps,v2pp,88);
1497 vtk_v.add(v3ps,v3pp,90);
1501 vtk_v.write(
"vtk_points_2d_bin.vtp",stub,
"vtk output",
"",file_type::BINARY);
1508 test = compare(
"vtk_points_2d_bin.vtp",
"test_data/vtk_points_2d_bin_test.vtp");
1509 BOOST_REQUIRE_EQUAL(test,
true);
1515 vtk_v2.add(v1ps,v4pp,75);
1517 vtk_v2.write(
"vtk_points_2d_pp_bin.vtp",stub,
"vtk output",
"",file_type::BINARY);
1522 test = compare(
"vtk_points_2d_pp_bin.vtp",
"test_data/vtk_points_2d_pp_bin_test.vtp");
1523 BOOST_REQUIRE_EQUAL(test,
true);
1529BOOST_AUTO_TEST_SUITE_END()
This class represent an N-dimensional box.
Structure that store a graph in CSR format or basically in compressed adjacency matrix format.
void addVertex(const V &vrt)
add vertex
auto addEdge(size_t v1, size_t v2, const E &ed) -> decltype(e.get(0))
add edge on the graph
Test structure used for several test.
point test with only scalar properties
Test structure used for several test.
This class implement the point shape in an N-dimensional space.
SimpleRNG is a simple random number generator based on George Marsaglia's MWC (multiply with carry) g...
size_t rank()
Get the process unit id.
size_t getProcessUnitID()
Get the process unit id.
Implementation of VCluster class.
This is a distributed grid.
auto get(const grid_dist_key_dx< dim, bg_key > &v1) const -> typename std::add_lvalue_reference< decltype(loc_grid.get(v1.getSub()).template get< p >(v1.getKey()))>::type
Get the reference of the selected element.
static const unsigned int dims
Number of dimensions.
Implementation of 1-D std::vector like structure.
Position of the element of dimension d in the hyper-cube of dimension dim.
void mone()
Set all the elements to -1.
void zero()
Set all the elements to zero.
check for T to be writable
static const unsigned int x
computation property id in boost::fusion::vector
vertex2(float x, float y, float z)
Initialize the VTKVertex.
boost::fusion::vector< float[3], size_t, double > type
The node contain 3 unsigned long integer for communication computation memory and id.
static const unsigned int max_prop
total number of properties boost::fusion::vector
float s_type
type of the positional field
float s_type
type of the positional field
boost::fusion::vector< float[2], size_t, double > type
The node contain 3 unsigned long integer for communication computation memory and id.
vertex3(float x, float y)
Initialize the VTKVertex.
static const unsigned int x
computation property id in boost::fusion::vector
static const unsigned int max_prop
total number of properties boost::fusion::vector
Sub-domain vertex graph node.
boost::fusion::vector< float, float, float, float, size_t, double, unsigned char, long int > type
The node contain 3 unsigned long integer for communication computation memory and id.
float s_type
type of the positional field
vertex(float x, float y, float z)
Initialize the VTKVertex.
If it has not dims property defined the object is considered scalar.