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"
18 BOOST_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;
89 const 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;
148 const std::string vertex2::attributes::name[] = {
"x",
"prp1",
"prp2"};
152 BOOST_AUTO_TEST_CASE( vtk_writer_use_graph3D )
226 std::string c2 = std::string(
"test_data/vtk_graph_v2_test.vtk");
229 vtk.write(
"vtk_graph_v2.vtk");
233 bool test = compare(
"vtk_graph_v2.vtk",c2);
234 BOOST_REQUIRE_EQUAL(
true,test);
237 BOOST_AUTO_TEST_CASE( vtk_writer_use_graph3D_edge )
311 std::string c2 = std::string(
"test_data/vtk_graph_v4_test.vtk");
314 vtk.write(
"vtk_graph_v4.vtk");
318 bool test = compare(
"vtk_graph_v4.vtk",c2);
319 BOOST_REQUIRE_EQUAL(
true,test);
325 typedef boost::fusion::vector<float[2],size_t,double>
type;
333 static const std::string name[];
340 static const unsigned int x = 0;
341 static const unsigned int prp1 = 1;
342 static const unsigned int prp2 = 2;
356 static inline bool noPointers()
368 boost::fusion::at_c<vertex::x>(
data)[0] =
x;
369 boost::fusion::at_c<vertex::x>(
data)[1] = y;
376 const std::string vertex3::attributes::name[] = {
"x",
"prp1",
"prp2"};
378 BOOST_AUTO_TEST_CASE( vtk_writer_use_graph2D )
405 std::string c2 = std::string(
"test_data/vtk_graph_v3_test.vtk");
408 vtk.write(
"vtk_graph_v3.vtk");
412 bool test = compare(
"vtk_graph_v3.vtk",c2);
413 BOOST_REQUIRE_EQUAL(
true,test);
416 BOOST_AUTO_TEST_CASE( vtk_writer_use_graph)
425 std::cout <<
"Graph unit test start" <<
"\n";
490 std::string c2 = std::string(
"test_data/vtk_graph_test.vtk");
495 vtk.write(
"vtk_graph.vtk");
499 bool test = compare(
"vtk_graph.vtk",c2);
500 BOOST_REQUIRE_EQUAL(
true,test);
503 BOOST_AUTO_TEST_CASE( vtk_writer_use_vector_box)
510 std::string c2 = std::string(
"test_data/vtk_box_test.vtk");
511 std::string c3 = std::string(
"test_data/vtk_box_3D_test.vtk");
512 std::string c4 = std::string(
"test_data/vtk_box_3D_2_test.vtk");
527 vtk_box.write(
"vtk_box.vtk");
530 bool test = compare(
"vtk_box.vtk",c2);
531 BOOST_REQUIRE_EQUAL(test,
true);
546 vtk_box2.write(
"vtk_box_3D.vtk");
549 test = compare(
"vtk_box_3D.vtk",c3);
550 BOOST_REQUIRE_EQUAL(test,
true);
565 vtk_box3.write(
"vtk_box_3D_2.vtk");
568 test = compare(
"vtk_box_3D_2.vtk",c4);
569 BOOST_REQUIRE_EQUAL(test,
true);
577 template<
typename gr
id_type>
void fill_grid_some_data(
grid_type & g)
581 auto it = g.getIterator();
585 g.template get<p::x>(it.get()) = it.
get().get(0);
587 {g.template get<p::y>(it.get()) = it.
get().get(1);}
589 {g.template get<p::y>(it.get()) = 0.0;}
590 g.template get<p::z>(it.get()) = 0;
591 g.template get<p::s>(it.get()) = 1.0;
592 g.template get<p::v>(it.get())[0] = g.getGrid().LinId(it.get());
593 g.template get<p::v>(it.get())[1] = g.getGrid().LinId(it.get());
594 g.template get<p::v>(it.get())[2] = g.getGrid().LinId(it.get());
596 g.template get<p::t>(it.get())[0][0] = g.getGrid().LinId(it.get());
597 g.template get<p::t>(it.get())[0][1] = g.getGrid().LinId(it.get());
598 g.template get<p::t>(it.get())[0][2] = g.getGrid().LinId(it.get());
599 g.template get<p::t>(it.get())[1][0] = g.getGrid().LinId(it.get());
600 g.template get<p::t>(it.get())[1][1] = g.getGrid().LinId(it.get());
601 g.template get<p::t>(it.get())[1][2] = g.getGrid().LinId(it.get());
602 g.template get<p::t>(it.get())[2][0] = g.getGrid().LinId(it.get());
603 g.template get<p::t>(it.get())[2][1] = g.getGrid().LinId(it.get());
604 g.template get<p::t>(it.get())[2][2] = g.getGrid().LinId(it.get());
619 auto it = g.getIterator();
623 g.template get<p::x>(it.get()) = it.
get().get(0);
624 g.template get<p::y>(it.get()) = it.
get().get(1);
625 g.template get<p::z>(it.get()) = 0;
626 g.template get<p::s>(it.get()) = 1.0;
627 g.template get<p::v>(it.get())[0] = g.getGrid().LinId(it.get());
628 g.template get<p::v>(it.get())[1] = g.getGrid().LinId(it.get());
629 g.template get<p::v>(it.get())[2] = g.getGrid().LinId(it.get());
631 g.template get<p::t>(it.get())[0][0] = g.getGrid().LinId(it.get());
632 g.template get<p::t>(it.get())[0][1] = g.getGrid().LinId(it.get());
633 g.template get<p::t>(it.get())[0][2] = g.getGrid().LinId(it.get());
634 g.template get<p::t>(it.get())[1][0] = g.getGrid().LinId(it.get());
635 g.template get<p::t>(it.get())[1][1] = g.getGrid().LinId(it.get());
636 g.template get<p::t>(it.get())[1][2] = g.getGrid().LinId(it.get());
637 g.template get<p::t>(it.get())[2][0] = g.getGrid().LinId(it.get());
638 g.template get<p::t>(it.get())[2][1] = g.getGrid().LinId(it.get());
639 g.template get<p::t>(it.get())[2][2] = g.getGrid().LinId(it.get());
653 auto it = g.getIterator();
657 g.template get<p::x>(it.get()) = it.
get().get(0);
658 g.template get<p::y>(it.get()) = it.
get().get(1);
659 g.template get<p::z>(it.get()) = 0;
660 g.template get<p::s>(it.get()) = 1.0;
666 BOOST_AUTO_TEST_CASE( vtk_writer_use_grids)
673 std::string c2 = std::string(
"test_data/vtk_grids_test_1d.vtk");
674 std::string c3 = std::string(
"test_data/vtk_grids_test.vtk");
675 std::string c4 = std::string(
"test_data/vtk_grids_st_test.vtk");
676 std::string c5 = std::string(
"test_data/vtk_grids_prp_test.vtk");
677 std::string c6 = std::string(
"test_data/vtk_grids_test.vtk");
704 fill_grid_some_data(g1);
707 fill_grid_some_data(g2);
710 fill_grid_some_data(g3);
713 fill_grid_some_data(g4);
715 g4.template get<Point_test<double>::s>(0) = 1.0/3.0;
719 vtk_g.add(g1,offset1,spacing1,d1);
720 vtk_g.add(g2,offset2,spacing2,d2);
721 vtk_g.add(g3,offset3,spacing3,d3);
722 vtk_g.add(g4,offset4,spacing4,d4);
725 vtk_g.write(
"vtk_grids_1d.vtk",prp_names);
730 bool test = compare(
"vtk_grids_1d.vtk",c2);
731 BOOST_REQUIRE_EQUAL(test,
true);
758 size_t sz[] = {16,16};
761 fill_grid_some_data(g1);
764 fill_grid_some_data(g2);
767 fill_grid_some_data(g3);
770 fill_grid_some_data(g4);
774 vtk_g.add(g1,offset1,spacing1,d1);
775 vtk_g.add(g2,offset2,spacing2,d2);
776 vtk_g.add(g3,offset3,spacing3,d3);
777 vtk_g.add(g4,offset4,spacing4,d4);
780 vtk_g.write(
"vtk_grids.vtk",prp_names);
785 bool test = compare(
"vtk_grids.vtk",c3);
786 BOOST_REQUIRE_EQUAL(test,
true);
812 size_t sz[] = {16,16};
815 fill_grid_some_data(g1);
818 fill_grid_some_data(g2);
821 fill_grid_some_data(g3);
824 fill_grid_some_data(g4);
834 vtk_g.add(0,g1,offset1,spacing1,d1,cmb);
835 vtk_g.add(0,g2,offset2,spacing2,d2,cmb);
836 vtk_g.add(1,g3,offset3,spacing3,d3,cmb);
837 vtk_g.add(1,g4,offset4,spacing4,d4,cmb2);
839 vtk_g.write(
"vtk_grids_st.vtk");
842 bool test = compare(
"vtk_grids_st.vtk",c4);
843 BOOST_REQUIRE_EQUAL(test,
true);
867 size_t sz[] = {16,16};
870 fill_grid_some_data_scal(g1);
873 fill_grid_some_data_scal(g2);
876 fill_grid_some_data_scal(g3);
879 fill_grid_some_data_scal(g4);
883 vtk_g.add(g1,offset1,spacing1,d1);
884 vtk_g.add(g2,offset2,spacing2,d2);
885 vtk_g.add(g3,offset3,spacing3,d3);
886 vtk_g.add(g4,offset4,spacing4,d4);
889 vtk_g.write(
"vtk_grids_prp.vtk",prp_names);
892 bool test = compare(
"vtk_grids_prp.vtk",c5);
893 BOOST_REQUIRE_EQUAL(test,
true);
917 size_t sz[] = {16,16};
920 fill_grid_some_data(g1);
923 fill_grid_some_data(g2);
926 fill_grid_some_data(g3);
929 fill_grid_some_data(g4);
933 vtk_g.add(g1,offset1,spacing1,d1);
934 vtk_g.add(g2,offset2,spacing2,d2);
935 vtk_g.add(g3,offset3,spacing3,d3);
936 vtk_g.add(g4,offset4,spacing4,d4);
939 vtk_g.write(
"vtk_grids_unk.vtk",prp_names);
944 bool test = compare(
"vtk_grids_unk.vtk",c6);
945 BOOST_REQUIRE_EQUAL(test,
true);
955 BOOST_REQUIRE_EQUAL(ret,
true);
957 BOOST_REQUIRE_EQUAL(ret,
true);
960 BOOST_REQUIRE_EQUAL(dims,3);
963 BOOST_REQUIRE_EQUAL(dims,1);
969 BOOST_AUTO_TEST_CASE( vtk_writer_use_point_set )
976 std::string c2 = std::string(
"test_data/vtk_points_test.vtk");
977 std::string c3 = std::string(
"test_data/vtk_points_pp_test.vtk");
978 std::string c4 = std::string(
"test_data/vtk_points_pp_header_test.vtk");
1004 for (
size_t i = 0 ; i < v1ps.
size(); i++)
1006 v1ps.template get<0>(i)[0] = rng.GetUniform();
1007 v1ps.template get<0>(i)[1] = rng.GetUniform();
1008 v1ps.template get<0>(i)[2] = rng.GetUniform();
1010 v2ps.template get<0>(i)[0] = rng.GetUniform()*0.5;
1011 v2ps.template get<0>(i)[1] = rng.GetUniform()*0.5;
1012 v2ps.template get<0>(i)[2] = rng.GetUniform()*0.5;
1014 v3ps.template get<0>(i)[0] = rng.GetUniform()*0.3;
1015 v3ps.template get<0>(i)[1] = rng.GetUniform()*0.3;
1016 v3ps.template get<0>(i)[2] = rng.GetUniform()*0.3;
1018 v1pp.template get<0>(i) = rng.GetUniform();
1019 v1pp.template get<1>(i)[0] = rng.GetUniform();
1020 v1pp.template get<1>(i)[1] = rng.GetUniform();
1021 v1pp.template get<1>(i)[2] = rng.GetUniform();
1023 v2pp.template get<0>(i) = rng.GetUniform();
1024 v2pp.template get<1>(i)[0] = rng.GetUniform();
1025 v2pp.template get<1>(i)[1] = rng.GetUniform();
1026 v2pp.template get<1>(i)[2] = rng.GetUniform();
1028 v3pp.template get<0>(i) = rng.GetUniform();
1029 v3pp.template get<1>(i)[0] = rng.GetUniform();
1030 v3pp.template get<1>(i)[1] = rng.GetUniform();
1031 v3pp.template get<1>(i)[2] = rng.GetUniform();
1033 v4pp.template get<0>(i) = rng.GetUniform();
1034 v4pp.template get<1>(i).get(0) = rng.GetUniform();
1035 v4pp.template get<1>(i).get(1) = rng.GetUniform();
1036 v4pp.template get<1>(i).get(2) = rng.GetUniform();
1041 vtk_v.add(v1ps,v1pp,75);
1042 vtk_v.add(v2ps,v2pp,88);
1043 vtk_v.add(v3ps,v3pp,90);
1046 vtk_v.write(
"vtk_points.vtp",prp_names);
1049 vtk_v.write_pvtp(
"vtk_points",prp_names,2);
1057 test = compare(
"vtk_points.vtp",
"test_data/vtk_points_test.vtp");
1058 BOOST_REQUIRE_EQUAL(test,
true);
1061 test = compare(
"vtk_points.pvtp",
"test_data/pvtp_points_test.pvtp");
1062 BOOST_REQUIRE_EQUAL(test,
true);
1068 vtk_v2.add(v1ps,v4pp,75);
1070 vtk_v2.write(
"vtk_points_pp.vtp",prp_names);
1075 test = compare(
"vtk_points_pp.vtp",
"test_data/vtk_points_pp_test.vtp");
1076 BOOST_REQUIRE_EQUAL(test,
true);
1082 vtk_v3.add(v1ps,v4pp,75);
1084 vtk_v3.write(
"vtk_points_pp_header.vtp",prp_names,
"points",
"time=5.123");
1087 vtk_v3.write(
"vtk_points_pp_header_bin.vtp",prp_names,
"points",
"time=5.123",file_type::BINARY);
1092 test = compare(
"vtk_points_pp_header.vtp",
"test_data/vtk_points_pp_header_test.vtp");
1093 BOOST_REQUIRE_EQUAL(test,
true);
1095 test = compare(
"vtk_points_pp_header_bin.vtp",
"test_data/vtk_points_pp_header_bin_test.vtp");
1096 BOOST_REQUIRE_EQUAL(test,
true);
1103 BOOST_AUTO_TEST_CASE( vtk_writer_use_point_set_properties )
1110 std::string c2 = std::string(
"test_data/vtk_points_with_prp_names_test.vtk");
1125 for (
size_t i = 0 ; i < v1ps.
size(); i++)
1127 v1ps.template get<0>(i)[0] = rng.GetUniform();
1128 v1ps.template get<0>(i)[1] = rng.GetUniform();
1129 v1ps.template get<0>(i)[2] = rng.GetUniform();
1132 v1pp.template get<0>(i) = rng.GetUniform();
1133 v1pp.template get<1>(i)[0] = rng.GetUniform();
1134 v1pp.template get<1>(i)[1] = rng.GetUniform();
1135 v1pp.template get<1>(i)[2] = rng.GetUniform();
1142 vtk_v.add(v1ps,v1pp,75);
1144 vtk_v.write(
"vtk_points_with_prp_names.vtp",prp_names);
1149 bool test = compare(
"vtk_points_with_prp_names.vtp",
"test_data/vtk_points_with_prp_names_test.vtp");
1150 BOOST_REQUIRE_EQUAL(test,
true);
1157 BOOST_AUTO_TEST_CASE( vtk_writer_use_point_set_check_out_precision )
1164 std::string c2 = std::string(
"test_data/vtk_points_with_prp_names_prec_check_test.vtk");
1175 for (
size_t i = 0 ; i < v1ps.
size(); i++)
1177 v1ps.template get<0>(i)[0] = std::numeric_limits<double>::max();
1178 v1ps.template get<0>(i)[1] = std::numeric_limits<double>::max();
1179 v1ps.template get<0>(i)[2] = std::numeric_limits<double>::max();
1182 v1pp.template get<0>(i) = std::numeric_limits<float>::max();
1183 v1pp.template get<1>(i)[0] = std::numeric_limits<double>::max();
1184 v1pp.template get<1>(i)[1] = std::numeric_limits<double>::max();
1185 v1pp.template get<1>(i)[2] = std::numeric_limits<double>::max();
1192 vtk_v.add(v1ps,v1pp,75);
1194 vtk_v.write(
"vtk_points_with_prp_names_prec_check.vtp",prp_names);
1199 bool test = compare(
"vtk_points_with_prp_names_prec_check.vtp",
"test_data/vtk_points_with_prp_names_prec_check_test.vtp");
1200 BOOST_REQUIRE_EQUAL(test,
true);
1207 BOOST_AUTO_TEST_CASE( vtk_writer_use_point_set_binary )
1214 std::string c2 = std::string(
"test_data/vtk_points_bin_test.vtk");
1215 std::string c3 = std::string(
"test_data/vtk_points_pp_bin_test.vtk");
1216 std::string c4 = std::string(
"test_data/vtk_points_2d_bin_test.vtk");
1217 std::string c5 = std::string(
"test_data/vtk_points_2d_pp_bin_test.vtk");
1243 for (
size_t i = 0 ; i < v1ps.
size(); i++)
1245 v1ps.template get<0>(i)[0] = rng.GetUniform();
1246 v1ps.template get<0>(i)[1] = rng.GetUniform();
1247 v1ps.template get<0>(i)[2] = rng.GetUniform();
1249 v2ps.template get<0>(i)[0] = rng.GetUniform()*0.5;
1250 v2ps.template get<0>(i)[1] = rng.GetUniform()*0.5;
1251 v2ps.template get<0>(i)[2] = rng.GetUniform()*0.5;
1253 v3ps.template get<0>(i)[0] = rng.GetUniform()*0.3;
1254 v3ps.template get<0>(i)[1] = rng.GetUniform()*0.3;
1255 v3ps.template get<0>(i)[2] = rng.GetUniform()*0.3;
1257 v1pp.template get<0>(i) = rng.GetUniform();
1258 v1pp.template get<1>(i)[0] = rng.GetUniform();
1259 v1pp.template get<1>(i)[1] = rng.GetUniform();
1260 v1pp.template get<1>(i)[2] = rng.GetUniform();
1262 v2pp.template get<0>(i) = rng.GetUniform();
1263 v2pp.template get<1>(i)[0] = rng.GetUniform();
1264 v2pp.template get<1>(i)[1] = rng.GetUniform();
1265 v2pp.template get<1>(i)[2] = rng.GetUniform();
1267 v3pp.template get<0>(i) = rng.GetUniform();
1268 v3pp.template get<1>(i)[0] = rng.GetUniform();
1269 v3pp.template get<1>(i)[1] = rng.GetUniform();
1270 v3pp.template get<1>(i)[2] = rng.GetUniform();
1272 v4pp.template get<0>(i) = rng.GetUniform();
1273 v4pp.template get<1>(i).get(0) = rng.GetUniform();
1274 v4pp.template get<1>(i).get(1) = rng.GetUniform();
1275 v4pp.template get<1>(i).get(2) = rng.GetUniform();
1280 vtk_v.add(v1ps,v1pp,75);
1281 vtk_v.add(v2ps,v2pp,88);
1282 vtk_v.add(v3ps,v3pp,90);
1285 vtk_v.write(
"vtk_points_bin.vtp",prp_names,
"vtk output",
"",file_type::BINARY);
1286 vtk_v.write(
"vtk_points_bin2.vtp",prp_names,
"vtk output",
"",file_type::BINARY);
1293 test = compare(
"vtk_points_bin.vtp",
"test_data/vtk_points_bin_test.vtp");
1294 BOOST_REQUIRE_EQUAL(test,
true);
1295 test = compare(
"vtk_points_bin2.vtp",
"test_data/vtk_points_bin_test.vtp");
1296 BOOST_REQUIRE_EQUAL(test,
true);
1302 vtk_v2.add(v1ps,v4pp,75);
1304 vtk_v2.write(
"vtk_points_pp_bin.vtp",prp_names,
"vtk output",
"",file_type::BINARY);
1309 test = compare(
"vtk_points_pp_bin.vtp",
"test_data/vtk_points_pp_bin_test.vtp");
1310 BOOST_REQUIRE_EQUAL(test,
true);
1341 for (
size_t i = 0 ; i < v1ps.
size(); i++)
1343 v1ps.template get<0>(i)[0] = rng.GetUniform();
1344 v1ps.template get<0>(i)[1] = rng.GetUniform();
1346 v2ps.template get<0>(i)[0] = rng.GetUniform()*0.5;
1347 v2ps.template get<0>(i)[1] = rng.GetUniform()*0.5;
1349 v3ps.template get<0>(i)[0] = rng.GetUniform()*0.3;
1350 v3ps.template get<0>(i)[1] = rng.GetUniform()*0.3;
1352 v1pp.template get<0>(i) = rng.GetUniform();
1353 v1pp.template get<1>(i)[0][0] = rng.GetUniform();
1354 v1pp.template get<1>(i)[0][1] = rng.GetUniform();
1355 v1pp.template get<1>(i)[0][2] = rng.GetUniform();
1356 v1pp.template get<1>(i)[1][0] = rng.GetUniform();
1357 v1pp.template get<1>(i)[1][1] = rng.GetUniform();
1358 v1pp.template get<1>(i)[1][2] = rng.GetUniform();
1359 v1pp.template get<1>(i)[2][0] = rng.GetUniform();
1360 v1pp.template get<1>(i)[2][1] = rng.GetUniform();
1361 v1pp.template get<1>(i)[2][2] = rng.GetUniform();
1363 v2pp.template get<0>(i) = rng.GetUniform();
1364 v2pp.template get<1>(i)[0][0] = rng.GetUniform();
1365 v2pp.template get<1>(i)[0][1] = rng.GetUniform();
1366 v2pp.template get<1>(i)[0][2] = rng.GetUniform();
1367 v2pp.template get<1>(i)[1][0] = rng.GetUniform();
1368 v2pp.template get<1>(i)[1][1] = rng.GetUniform();
1369 v2pp.template get<1>(i)[1][2] = rng.GetUniform();
1370 v2pp.template get<1>(i)[2][0] = rng.GetUniform();
1371 v2pp.template get<1>(i)[2][1] = rng.GetUniform();
1372 v2pp.template get<1>(i)[2][2] = rng.GetUniform();
1374 v3pp.template get<0>(i) = rng.GetUniform();
1375 v3pp.template get<1>(i)[0][0] = rng.GetUniform();
1376 v3pp.template get<1>(i)[0][1] = rng.GetUniform();
1377 v3pp.template get<1>(i)[0][2] = rng.GetUniform();
1378 v3pp.template get<1>(i)[1][0] = rng.GetUniform();
1379 v3pp.template get<1>(i)[1][1] = rng.GetUniform();
1380 v3pp.template get<1>(i)[1][2] = rng.GetUniform();
1381 v3pp.template get<1>(i)[2][0] = rng.GetUniform();
1382 v3pp.template get<1>(i)[2][1] = rng.GetUniform();
1383 v3pp.template get<1>(i)[2][2] = rng.GetUniform();
1385 v4pp.template get<0>(i)[0] = rng.GetUniform();
1386 v4pp.template get<0>(i)[1] = rng.GetUniform();
1387 v4pp.template get<0>(i)[2] = rng.GetUniform();
1388 v4pp.template get<1>(i)[0] = rng.GetUniform();
1389 v4pp.template get<1>(i)[1] = rng.GetUniform();
1394 vtk_v.add(v1ps,v1pp,75);
1395 vtk_v.add(v2ps,v2pp,88);
1396 vtk_v.add(v3ps,v3pp,90);
1400 vtk_v.write(
"vtk_points_2d_bin.vtp",stub,
"vtk output",
"",file_type::BINARY);
1407 test = compare(
"vtk_points_2d_bin.vtp",
"test_data/vtk_points_2d_bin_test.vtp");
1408 BOOST_REQUIRE_EQUAL(test,
true);
1414 vtk_v2.add(v1ps,v4pp,75);
1416 vtk_v2.write(
"vtk_points_2d_pp_bin.vtp",stub,
"vtk output",
"",file_type::BINARY);
1421 test = compare(
"vtk_points_2d_pp_bin.vtp",
"test_data/vtk_points_2d_pp_bin_test.vtp");
1422 BOOST_REQUIRE_EQUAL(test,
true);
1428 BOOST_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 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.