Commit 217bde24 authored by incardon's avatar incardon
Browse files

Fixing precision for VTK

parent 01d5ac50
Pipeline #3063 passed with stages
in 15 minutes
......@@ -917,8 +917,9 @@ template<unsigned int dims,typename T> inline void output_point(Point<dims,T> &
{
if (ft == file_type::ASCII)
{
for (int i = 0 ; i < dims ; i++)
{v_out << p[i];}
v_out << p[0];
for (int i = 1 ; i < dims ; i++)
{v_out << " " << p[i];}
size_t i = dims;
for ( ; i < 3 ; i++)
{v_out << " 0.0";}
......
......@@ -1019,14 +1019,14 @@ BOOST_AUTO_TEST_CASE( vtk_writer_use_point_set )
vtk_v.add(v3ps,v3pp,90);
openfpm::vector<std::string> prp_names;
vtk_v.write("vtk_points.vtp",prp_names);
vtk_v.write("vtk_points.vtk",prp_names);
#ifndef SE_CLASS3
bool test = true;
// Check that match
test = compare("vtk_points.vtp","test_data/vtk_points_test.vtp");
test = compare("vtk_points.vtk","test_data/vtk_points_test.vtk");
BOOST_REQUIRE_EQUAL(test,true);
#endif
......@@ -1035,12 +1035,12 @@ BOOST_AUTO_TEST_CASE( vtk_writer_use_point_set )
VTKWriter<boost::mpl::pair<openfpm::vector<Point<3,double>>,openfpm::vector<aggregate<float,Point<3,float>>>>,VECTOR_POINTS> vtk_v2;
vtk_v2.add(v1ps,v4pp,75);
vtk_v2.write("vtk_points_pp.vtp",prp_names);
vtk_v2.write("vtk_points_pp.vtk",prp_names);
#ifndef SE_CLASS3
// Check that match
test = compare("vtk_points_pp.vtp","test_data/vtk_points_pp_test.vtp");
test = compare("vtk_points_pp.vtk","test_data/vtk_points_pp_test.vtk");
BOOST_REQUIRE_EQUAL(test,true);
#endif
......@@ -1049,15 +1049,15 @@ BOOST_AUTO_TEST_CASE( vtk_writer_use_point_set )
VTKWriter<boost::mpl::pair<openfpm::vector<Point<3,double>>,openfpm::vector<aggregate<float,Point<3,float>>>>,VECTOR_POINTS> vtk_v3;
vtk_v3.add(v1ps,v4pp,75);
vtk_v3.write("vtk_points_pp_header.vtp",prp_names,"points","time=5.123");
vtk_v3.write("vtk_points_pp_header.vtk",prp_names,"points","time=5.123");
// We try binary
vtk_v3.write("vtk_points_pp_header_bin.vtp",prp_names,"points","time=5.123",file_type::BINARY);
vtk_v3.write("vtk_points_pp_header_bin.vtk",prp_names,"points","time=5.123",file_type::BINARY);
#ifndef SE_CLASS3
// Check that match
test = compare("vtk_points_pp_header.vtp","test_data/vtk_points_pp_header_test.vtp");
test = compare("vtk_points_pp_header.vtk","test_data/vtk_points_pp_header_test.vtk");
BOOST_REQUIRE_EQUAL(test,true);
#endif
......@@ -1104,12 +1104,12 @@ BOOST_AUTO_TEST_CASE( vtk_writer_use_point_set_properties )
VTKWriter<boost::mpl::pair<openfpm::vector<Point<3,double>>,openfpm::vector<aggregate<float,float[3]>>>,VECTOR_POINTS> vtk_v;
vtk_v.add(v1ps,v1pp,75);
openfpm::vector<std::string> prp_names({"scalar","vector"});
vtk_v.write("vtk_points_with_prp_names.vtp",prp_names);
vtk_v.write("vtk_points_with_prp_names.vtk",prp_names);
#ifndef SE_CLASS3
// Check that match
bool test = compare("vtk_points_with_prp_names.vtp","test_data/vtk_points_with_prp_names_test.vtp");
bool test = compare("vtk_points_with_prp_names.vtk","test_data/vtk_points_with_prp_names_test.vtk");
BOOST_REQUIRE_EQUAL(test,true);
#endif
......@@ -1152,12 +1152,12 @@ BOOST_AUTO_TEST_CASE( vtk_writer_use_point_set_check_out_precision )
VTKWriter<boost::mpl::pair<openfpm::vector<Point<3,double>>,openfpm::vector<aggregate<float,double[3]>>>,VECTOR_POINTS> vtk_v;
vtk_v.add(v1ps,v1pp,75);
openfpm::vector<std::string> prp_names({"scalar","vector"});
vtk_v.write("vtk_points_with_prp_names_prec_check.vtp",prp_names);
vtk_v.write("vtk_points_with_prp_names_prec_check.vtk",prp_names);
#ifndef SE_CLASS3
// Check that match
bool test = compare("vtk_points_with_prp_names_prec_check.vtp","test_data/vtk_points_with_prp_names_prec_check_test.vtp");
bool test = compare("vtk_points_with_prp_names_prec_check.vtk","test_data/vtk_points_with_prp_names_prec_check_test.vtk");
BOOST_REQUIRE_EQUAL(test,true);
#endif
......@@ -1238,17 +1238,17 @@ BOOST_AUTO_TEST_CASE( vtk_writer_use_point_set_binary )
vtk_v.add(v3ps,v3pp,90);
openfpm::vector<std::string> prp_names;
vtk_v.write("vtk_points_bin.vtp",prp_names,"vtk output","",file_type::BINARY);
vtk_v.write("vtk_points_bin2.vtp",prp_names,"vtk output","",file_type::BINARY);
vtk_v.write("vtk_points_bin.vtk",prp_names,"vtk output","",file_type::BINARY);
vtk_v.write("vtk_points_bin2.vtk",prp_names,"vtk output","",file_type::BINARY);
#ifndef SE_CLASS3
bool test = true;
// Check that match
test = compare("vtk_points_bin.vtp","test_data/vtk_points_bin_test.vtp");
test = compare("vtk_points_bin.vtk","test_data/vtk_points_bin_test.vtk");
BOOST_REQUIRE_EQUAL(test,true);
test = compare("vtk_points_bin2.vtp","test_data/vtk_points_bin_test.vtp");
test = compare("vtk_points_bin2.vtk","test_data/vtk_points_bin_test.vtk");
BOOST_REQUIRE_EQUAL(test,true);
#endif
......@@ -1257,12 +1257,12 @@ BOOST_AUTO_TEST_CASE( vtk_writer_use_point_set_binary )
VTKWriter<boost::mpl::pair<openfpm::vector<Point<3,double>>,openfpm::vector<aggregate<float,Point<3,float>>>>,VECTOR_POINTS> vtk_v2;
vtk_v2.add(v1ps,v4pp,75);
vtk_v2.write("vtk_points_pp_bin.vtp",prp_names,"vtk output","",file_type::BINARY);
vtk_v2.write("vtk_points_pp_bin.vtk",prp_names,"vtk output","",file_type::BINARY);
#ifndef SE_CLASS3
// Check that match
test = compare("vtk_points_pp_bin.vtp","test_data/vtk_points_pp_bin_test.vtp");
test = compare("vtk_points_pp_bin.vtk","test_data/vtk_points_pp_bin_test.vtk");
BOOST_REQUIRE_EQUAL(test,true);
#endif
......@@ -1353,14 +1353,14 @@ BOOST_AUTO_TEST_CASE( vtk_writer_use_point_set_binary )
openfpm::vector<std::string> stub;
vtk_v.write("vtk_points_2d_bin.vtp",stub,"vtk output","",file_type::BINARY);
vtk_v.write("vtk_points_2d_bin.vtk",stub,"vtk output","",file_type::BINARY);
#ifndef SE_CLASS3
bool test = true;
// Check that match
test = compare("vtk_points_2d_bin.vtp","test_data/vtk_points_2d_bin_test.vtp");
test = compare("vtk_points_2d_bin.vtk","test_data/vtk_points_2d_bin_test.vtk");
BOOST_REQUIRE_EQUAL(test,true);
#endif
......@@ -1369,12 +1369,12 @@ BOOST_AUTO_TEST_CASE( vtk_writer_use_point_set_binary )
VTKWriter<boost::mpl::pair<openfpm::vector<Point<2,double>>,openfpm::vector<aggregate<float[3],double[2]>>>,VECTOR_POINTS> vtk_v2;
vtk_v2.add(v1ps,v4pp,75);
vtk_v2.write("vtk_points_2d_pp_bin.vtp",stub,"vtk output","",file_type::BINARY);
vtk_v2.write("vtk_points_2d_pp_bin.vtk",stub,"vtk output","",file_type::BINARY);
#ifndef SE_CLASS3
// Check that match
test = compare("vtk_points_2d_pp_bin.vtp","test_data/vtk_points_2d_pp_bin_test.vtp");
test = compare("vtk_points_2d_pp_bin.vtk","test_data/vtk_points_2d_pp_bin_test.vtk");
BOOST_REQUIRE_EQUAL(test,true);
#endif
......
This diff is collapsed.
This diff is collapsed.
......@@ -6,105 +6,105 @@ FIELD FieldData 1
TIME 1 1 double
5.123000
POINTS 100 double
0.191120 0.542772 0.939108
0.19112 0.542772 0.939108
0.933523 0.710147 0.682257
0.228446 0.513097 0.438905
0.700754 0.436179 0.434735
0.751419 0.522504 0.196855
0.666369 0.261523 0.050127
0.573708 0.768383 0.022587
0.666369 0.261523 0.0501269
0.573708 0.768383 0.0225871
0.750211 0.313137 0.190846
0.507718 0.273360 0.264172
0.507718 0.27336 0.264172
0.670213 0.932599 0.212948
0.586036 0.006718 0.574775
0.586036 0.00671809 0.574775
0.336361 0.205412 0.440432
0.553825 0.740555 0.064820
0.764503 0.468990 0.878126
0.323438 0.181610 0.943831
0.329992 0.043079 0.688576
0.095793 0.009830 0.801123
0.349360 0.212307 0.266992
0.553825 0.740555 0.0648196
0.764503 0.46899 0.878126
0.323438 0.18161 0.943831
0.329992 0.0430792 0.688576
0.0957928 0.00982963 0.801123
0.34936 0.212307 0.266992
0.368002 0.414173 0.890974
0.471037 0.198481 0.584590
0.363141 0.971788 0.567570
0.193627 0.047362 0.347666
0.078823 0.824102 0.303324
0.892978 0.147594 0.589520
0.768770 0.021556 0.879563
0.471037 0.198481 0.58459
0.363141 0.971788 0.56757
0.193627 0.0473623 0.347666
0.0788226 0.824102 0.303324
0.892978 0.147594 0.58952
0.76877 0.0215564 0.879563
0.173734 0.131239 0.179741
0.392798 0.563805 0.325374
0.241990 0.120892 0.993650
0.24199 0.120892 0.99365
0.950192 0.297734 0.372967
0.618250 0.020735 0.852418
0.61825 0.0207346 0.852418
0.507541 0.634685 0.435244
0.857826 0.812930 0.263612
0.857826 0.81293 0.263612
0.905927 0.426169 0.242918
0.551551 0.826687 0.394286
0.107476 0.018033 0.122876
0.027658 0.315680 0.861391
0.864926 0.042390 0.667640
0.027658 0.31568 0.861391
0.864926 0.0423901 0.66764
0.937087 0.686836 0.209923
0.960032 0.214003 0.456393
0.838234 0.705078 0.379994
0.743514 0.670946 0.671558
0.434425 0.879627 0.032296
0.954834 0.877288 0.061284
0.434425 0.879627 0.0322956
0.954834 0.877288 0.0612842
0.239914 0.979709 0.690876
0.334337 0.292961 0.194138
0.397971 0.064623 0.159310
0.397971 0.0646235 0.15931
0.639743 0.559217 0.628284
0.319393 0.698422 0.808751
0.534981 0.605794 0.215716
0.932453 0.633508 0.954549
0.860046 0.170877 0.901505
0.581338 0.696935 0.013719
0.273513 0.037100 0.801600
0.273513 0.0371003 0.8016
0.857205 0.467507 0.627542
0.752721 0.974119 0.427029
0.371101 0.245019 0.119228
0.733240 0.911167 0.240259
0.73324 0.911167 0.240259
0.659184 0.906727 0.920069
0.723200 0.826380 0.620956
0.665010 0.286470 0.644219
0.7232 0.82638 0.620956
0.66501 0.28647 0.644219
0.550957 0.831365 0.249487
0.136109 0.843937 0.995786
0.958540 0.434625 0.812213
0.025767 0.297417 0.212592
0.956965 0.060432 0.382506
0.647490 0.425935 0.083679
0.492244 0.694858 0.917290
0.95854 0.434625 0.812213
0.0257674 0.297417 0.212592
0.956965 0.0604322 0.382506
0.64749 0.425935 0.0836791
0.492244 0.694858 0.91729
0.595547 0.101746 0.165874
0.715210 0.552892 0.556047
0.71521 0.552892 0.556047
0.727179 0.190203 0.479701
0.452899 0.191989 0.800239
0.189775 0.575804 0.255534
0.787141 0.426864 0.467209
0.674216 0.630124 0.240190
0.674216 0.630124 0.24019
0.921028 0.344758 0.550895
0.051571 0.205424 0.679874
0.0515714 0.205424 0.679874
0.450943 0.397533 0.256193
0.520349 0.229449 0.854270
0.444768 0.451041 0.509270
0.033064 0.374076 0.800554
0.524198 0.393980 0.552048
0.520349 0.229449 0.85427
0.444768 0.451041 0.50927
0.0330642 0.374076 0.800554
0.524198 0.39398 0.552048
0.743037 0.632495 0.584216
0.264430 0.570424 0.532054
0.538226 0.023322 0.450331
0.26443 0.570424 0.532054
0.538226 0.0233219 0.450331
0.513191 0.768138 0.952403
0.790408 0.301653 0.043437
0.328417 0.622360 0.766373
0.790408 0.301653 0.0434372
0.328417 0.62236 0.766373
0.186272 0.564519 0.339561
0.251027 0.787802 0.694365
0.045131 0.074015 0.734981
0.066324 0.363983 0.337433
0.0451314 0.0740147 0.734981
0.0663241 0.363983 0.337433
0.129496 0.763412 0.395678
0.451936 0.568539 0.719855
0.084249 0.651408 0.904191
0.0842492 0.651408 0.904191
0.484451 0.939076 0.217938
0.355350 0.994250 0.900963
0.195476 0.033896 0.116821
0.772962 0.692030 0.614234
0.727780 0.125820 0.608612
0.35535 0.99425 0.900963
0.195476 0.0338962 0.116821
0.772962 0.69203 0.614234
0.72778 0.12582 0.608612
0.602774 0.518449 0.155444
VERTICES 100 200
1 0
......@@ -210,207 +210,207 @@ VERTICES 100 200
POINT_DATA 100
SCALARS attr0 float
LOOKUP_TABLE default
0.949426
0.277201
0.376442
0.502502
0.661436
0.805367
0.342563
0.811196
0.865707
0.528286
0.214237
0.222135
0.680595
0.9494255
0.2772013
0.3764421
0.5025018
0.6614359
0.8053668
0.3425626
0.8111961
0.8657068
0.5282862
0.2142366
0.2221354
0.6805948
0.877432
0.498441
0.960167
0.530659
0.365743
0.515093
0.804031
0.680893
0.127910
0.717390
0.977225
0.272178
0.926172
0.4984407
0.9601666
0.5306594
0.3657426
0.5150926
0.8040309
0.6808926
0.1279096
0.7173896
0.9772254
0.2721777
0.9261724
0.580568
0.321983
0.497249
0.938873
0.833009
0.779967
0.3219828
0.4972493
0.9388732
0.8330092
0.7799672
0.725488
0.199308
0.090781
0.817653
0.191807
0.906924
0.864567
0.695952
0.682480
0.979791
0.491532
0.09078119
0.8176525
0.1918074
0.9069242
0.8645669
0.6959521
0.68248
0.9797909
0.4915317
0.533063
0.083141
0.247945
0.335915
0.026614
0.983773
0.08314063
0.2479446
0.3359151
0.02661425
0.9837726
0.523158
0.739292
0.914939
0.454955
0.820094
0.286058
0.676279
0.070532
0.776539
0.591060
0.998482
0.735711
0.560975
0.015887
0.7392922
0.9149389
0.4549547
0.8200942
0.2860577
0.6762785
0.07053214
0.7765388
0.5910597
0.9984819
0.7357114
0.5609745
0.01588653
0.152219
0.998366
0.840241
0.050251
0.069199
0.564634
0.496885
0.432840
0.867086
0.502347
0.079045
0.9983656
0.8402412
0.05025113
0.0691992
0.5646343
0.4968847
0.4328401
0.8670856
0.5023472
0.07904536
0.546933
0.338569
0.220038
0.319801
0.672418
0.3385688
0.2200379
0.3198014
0.6724178
0.929235
0.530605
0.678448
0.264949
0.141648
0.999292
0.607647
0.5306052
0.6784477
0.2649488
0.1416481
0.9992921
0.6076466
0.625696
0.259787
0.659342
0.527433
0.300028
0.472939
0.718906
0.312510
0.047817
0.2597865
0.6593418
0.5274326
0.3000281
0.4729392
0.7189057
0.3125102
0.04781655
0.659605
0.295081
0.876629
0.954925
0.118496
0.2950812
0.8766288
0.9549252
0.1184959
VECTORS attr1 float
0.657156 0.682034 0.025183
0.250088 0.607234 0.263825
0.739673 0.039018 0.114608
0.194670 0.401742 0.475700
0.413817 0.294766 0.681465
0.015654 0.653189 0.103735
0.009091 0.688525 0.315795
0.667080 0.032995 0.262446
0.434889 0.179694 0.042175
0.758505 0.171335 0.646745
0.964508 0.447138 0.034446
0.747196 0.863964 0.978880
0.625662 0.475677 0.615332
0.092992 0.950583 0.672225
0.026450 0.304725 0.674599
0.668662 0.198033 0.349307
0.511365 0.736590 0.331228
0.214901 0.920647 0.302787
0.624194 0.193248 0.903050
0.732847 0.734187 0.774465
0.122126 0.636064 0.978777
0.633133 0.172681 0.296620
0.137659 0.404177 0.315169
0.421794 0.706947 0.824835
0.777115 0.369309 0.959553
0.182539 0.907493 0.264560
0.612276 0.923360 0.322679
0.239125 0.906687 0.812745
0.799694 0.244892 0.122680
0.694895 0.871504 0.184096
0.632809 0.933001 0.947730
0.478003 0.610656 0.558196
0.530773 0.175834 0.618853
0.141485 0.444245 0.747305
0.002605 0.422395 0.095072
0.873376 0.003198 0.554611
0.039373 0.473211 0.087016
0.986558 0.508914 0.051935
0.569195 0.091257 0.297895
0.504004 0.034606 0.582476
0.883971 0.690371 0.125719
0.709503 0.007746 0.349253
0.354675 0.285570 0.821368
0.649714 0.380471 0.658330
0.240403 0.304495 0.841470
0.060240 0.425689 0.573951
0.082922 0.593872 0.293519
0.664300 0.935124 0.505412
0.593555 0.934290 0.449730
0.233373 0.680789 0.471149
0.123419 0.541032 0.943018
0.840163 0.005624 0.588636
0.054774 0.643167 0.612905
0.825145 0.677922 0.317877
0.082006 0.561248 0.378754
0.052267 0.955961 0.847171
0.732659 0.672963 0.470395
0.108920 0.168110 0.834694
0.754526 0.407000 0.304273
0.158420 0.244210 0.368963
0.787678 0.950612 0.241943
0.298357 0.024632 0.268835
0.878477 0.185988 0.213471
0.066472 0.649750 0.886616
0.737895 0.382408 0.894947
0.011884 0.751527 0.573463
0.952056 0.403111 0.874667
0.131470 0.252003 0.567192
0.544668 0.750556 0.258386
0.119451 0.395768 0.793354
0.797257 0.862283 0.085578
0.899564 0.510865 0.487300
0.474531 0.325321 0.350061
0.878789 0.043523 0.356339
0.642490 0.645894 0.389727
0.904003 0.108312 0.849800
0.174632 0.494240 0.010674
0.896802 0.164147 0.994820
0.275338 0.486372 0.320905
0.717285 0.101265 0.393299
0.499842 0.160009 0.718023
0.802297 0.769054 0.496464
0.075878 0.302394 0.821459
0.251684 0.943570 0.225473
0.478271 0.031636 0.955801
0.763669 0.821611 0.789073
0.882342 0.728198 0.556009
0.762217 0.059642 0.539531
0.236410 0.845215 0.047267
0.921424 0.922028 0.936481
0.544335 0.221366 0.746972
0.435478 0.182577 0.211759
0.970230 0.869358 0.825359
0.911490 0.459484 0.970361