Merge topic 'vtk-test-files-in-repo'
a8fa14335 Move UnitTestVTKDataSetReader files to git-lfs 571aa9f3d Simplify getting test file names Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Sujin Philip <sujin.philip@kitware.com> Merge-request: !2234
This commit is contained in:
commit
cdc41cc987
3
data/data/curvilinear/simple_structured_ascii.vtk
Normal file
3
data/data/curvilinear/simple_structured_ascii.vtk
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5f85560cc05688d09c21b22e91c14cec22deecb3c51dc364d82cc9fd460c6ab6
|
||||
size 328
|
3
data/data/curvilinear/simple_structured_bin.vtk
Normal file
3
data/data/curvilinear/simple_structured_bin.vtk
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a47045b1ae5539ef0125273ee9c50a9a6e809f78411f6a850ac34e6fa43189bb
|
||||
size 535
|
3
data/data/rectilinear/simple_rectilinear1_ascii.vtk
Normal file
3
data/data/rectilinear/simple_rectilinear1_ascii.vtk
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:752021630d25aff8dfd00064badd452896be70bc8b2f94b008900b4fc70d4dd5
|
||||
size 1811
|
3
data/data/rectilinear/simple_rectilinear2_ascii.vtk
Normal file
3
data/data/rectilinear/simple_rectilinear2_ascii.vtk
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4d1dbb4c28f1c829769ad3e03fc58f667935d8a461d3515036d5d98f5e3841cb
|
||||
size 395
|
3
data/data/uniform/simple_structured_points_ascii.vtk
Normal file
3
data/data/uniform/simple_structured_points_ascii.vtk
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:c1860e747d7f460afc63e32de184e445ffb966a42fb07f9d44ba39020584864f
|
||||
size 496
|
3
data/data/uniform/simple_structured_points_bin.vtk
Normal file
3
data/data/uniform/simple_structured_points_bin.vtk
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:3d9bea2064cd3402f3f5b7862e6b775e37f33210ba099f59358857d4bdae1020
|
||||
size 255
|
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e154ba13346e6998b864316868da3f155e99efe4f330c8e080b0d7ece22b505a
|
||||
size 488
|
3
data/data/unstructured/simple_poly_ascii.vtk
Normal file
3
data/data/unstructured/simple_poly_ascii.vtk
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:ff3108d009d2eef410593811857e38388001f7df624ddeaed3edceafbc838aea
|
||||
size 849
|
3
data/data/unstructured/simple_poly_bin.vtk
Normal file
3
data/data/unstructured/simple_poly_bin.vtk
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5aca6667b06deb4ec6236d5caa3d9518345bc1eb9021bc721289b81acc980af9
|
||||
size 789
|
3
data/data/unstructured/simple_unstructured_ascii.vtk
Normal file
3
data/data/unstructured/simple_unstructured_ascii.vtk
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:861fc904b7d4db43288fce85c8c1398726b54ac82d7bcbcebd8f12808cb5599b
|
||||
size 1002
|
3
data/data/unstructured/simple_unstructured_bin.vtk
Normal file
3
data/data/unstructured/simple_unstructured_bin.vtk
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:29e43c695763535251ab22af815651caa53d103b5fd168c72dfb9188e72e4ff4
|
||||
size 1244
|
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:3731448fe4d87b204e185829237a6a6b0140aed2fb27eea0533883a4cf4ed79d
|
||||
size 1065
|
@ -100,11 +100,21 @@ struct Testing
|
||||
public:
|
||||
static VTKM_CONT const std::string GetTestDataBasePath() { return SetAndGetTestDataBasePath(); }
|
||||
|
||||
static VTKM_CONT const std::string DataPath(const std::string& filename)
|
||||
{
|
||||
return GetTestDataBasePath() + filename;
|
||||
}
|
||||
|
||||
static VTKM_CONT const std::string GetRegressionTestImageBasePath()
|
||||
{
|
||||
return SetAndGetRegressionImageBasePath();
|
||||
}
|
||||
|
||||
static VTKM_CONT const std::string RegressionImagePath(const std::string& filename)
|
||||
{
|
||||
return GetRegressionTestImageBasePath() + filename;
|
||||
}
|
||||
|
||||
template <class Func>
|
||||
static VTKM_CONT int Run(Func function, int& argc, char* argv[])
|
||||
{
|
||||
@ -188,7 +198,13 @@ private:
|
||||
static std::string TestDataBasePath;
|
||||
|
||||
if (path != "")
|
||||
{
|
||||
TestDataBasePath = path;
|
||||
if ((TestDataBasePath.back() != '/') && (TestDataBasePath.back() != '\\'))
|
||||
{
|
||||
TestDataBasePath = TestDataBasePath + "/";
|
||||
}
|
||||
}
|
||||
|
||||
return TestDataBasePath;
|
||||
}
|
||||
@ -198,7 +214,14 @@ private:
|
||||
static std::string RegressionTestImageBasePath;
|
||||
|
||||
if (path != "")
|
||||
{
|
||||
RegressionTestImageBasePath = path;
|
||||
if ((RegressionTestImageBasePath.back() != '/') &&
|
||||
(RegressionTestImageBasePath.back() != '\\'))
|
||||
{
|
||||
RegressionTestImageBasePath = RegressionTestImageBasePath + '/';
|
||||
}
|
||||
}
|
||||
|
||||
return RegressionTestImageBasePath;
|
||||
}
|
||||
|
@ -140,8 +140,7 @@ public:
|
||||
|
||||
void TestContourWedges() const
|
||||
{
|
||||
auto pathname =
|
||||
vtkm::cont::testing::Testing::GetTestDataBasePath() + "/unstructured/wedge_cells.vtk";
|
||||
auto pathname = vtkm::cont::testing::Testing::DataPath("unstructured/wedge_cells.vtk");
|
||||
vtkm::io::VTKDataSetReader reader(pathname);
|
||||
|
||||
vtkm::cont::DataSet dataSet = reader.ReadDataSet();
|
||||
|
@ -179,8 +179,6 @@ void TestParticleAdvectionFilter()
|
||||
TestBasic();
|
||||
TestPartitionedDataSet();
|
||||
|
||||
std::string basePath = vtkm::cont::testing::Testing::GetTestDataBasePath();
|
||||
|
||||
//Fusion test.
|
||||
std::vector<vtkm::Vec3f> fusionPts, fusionEndPts;
|
||||
fusionPts.push_back(vtkm::Vec3f(0.8f, 0.6f, 0.6f));
|
||||
@ -191,7 +189,7 @@ void TestParticleAdvectionFilter()
|
||||
fusionEndPts.push_back(vtkm::Vec3f(0.5601879954f, 0.91389900446f, 0.43989110522f));
|
||||
fusionEndPts.push_back(vtkm::Vec3f(0.7004770041f, 0.63193398714f, 0.64524400234f));
|
||||
vtkm::FloatDefault fusionStep = 0.005f;
|
||||
std::string fusionFile = basePath + "/rectilinear/fusion.vtk";
|
||||
std::string fusionFile = vtkm::cont::testing::Testing::DataPath("rectilinear/fusion.vtk");
|
||||
|
||||
TestFile(fusionFile, fusionPts, fusionStep, 1000, fusionEndPts);
|
||||
|
||||
@ -205,7 +203,7 @@ void TestParticleAdvectionFilter()
|
||||
fishEndPts.push_back(vtkm::Vec3f(0.7257543206f, 0.1277695596f, 0.7468645573f));
|
||||
fishEndPts.push_back(vtkm::Vec3f(0.8347796798f, 0.1276152730f, 0.4985143244f));
|
||||
vtkm::FloatDefault fishStep = 0.001f;
|
||||
std::string fishFile = basePath + "/rectilinear/fishtank.vtk";
|
||||
std::string fishFile = vtkm::cont::testing::Testing::DataPath("rectilinear/fishtank.vtk");
|
||||
|
||||
TestFile(fishFile, fishPts, fishStep, 100, fishEndPts);
|
||||
}
|
||||
|
@ -160,8 +160,6 @@ void TestStreamlineFilters()
|
||||
TestStreamline();
|
||||
TestPathline();
|
||||
|
||||
std::string basePath = vtkm::cont::testing::Testing::GetTestDataBasePath();
|
||||
|
||||
//Fusion test.
|
||||
std::vector<vtkm::Vec3f> fusionPts, fusionEndPts;
|
||||
fusionPts.push_back(vtkm::Vec3f(0.8f, 0.6f, 0.6f));
|
||||
@ -172,7 +170,7 @@ void TestStreamlineFilters()
|
||||
fusionEndPts.push_back(vtkm::Vec3f(0.5601879954f, 0.91389900446f, 0.43989110522f));
|
||||
fusionEndPts.push_back(vtkm::Vec3f(0.7004770041f, 0.63193398714f, 0.64524400234f));
|
||||
vtkm::FloatDefault fusionStep = 0.005f;
|
||||
std::string fusionFile = basePath + "/rectilinear/fusion.vtk";
|
||||
std::string fusionFile = vtkm::cont::testing::Testing::DataPath("rectilinear/fusion.vtk");
|
||||
TestStreamlineFile(fusionFile, fusionPts, fusionStep, 1000, fusionEndPts);
|
||||
|
||||
//Fishtank test.
|
||||
@ -185,7 +183,7 @@ void TestStreamlineFilters()
|
||||
fishEndPts.push_back(vtkm::Vec3f(0.7257543206f, 0.1277695596f, 0.7468645573f));
|
||||
fishEndPts.push_back(vtkm::Vec3f(0.8347796798f, 0.1276152730f, 0.4985143244f));
|
||||
vtkm::FloatDefault fishStep = 0.001f;
|
||||
std::string fishFile = basePath + "/rectilinear/fishtank.vtk";
|
||||
std::string fishFile = vtkm::cont::testing::Testing::DataPath("rectilinear/fishtank.vtk");
|
||||
TestStreamlineFile(fishFile, fishPts, fishStep, 100, fishEndPts);
|
||||
}
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ inline vtkm::cont::DataSet readBOVDataSet(const char* fname)
|
||||
|
||||
void TestReadingBOVDataSet()
|
||||
{
|
||||
std::string bovFile = vtkm::cont::testing::Testing::GetTestDataBasePath() + "/uniform/noise.bov";
|
||||
std::string bovFile = vtkm::cont::testing::Testing::DataPath("uniform/noise.bov");
|
||||
|
||||
auto const& ds = readBOVDataSet(bovFile.data());
|
||||
|
||||
|
@ -16,389 +16,7 @@
|
||||
namespace
|
||||
{
|
||||
|
||||
const char polydataAscii[] =
|
||||
"# vtk DataFile Version 3.0\n"
|
||||
"Cube example\n"
|
||||
"ASCII\n"
|
||||
"DATASET POLYDATA\n"
|
||||
"POINTS 8 float\n"
|
||||
"0.0 0.0 0.0 1.0 0.0 0.0 1.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0\n"
|
||||
"1.0 0.0 1.0 1.0 1.0 1.0 0.0 1.0 1.0\n"
|
||||
"POLYGONS 6 30\n"
|
||||
"4 0 1 2 3 4 4 5 6 7 4 0 1 5 4 4 2 3 7 6 4 0 4 7 3 4 1 2 6 5\n"
|
||||
"CELL_DATA 6\n"
|
||||
"SCALARS cell_scalars int 1\n"
|
||||
"LOOKUP_TABLE default\n"
|
||||
"0 1 2 3 4 5\n"
|
||||
"NORMALS cell_normals float\n"
|
||||
"0 0 -1 0 0 1 0 -1 0 0 1 0 -1 0 0 1 0 0\n"
|
||||
"FIELD FieldData 2\n"
|
||||
"cellIds 1 6 int\n"
|
||||
"0 1 2 3 4 5\n"
|
||||
"faceAttributes 2 6 float\n"
|
||||
"0.0 1.0 1.0 2.0 2.0 3.0 3.0 4.0 4.0 5.0 5.0 6.0\n"
|
||||
"POINT_DATA 8\n"
|
||||
"SCALARS sample_scalars float 1\n"
|
||||
"LOOKUP_TABLE my_table\n"
|
||||
"0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0\n"
|
||||
"LOOKUP_TABLE my_table 8\n"
|
||||
"0.0 0.0 0.0 1.0 1.0 0.0 0.0 1.0 0.0 1.0 0.0 1.0 1.0 1.0 0.0 1.0\n"
|
||||
"0.0 0.0 1.0 1.0 1.0 0.0 1.0 1.0 0.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0\n";
|
||||
|
||||
const char polydataBin[] =
|
||||
"# vtk DataFile Version 4.0\n"
|
||||
"Cube example\n"
|
||||
"BINARY\n"
|
||||
"DATASET POLYDATA\n"
|
||||
"POINTS 8 float\n"
|
||||
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3f\x80\x00\x00\x00\x00\x00\x00"
|
||||
"\x00\x00\x00\x00\x3f\x80\x00\x00\x3f\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
|
||||
"\x3f\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3f\x80\x00\x00"
|
||||
"\x3f\x80\x00\x00\x00\x00\x00\x00\x3f\x80\x00\x00\x3f\x80\x00\x00\x3f\x80\x00\x00"
|
||||
"\x3f\x80\x00\x00\x00\x00\x00\x00\x3f\x80\x00\x00\x3f\x80\x00\x00\n"
|
||||
"POLYGONS 6 30\n"
|
||||
"\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x03"
|
||||
"\x00\x00\x00\x04\x00\x00\x00\x04\x00\x00\x00\x05\x00\x00\x00\x06\x00\x00\x00\x07"
|
||||
"\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x05\x00\x00\x00\x04"
|
||||
"\x00\x00\x00\x04\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x07\x00\x00\x00\x06"
|
||||
"\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x07\x00\x00\x00\x03"
|
||||
"\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x06\x00\x00\x00\x05"
|
||||
"\n"
|
||||
"CELL_DATA 6\n"
|
||||
"SCALARS cell_scalars int\n"
|
||||
"LOOKUP_TABLE default\n"
|
||||
"\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x04"
|
||||
"\x00\x00\x00\x05\n"
|
||||
"NORMALS cell_normals float\n"
|
||||
"\x00\x00\x00\x00\x00\x00\x00\x00\xbf\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
|
||||
"\x3f\x80\x00\x00\x00\x00\x00\x00\xbf\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
|
||||
"\x3f\x80\x00\x00\x00\x00\x00\x00\xbf\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
|
||||
"\x3f\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\n"
|
||||
"FIELD FieldData 2\n"
|
||||
"cellIds 1 6 int\n"
|
||||
"\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x04"
|
||||
"\x00\x00\x00\x05\n"
|
||||
"faceAttributes 2 6 float\n"
|
||||
"\x00\x00\x00\x00\x3f\x80\x00\x00\x3f\x80\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00"
|
||||
"\x40\x40\x00\x00\x40\x40\x00\x00\x40\x80\x00\x00\x40\x80\x00\x00\x40\xa0\x00\x00"
|
||||
"\x40\xa0\x00\x00\x40\xc0\x00\x00\n"
|
||||
"POINT_DATA 8\n"
|
||||
"SCALARS sample_scalars float\n"
|
||||
"LOOKUP_TABLE lookup_table\n"
|
||||
"\x00\x00\x00\x00\x3f\x80\x00\x00\x40\x00\x00\x00\x40\x40\x00\x00\x40\x80\x00\x00"
|
||||
"\x40\xa0\x00\x00\x40\xc0\x00\x00\x40\xe0\x00\x00\n"
|
||||
"LOOKUP_TABLE lookup_table 8\n"
|
||||
"\x00\x00\x00\xff\xff\x00\x00\xff\x00\xff\x00\xff\xff\xff\x00\xff\x00\x00\xff\xff"
|
||||
"\xff\x00\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\n";
|
||||
|
||||
const char structuredPointsAscii[] = "# vtk DataFile Version 3.0\n"
|
||||
"Volume example\n"
|
||||
"ASCII\n"
|
||||
"DATASET STRUCTURED_POINTS\n"
|
||||
"DIMENSIONS 3 4 6\n"
|
||||
"SPACING 1 1 1\n"
|
||||
"ORIGIN 0 0 0\n"
|
||||
"POINT_DATA 72\n"
|
||||
"SCALARS volume_scalars char 1\n"
|
||||
"LOOKUP_TABLE default\n"
|
||||
" 0 0 0 0 0 0 0 0 0 0 0 0\n"
|
||||
" 0 5 10 15 20 25 25 20 15 10 5 0\n"
|
||||
" 0 10 20 30 40 50 50 40 30 20 10 0\n"
|
||||
" 0 10 20 30 40 50 50 40 30 20 10 0\n"
|
||||
" 0 5 10 15 20 25 25 20 15 10 5 0\n"
|
||||
" 0 0 0 0 0 0 0 0 0 0 0 0\n"
|
||||
"\n"
|
||||
"METADATA\n"
|
||||
"INFORMATION 0\n"
|
||||
"\n";
|
||||
|
||||
const char structuredPointsVisItAscii[] = "# vtk DataFile Version 3.0\n"
|
||||
"Volume example\n"
|
||||
"ASCII\n"
|
||||
"DATASET STRUCTURED_POINTS\n"
|
||||
"FIELD FieldData 3\n"
|
||||
"Nek_SpectralElementData 1 4 int\n"
|
||||
"8 8 8 68826 \n"
|
||||
"avtOriginalBounds 1 6 double\n"
|
||||
"-2 2 -2 2 -2 2 \n"
|
||||
"FakeData 2 4 int\n"
|
||||
"81 80 89 68826 \n"
|
||||
"-81 80 65 6226 \n"
|
||||
"SPACING 1 1 1\n"
|
||||
"ORIGIN 0 0 0\n"
|
||||
"CELL_DATA 27\n"
|
||||
"VECTORS grad float\n"
|
||||
"-1 -1 0 0 0 -1 0 0 -1 \n"
|
||||
"1 1 0 0 0 -1 0 0 -1 \n"
|
||||
"0 0 -1 0 0 -1 0 0 -1 \n"
|
||||
"0 0 -1 0 0 -1 0 0 -1 \n"
|
||||
"0 0 -1 0 0 -1 0 0 -1 \n"
|
||||
"0 0 -1 0 0 -1 0 0 -1 \n"
|
||||
"0 0 -1 0 0 -1 0 0 -1 \n"
|
||||
"0 0 -1 0 0 -1 0 0 -1 \n"
|
||||
"0 0 -1 0 0 -1 0 0 -1 \n";
|
||||
|
||||
const char structuredPointsBin[] =
|
||||
"# vtk DataFile Version 4.0\n"
|
||||
"Volume example\n"
|
||||
"BINARY\n"
|
||||
"DATASET STRUCTURED_POINTS\n"
|
||||
"DIMENSIONS 3 4 6\n"
|
||||
"SPACING 1 1 1\n"
|
||||
"ORIGIN 0 0 0\n"
|
||||
"POINT_DATA 72\n"
|
||||
"SCALARS volume_scalars char\n"
|
||||
"LOOKUP_TABLE default\n"
|
||||
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05\x0a\x0f\x14\x19\x19\x14"
|
||||
"\x0f\x0a\x05\x00\x00\x0a\x14\x1e\x28\x32\x32\x28\x1e\x14\x0a\x00\x00\x0a\x14\x1e"
|
||||
"\x28\x32\x32\x28\x1e\x14\x0a\x00\x00\x05\x0a\x0f\x14\x19\x19\x14\x0f\x0a\x05\x00"
|
||||
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\n";
|
||||
|
||||
const char unsturctureGridAscii[] =
|
||||
"# vtk DataFile Version 3.0\n"
|
||||
"Unstructured Grid Example\n"
|
||||
"ASCII\n"
|
||||
"DATASET UNSTRUCTURED_GRID\n"
|
||||
"POINTS 26 float\n"
|
||||
"0 0 0 1 0 0 2 0 0 0 1 0 1 1 0 2 1 0 0 0 1 1 0 1 2 0 1\n"
|
||||
"0 1 1 1 1 1 2 1 1 0.5 1.7 0.5 1.5 1.7 0.5 0 1 2 1 1 2 2 1 2\n"
|
||||
"0 1 3 1 1 3 2 1 3 0 1 4 1 1 4 2 1 4 0 1 5 1 1 5 2 1 5\n"
|
||||
"CELLS 12 64\n"
|
||||
"8 0 1 4 3 6 7 10 9 6 1 7 2 4 10 5 6 2 7 8 5 10 11 5 4 3 9 10 12\n"
|
||||
"4 5 4 10 13 4 5 10 11 13 6 17 14 18 15 19 16 4 21 22 19 18\n"
|
||||
"3 20 21 17 3 21 18 17 2 25 24 1 23\n"
|
||||
"CELL_TYPES 12\n"
|
||||
"12 13 13 14 10 10 6 9 5 5 3 1\n"
|
||||
"POINT_DATA 26\n"
|
||||
"SCALARS scalars float 1\n"
|
||||
"LOOKUP_TABLE default\n"
|
||||
"0 1 2 3 4 5 6 7 8 9 10 11 12\n"
|
||||
"13 14 15 16 17 18 19 20 21 22 23 24 25\n"
|
||||
"VECTORS vectors float\n"
|
||||
"1 0 0 1 1 0 0 2 0 1 0 0 1 1 0 0 2 0 1 0 0 1 1 0 0 2 0\n"
|
||||
"1 0 0 1 1 0 0 2 0 0 1 0 0 1 0 0 0 1 0 0 1 0 0 1\n"
|
||||
"0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1\n";
|
||||
|
||||
const char unsturctureGridVisItAscii[] =
|
||||
"# vtk DataFile Version 3.0\n"
|
||||
"Unstructured Grid Example\n"
|
||||
"ASCII\n"
|
||||
"DATASET UNSTRUCTURED_GRID\n"
|
||||
"FIELD FieldData 1\n"
|
||||
"Nek_SpectralElementData 1 4 int\n"
|
||||
"8 8 8 68826 \n"
|
||||
"POINTS 26 float\n"
|
||||
"0 0 0 1 0 0 2 0 0 0 1 0 1 1 0 2 1 0 0 0 1 1 0 1 2 0 1\n"
|
||||
"0 1 1 1 1 1 2 1 1 0.5 1.7 0.5 1.5 1.7 0.5 0 1 2 1 1 2 2 1 2\n"
|
||||
"0 1 3 1 1 3 2 1 3 0 1 4 1 1 4 2 1 4 0 1 5 1 1 5 2 1 5\n"
|
||||
"CELLS 12 64\n"
|
||||
"8 0 1 4 3 6 7 10 9 6 1 7 2 4 10 5 6 2 7 8 5 10 11 5 4 3 9 10 12\n"
|
||||
"4 5 4 10 13 4 5 10 11 13 6 17 14 18 15 19 16 4 21 22 19 18\n"
|
||||
"3 20 21 17 3 21 18 17 2 25 24 1 23\n"
|
||||
"CELL_TYPES 12\n"
|
||||
"12 13 13 14 10 10 6 9 5 5 3 1\n"
|
||||
"POINT_DATA 26\n"
|
||||
"SCALARS scalars float 1\n"
|
||||
"LOOKUP_TABLE default\n"
|
||||
"0 1 2 3 4 5 6 7 8 9 10 11 12\n"
|
||||
"13 14 15 16 17 18 19 20 21 22 23 24 25\n"
|
||||
"VECTORS vectors float\n"
|
||||
"1 0 0 1 1 0 0 2 0 1 0 0 1 1 0 0 2 0 1 0 0 1 1 0 0 2 0\n"
|
||||
"1 0 0 1 1 0 0 2 0 0 1 0 0 1 0 0 0 1 0 0 1 4 5 6\n"
|
||||
"9 0 1 8 0 1 7 0 1 6 0 1 5 0 1 4 0 1 3 0 1 2 0 1 1 0 1\n";
|
||||
|
||||
const char unsturctureGridBin[] =
|
||||
"# vtk DataFile Version 4.0\n"
|
||||
"Unstructured Grid Example\n"
|
||||
"BINARY\n"
|
||||
"DATASET UNSTRUCTURED_GRID\n"
|
||||
"POINTS 26 float\n"
|
||||
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3f\x80\x00\x00\x00\x00\x00\x00"
|
||||
"\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
|
||||
"\x3f\x80\x00\x00\x00\x00\x00\x00\x3f\x80\x00\x00\x3f\x80\x00\x00\x00\x00\x00\x00"
|
||||
"\x40\x00\x00\x00\x3f\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
|
||||
"\x3f\x80\x00\x00\x3f\x80\x00\x00\x00\x00\x00\x00\x3f\x80\x00\x00\x40\x00\x00\x00"
|
||||
"\x00\x00\x00\x00\x3f\x80\x00\x00\x00\x00\x00\x00\x3f\x80\x00\x00\x3f\x80\x00\x00"
|
||||
"\x3f\x80\x00\x00\x3f\x80\x00\x00\x3f\x80\x00\x00\x40\x00\x00\x00\x3f\x80\x00\x00"
|
||||
"\x3f\x80\x00\x00\x3f\x00\x00\x00\x3f\xd9\x99\x9a\x3f\x00\x00\x00\x3f\xc0\x00\x00"
|
||||
"\x3f\xd9\x99\x9a\x3f\x00\x00\x00\x00\x00\x00\x00\x3f\x80\x00\x00\x40\x00\x00\x00"
|
||||
"\x3f\x80\x00\x00\x3f\x80\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x3f\x80\x00\x00"
|
||||
"\x40\x00\x00\x00\x00\x00\x00\x00\x3f\x80\x00\x00\x40\x40\x00\x00\x3f\x80\x00\x00"
|
||||
"\x3f\x80\x00\x00\x40\x40\x00\x00\x40\x00\x00\x00\x3f\x80\x00\x00\x40\x40\x00\x00"
|
||||
"\x00\x00\x00\x00\x3f\x80\x00\x00\x40\x80\x00\x00\x3f\x80\x00\x00\x3f\x80\x00\x00"
|
||||
"\x40\x80\x00\x00\x40\x00\x00\x00\x3f\x80\x00\x00\x40\x80\x00\x00\x00\x00\x00\x00"
|
||||
"\x3f\x80\x00\x00\x40\xa0\x00\x00\x3f\x80\x00\x00\x3f\x80\x00\x00\x40\xa0\x00\x00"
|
||||
"\x40\x00\x00\x00\x3f\x80\x00\x00\x40\xa0\x00\x00\n"
|
||||
"CELLS 12 64\n"
|
||||
"\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x04\x00\x00\x00\x03"
|
||||
"\x00\x00\x00\x06\x00\x00\x00\x07\x00\x00\x00\x0a\x00\x00\x00\x09\x00\x00\x00\x06"
|
||||
"\x00\x00\x00\x01\x00\x00\x00\x07\x00\x00\x00\x02\x00\x00\x00\x04\x00\x00\x00\x0a"
|
||||
"\x00\x00\x00\x05\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x07\x00\x00\x00\x08"
|
||||
"\x00\x00\x00\x05\x00\x00\x00\x0a\x00\x00\x00\x0b\x00\x00\x00\x05\x00\x00\x00\x04"
|
||||
"\x00\x00\x00\x03\x00\x00\x00\x09\x00\x00\x00\x0a\x00\x00\x00\x0c\x00\x00\x00\x04"
|
||||
"\x00\x00\x00\x05\x00\x00\x00\x04\x00\x00\x00\x0a\x00\x00\x00\x0d\x00\x00\x00\x04"
|
||||
"\x00\x00\x00\x05\x00\x00\x00\x0a\x00\x00\x00\x0b\x00\x00\x00\x0d\x00\x00\x00\x06"
|
||||
"\x00\x00\x00\x11\x00\x00\x00\x0e\x00\x00\x00\x12\x00\x00\x00\x0f\x00\x00\x00\x13"
|
||||
"\x00\x00\x00\x10\x00\x00\x00\x04\x00\x00\x00\x15\x00\x00\x00\x16\x00\x00\x00\x13"
|
||||
"\x00\x00\x00\x12\x00\x00\x00\x03\x00\x00\x00\x14\x00\x00\x00\x15\x00\x00\x00\x11"
|
||||
"\x00\x00\x00\x03\x00\x00\x00\x15\x00\x00\x00\x12\x00\x00\x00\x11\x00\x00\x00\x02"
|
||||
"\x00\x00\x00\x19\x00\x00\x00\x18\x00\x00\x00\x01\x00\x00\x00\x17\n"
|
||||
"CELL_TYPES 12\n"
|
||||
"\x00\x00\x00\x0c\x00\x00\x00\x0d\x00\x00\x00\x0d\x00\x00\x00\x0e\x00\x00\x00\x0a"
|
||||
"\x00\x00\x00\x0a\x00\x00\x00\x06\x00\x00\x00\x09\x00\x00\x00\x05\x00\x00\x00\x05"
|
||||
"\x00\x00\x00\x03\x00\x00\x00\x01\n"
|
||||
"POINT_DATA 26\n"
|
||||
"SCALARS scalars float\n"
|
||||
"LOOKUP_TABLE default\n"
|
||||
"\x00\x00\x00\x00\x3f\x80\x00\x00\x40\x00\x00\x00\x40\x40\x00\x00\x40\x80\x00\x00"
|
||||
"\x40\xa0\x00\x00\x40\xc0\x00\x00\x40\xe0\x00\x00\x41\x00\x00\x00\x41\x10\x00\x00"
|
||||
"\x41\x20\x00\x00\x41\x30\x00\x00\x41\x40\x00\x00\x41\x50\x00\x00\x41\x60\x00\x00"
|
||||
"\x41\x70\x00\x00\x41\x80\x00\x00\x41\x88\x00\x00\x41\x90\x00\x00\x41\x98\x00\x00"
|
||||
"\x41\xa0\x00\x00\x41\xa8\x00\x00\x41\xb0\x00\x00\x41\xb8\x00\x00\x41\xc0\x00\x00"
|
||||
"\x41\xc8\x00\x00\n"
|
||||
"VECTORS vectors float\n"
|
||||
"\x3f\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3f\x80\x00\x00\x3f\x80\x00\x00"
|
||||
"\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x3f\x80\x00\x00"
|
||||
"\x00\x00\x00\x00\x00\x00\x00\x00\x3f\x80\x00\x00\x3f\x80\x00\x00\x00\x00\x00\x00"
|
||||
"\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x3f\x80\x00\x00\x00\x00\x00\x00"
|
||||
"\x00\x00\x00\x00\x3f\x80\x00\x00\x3f\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
|
||||
"\x40\x00\x00\x00\x00\x00\x00\x00\x3f\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
|
||||
"\x3f\x80\x00\x00\x3f\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00"
|
||||
"\x00\x00\x00\x00\x00\x00\x00\x00\x3f\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
|
||||
"\x3f\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3f\x80\x00\x00"
|
||||
"\x00\x00\x00\x00\x00\x00\x00\x00\x3f\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
|
||||
"\x3f\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3f\x80\x00\x00\x00\x00\x00\x00"
|
||||
"\x00\x00\x00\x00\x3f\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3f\x80\x00\x00"
|
||||
"\x00\x00\x00\x00\x00\x00\x00\x00\x3f\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
|
||||
"\x3f\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3f\x80\x00\x00\x00\x00\x00\x00"
|
||||
"\x00\x00\x00\x00\x3f\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3f\x80\x00\x00"
|
||||
"\x00\x00\x00\x00\x00\x00\x00\x00\x3f\x80\x00\x00\n";
|
||||
|
||||
const char rectilinearGrid1Ascii[] =
|
||||
"# vtk DataFile Version 3.0\n"
|
||||
"\n" // empty title
|
||||
"ASCII\n"
|
||||
"DATASET RECTILINEAR_GRID\n"
|
||||
"DIMENSIONS 5 5 5\n"
|
||||
"X_COORDINATES 5 float\n"
|
||||
"-10 -5 0 5 10 \n"
|
||||
"Y_COORDINATES 5 float\n"
|
||||
"-10 -5 0 5 10 \n"
|
||||
"Z_COORDINATES 5 float\n"
|
||||
"-10 -5 0 5 10 \n"
|
||||
"POINT_DATA 125\n"
|
||||
"SCALARS var float\n"
|
||||
"LOOKUP_TABLE default\n"
|
||||
"2.08534 2.23463 2.22555 2.18031 2.07345 2.60855 2.94387 2.77617 2.58245 \n"
|
||||
"2.40193 2.81444 4.07839 3.66217 2.93755 2.52435 2.47503 3.37804 2.94413 \n"
|
||||
"2.76693 2.51259 2.57481 3.09598 2.42487 2.33772 2.17323 2.44797 2.60943 \n"
|
||||
"2.25704 2.5559 2.47737 3.19836 3.39212 3.01456 3.56609 3.08355 3.14302 \n"
|
||||
"3.59813 3.56774 4.3679 3.30292 2.73969 2.31936 4.26606 4.35597 4.08261 \n"
|
||||
"2.505 2.85494 2.99157 2.99089 2.60786 3.0034 2.6469 2.30827 2.93406 \n"
|
||||
"2.65975 3.37307 2.8116 3.4624 3.76087 3.17927 3.04305 3.01835 3.37884 \n"
|
||||
"4.37283 3.78191 2.97252 2.58956 3.74759 4.44983 3.09236 2.54284 2.85325 \n"
|
||||
"3.18491 3.10996 2.4281 2.81014 2.93146 2.0504 2.35133 2.26906 3.002 \n"
|
||||
"3.09434 3.69065 3.45153 2.93912 2.59396 2.97304 3.48548 3.70642 3.23255\n"
|
||||
"2.84452 3.28152 3.35428 3.85919 3.73977 2.74961 2.85595 2.97197 2.81465 \n"
|
||||
"2.3682 2.44328 2.52139 2.06677 2.12045 1.98058 2.94229 2.80975 3.07295 \n"
|
||||
"2.70744 2.4395 2.56197 3.56108 3.32331 3.29935 2.85451 2.6538 2.99515 \n"
|
||||
"3.15239 2.93688 2.75899 2.60132 2.58644 2.70063 2.45959 2.20553 \n"
|
||||
"CELL_DATA 64\n"
|
||||
"SCALARS cell_var float\n"
|
||||
"LOOKUP_TABLE default\n"
|
||||
"2.08534 2.23463 2.22555 2.18031 2.07345 2.60855 2.94387 2.77617 2.58245 \n"
|
||||
"2.08534 2.23463 2.22555 2.18031 2.07345 2.60855 2.94387 2.77617 2.58245 \n"
|
||||
"2.08534 2.23463 2.22555 2.18031 2.07345 2.60855 2.94387 2.77617 2.58245 \n"
|
||||
"2.08534 2.23463 2.22555 2.18031 2.07345 2.60855 2.94387 2.77617 2.58245 \n"
|
||||
"2.08534 2.23463 2.22555 2.18031 2.07345 2.60855 2.94387 2.77617 2.58245 \n"
|
||||
"2.08534 2.23463 2.22555 2.18031 2.07345 2.60855 2.94387 2.77617 2.58245 \n"
|
||||
"2.08534 2.23463 2.22555 2.18031 2.07345 2.60855 2.94387 2.77617 2.58245 \n"
|
||||
"0.0\n";
|
||||
|
||||
const char rectilinearGrid2Ascii[] = "# vtk DataFile Version 3.0\n"
|
||||
"\n" // empty title
|
||||
"ASCII\n"
|
||||
"DATASET RECTILINEAR_GRID\n"
|
||||
"DIMENSIONS 3 4 2\n"
|
||||
"X_COORDINATES 3 float\n"
|
||||
"0 2 4\n"
|
||||
"Y_COORDINATES 4 float\n"
|
||||
"1 2 3 4\n"
|
||||
"Z_COORDINATES 2 float\n"
|
||||
"0 1\n"
|
||||
"CELL_DATA 6\n"
|
||||
"SCALARS cellscalar float\n"
|
||||
"LOOKUP_TABLE default\n"
|
||||
"1.1 7.5 1.2 1.5 2.6 8.1\n"
|
||||
"POINT_DATA 24\n"
|
||||
"SCALARS scalars float 1\n"
|
||||
"LOOKUP_TABLE default\n"
|
||||
"0 1 2 3 4 5 6 7 8 9 10 11\n"
|
||||
"12 13 14 15 16 17 18 19 20 21 22 23\n";
|
||||
|
||||
const char structuredGridAscii[] = "# vtk DataFile Version 3.0\n"
|
||||
"Structured Grid Example\n"
|
||||
"ASCII\n"
|
||||
"DATASET STRUCTURED_GRID\n"
|
||||
"DIMENSIONS 3 2 1\n"
|
||||
"POINTS 6 float\n"
|
||||
"0 0 0 1 0 0 2 0 0 0 1 0 1 1 0 2 1 0\n"
|
||||
"POINT_DATA 6\n"
|
||||
"SCALARS pointvar float 1\n"
|
||||
"LOOKUP_TABLE default\n"
|
||||
"10.1 20.1 30.1 40.1 50.1 60.1\n"
|
||||
"CELL_DATA 2\n"
|
||||
"SCALARS cellvar float 1\n"
|
||||
"LOOKUP_TABLE default\n"
|
||||
"100.1 200.1\n";
|
||||
|
||||
const char structuredGridBin[] =
|
||||
"# vtk DataFile Version 3.0\n"
|
||||
"Structured Grid Example\n"
|
||||
"BINARY\n"
|
||||
"DATASET STRUCTURED_GRID\n"
|
||||
"DIMENSIONS 3 2 3\n"
|
||||
"POINTS 18 float\n"
|
||||
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
|
||||
"\x3f\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
|
||||
"\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
|
||||
"\x00\x00\x00\x00\x3f\x80\x00\x00\x00\x00\x00\x00"
|
||||
"\x3f\x80\x00\x00\x3f\x80\x00\x00\x00\x00\x00\x00"
|
||||
"\x40\x00\x00\x00\x3f\x80\x00\x00\x00\x00\x00\x00"
|
||||
"\x00\x00\x00\x00\x00\x00\x00\x00\x3f\x80\x00\x00"
|
||||
"\x3f\x80\x00\x00\x00\x00\x00\x00\x3f\x80\x00\x00"
|
||||
"\x40\x00\x00\x00\x00\x00\x00\x00\x3f\x80\x00\x00"
|
||||
"\x00\x00\x00\x00\x3f\x80\x00\x00\x3f\x80\x00\x00"
|
||||
"\x3f\x80\x00\x00\x3f\x80\x00\x00\x3f\x80\x00\x00"
|
||||
"\x40\x00\x00\x00\x3f\x80\x00\x00\x3f\x80\x00\x00"
|
||||
"\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00"
|
||||
"\x3f\x80\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00"
|
||||
"\x40\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00"
|
||||
"\x00\x00\x00\x00\x3f\x80\x00\x00\x40\x00\x00\x00"
|
||||
"\x3f\x80\x00\x00\x3f\x80\x00\x00\x40\x00\x00\x00"
|
||||
"\x40\x00\x00\x00\x3f\x80\x00\x00\x40\x00\x00\x00\n"
|
||||
"CELL_DATA 4\n"
|
||||
"SCALARS cellvar float\n"
|
||||
"LOOKUP_TABLE default\n"
|
||||
"\x42\xc8\x33\x33\x42\xc8\x66\x66\x42\xc8\x99\x9a\x42\xc8\xcc\xcd\n"
|
||||
"POINT_DATA 18\n"
|
||||
"SCALARS pointvar float\n"
|
||||
"LOOKUP_TABLE default\n"
|
||||
"\x41\x21\x99\x9a\x41\xa0\xcc\xcd\x41\xf0\xcc\xcd"
|
||||
"\x42\x20\x66\x66\x42\x48\xcc\xcd\x42\x70\xcc\xcd"
|
||||
"\x42\x8c\x66\x66\x42\xa0\x66\x66\x42\xb4\x99\x9a"
|
||||
"\x42\xc8\x99\x9a\x42\xdc\x99\x9a\x42\xf0\x99\x9a"
|
||||
"\x43\x02\x66\x66\x43\x0c\x66\x66\x43\x16\x66\x66"
|
||||
"\x43\x20\x66\x66\x43\x2a\x80\x00\x43\x34\x80\x00\n";
|
||||
|
||||
inline void createFile(const char* buffer, std::size_t size, const char* fname)
|
||||
{
|
||||
std::ofstream fstr(fname, std::ios_base::out | std::ios_base::binary);
|
||||
fstr.write(buffer, static_cast<std::streamsize>(size - 1));
|
||||
fstr.close();
|
||||
}
|
||||
|
||||
inline vtkm::cont::DataSet readVTKDataSet(const char* fname)
|
||||
inline vtkm::cont::DataSet readVTKDataSet(const std::string& fname)
|
||||
{
|
||||
vtkm::cont::DataSet ds;
|
||||
vtkm::io::VTKDataSetReader reader(fname);
|
||||
@ -419,8 +37,6 @@ inline vtkm::cont::DataSet readVTKDataSet(const char* fname)
|
||||
return ds;
|
||||
}
|
||||
|
||||
const char* testFileName = "vtkm-io-reader-test.vtk";
|
||||
|
||||
enum Format
|
||||
{
|
||||
FORMAT_ASCII,
|
||||
@ -431,8 +47,9 @@ enum Format
|
||||
|
||||
void TestReadingPolyData(Format format)
|
||||
{
|
||||
(format == FORMAT_ASCII) ? createFile(polydataAscii, sizeof(polydataAscii), testFileName)
|
||||
: createFile(polydataBin, sizeof(polydataBin), testFileName);
|
||||
std::string testFileName = (format == FORMAT_ASCII)
|
||||
? vtkm::cont::testing::Testing::DataPath("unstructured/simple_poly_ascii.vtk")
|
||||
: vtkm::cont::testing::Testing::DataPath("unstructured/simple_poly_bin.vtk");
|
||||
|
||||
vtkm::cont::DataSet ds = readVTKDataSet(testFileName);
|
||||
|
||||
@ -447,9 +64,9 @@ void TestReadingPolyData(Format format)
|
||||
|
||||
void TestReadingStructuredPoints(Format format)
|
||||
{
|
||||
(format == FORMAT_ASCII)
|
||||
? createFile(structuredPointsAscii, sizeof(structuredPointsAscii), testFileName)
|
||||
: createFile(structuredPointsBin, sizeof(structuredPointsBin), testFileName);
|
||||
std::string testFileName = (format == FORMAT_ASCII)
|
||||
? vtkm::cont::testing::Testing::DataPath("uniform/simple_structured_points_ascii.vtk")
|
||||
: vtkm::cont::testing::Testing::DataPath("uniform/simple_structured_points_bin.vtk");
|
||||
|
||||
vtkm::cont::DataSet ds = readVTKDataSet(testFileName);
|
||||
|
||||
@ -464,27 +81,27 @@ void TestReadingStructuredPoints(Format format)
|
||||
|
||||
void TestReadingStructuredPointsVisIt(Format format)
|
||||
{
|
||||
if (format == FORMAT_ASCII)
|
||||
{
|
||||
createFile(structuredPointsVisItAscii, sizeof(structuredPointsVisItAscii), testFileName);
|
||||
VTKM_TEST_ASSERT(format == FORMAT_ASCII);
|
||||
|
||||
vtkm::cont::DataSet ds = readVTKDataSet(testFileName);
|
||||
std::string testFileName =
|
||||
vtkm::cont::testing::Testing::DataPath("uniform/simple_structured_points_visit_ascii.vtk");
|
||||
|
||||
VTKM_TEST_ASSERT(ds.GetNumberOfFields() == 1, "Incorrect number of fields");
|
||||
VTKM_TEST_ASSERT(ds.GetNumberOfPoints() == 64, "Incorrect number of points");
|
||||
VTKM_TEST_ASSERT(ds.GetCellSet().GetNumberOfPoints() == 64,
|
||||
"Incorrect number of points (from cell set)");
|
||||
VTKM_TEST_ASSERT(ds.GetNumberOfCells() == 27, "Incorrect number of cells");
|
||||
VTKM_TEST_ASSERT(ds.GetCellSet().IsType<vtkm::cont::CellSetStructured<3>>(),
|
||||
"Incorrect cellset type");
|
||||
}
|
||||
vtkm::cont::DataSet ds = readVTKDataSet(testFileName);
|
||||
|
||||
VTKM_TEST_ASSERT(ds.GetNumberOfFields() == 1, "Incorrect number of fields");
|
||||
VTKM_TEST_ASSERT(ds.GetNumberOfPoints() == 64, "Incorrect number of points");
|
||||
VTKM_TEST_ASSERT(ds.GetCellSet().GetNumberOfPoints() == 64,
|
||||
"Incorrect number of points (from cell set)");
|
||||
VTKM_TEST_ASSERT(ds.GetNumberOfCells() == 27, "Incorrect number of cells");
|
||||
VTKM_TEST_ASSERT(ds.GetCellSet().IsType<vtkm::cont::CellSetStructured<3>>(),
|
||||
"Incorrect cellset type");
|
||||
}
|
||||
|
||||
void TestReadingUnstructuredGrid(Format format)
|
||||
{
|
||||
(format == FORMAT_ASCII)
|
||||
? createFile(unsturctureGridAscii, sizeof(unsturctureGridAscii), testFileName)
|
||||
: createFile(unsturctureGridBin, sizeof(unsturctureGridBin), testFileName);
|
||||
std::string testFileName = (format == FORMAT_ASCII)
|
||||
? vtkm::cont::testing::Testing::DataPath("unstructured/simple_unstructured_ascii.vtk")
|
||||
: vtkm::cont::testing::Testing::DataPath("unstructured/simple_unstructured_bin.vtk");
|
||||
|
||||
vtkm::cont::DataSet ds = readVTKDataSet(testFileName);
|
||||
|
||||
@ -499,60 +116,63 @@ void TestReadingUnstructuredGrid(Format format)
|
||||
|
||||
void TestReadingUnstructuredGridVisIt(Format format)
|
||||
{
|
||||
if (format == FORMAT_ASCII)
|
||||
{
|
||||
createFile(unsturctureGridVisItAscii, sizeof(unsturctureGridVisItAscii), testFileName);
|
||||
vtkm::cont::DataSet ds = readVTKDataSet(testFileName);
|
||||
VTKM_TEST_ASSERT(format == FORMAT_ASCII);
|
||||
|
||||
VTKM_TEST_ASSERT(ds.GetNumberOfFields() == 2, "Incorrect number of fields");
|
||||
VTKM_TEST_ASSERT(ds.GetNumberOfPoints() == 26, "Incorrect number of points");
|
||||
VTKM_TEST_ASSERT(ds.GetCellSet().GetNumberOfPoints() == 26,
|
||||
"Incorrect number of points (from cell set)");
|
||||
VTKM_TEST_ASSERT(ds.GetNumberOfCells() == 15, "Incorrect number of cells");
|
||||
VTKM_TEST_ASSERT(ds.GetCellSet().IsType<vtkm::cont::CellSetExplicit<>>(),
|
||||
"Incorrect cellset type");
|
||||
}
|
||||
std::string testFileName =
|
||||
vtkm::cont::testing::Testing::DataPath("unstructured/simple_unstructured_visit_ascii.vtk");
|
||||
|
||||
vtkm::cont::DataSet ds = readVTKDataSet(testFileName);
|
||||
|
||||
VTKM_TEST_ASSERT(ds.GetNumberOfFields() == 2, "Incorrect number of fields");
|
||||
VTKM_TEST_ASSERT(ds.GetNumberOfPoints() == 26, "Incorrect number of points");
|
||||
VTKM_TEST_ASSERT(ds.GetCellSet().GetNumberOfPoints() == 26,
|
||||
"Incorrect number of points (from cell set)");
|
||||
VTKM_TEST_ASSERT(ds.GetNumberOfCells() == 15, "Incorrect number of cells");
|
||||
VTKM_TEST_ASSERT(ds.GetCellSet().IsType<vtkm::cont::CellSetExplicit<>>(),
|
||||
"Incorrect cellset type");
|
||||
}
|
||||
|
||||
void TestReadingRectilinearGrid1(Format format)
|
||||
{
|
||||
if (format == FORMAT_ASCII)
|
||||
{
|
||||
createFile(rectilinearGrid1Ascii, sizeof(rectilinearGrid1Ascii), testFileName);
|
||||
VTKM_TEST_ASSERT(format == FORMAT_ASCII);
|
||||
|
||||
vtkm::cont::DataSet ds = readVTKDataSet(testFileName);
|
||||
std::string testFileName =
|
||||
vtkm::cont::testing::Testing::DataPath("rectilinear/simple_rectilinear1_ascii.vtk");
|
||||
|
||||
VTKM_TEST_ASSERT(ds.GetNumberOfFields() == 2, "Incorrect number of fields");
|
||||
VTKM_TEST_ASSERT(ds.GetNumberOfPoints() == 125, "Incorrect number of points");
|
||||
VTKM_TEST_ASSERT(ds.GetCellSet().GetNumberOfPoints() == 125,
|
||||
"Incorrect number of points (from cell set)");
|
||||
VTKM_TEST_ASSERT(ds.GetNumberOfCells() == 64, "Incorrect number of cells");
|
||||
VTKM_TEST_ASSERT(ds.GetCellSet().IsType<vtkm::cont::CellSetStructured<3>>(),
|
||||
"Incorrect cellset type");
|
||||
}
|
||||
vtkm::cont::DataSet ds = readVTKDataSet(testFileName);
|
||||
|
||||
VTKM_TEST_ASSERT(ds.GetNumberOfFields() == 2, "Incorrect number of fields");
|
||||
VTKM_TEST_ASSERT(ds.GetNumberOfPoints() == 125, "Incorrect number of points");
|
||||
VTKM_TEST_ASSERT(ds.GetCellSet().GetNumberOfPoints() == 125,
|
||||
"Incorrect number of points (from cell set)");
|
||||
VTKM_TEST_ASSERT(ds.GetNumberOfCells() == 64, "Incorrect number of cells");
|
||||
VTKM_TEST_ASSERT(ds.GetCellSet().IsType<vtkm::cont::CellSetStructured<3>>(),
|
||||
"Incorrect cellset type");
|
||||
}
|
||||
|
||||
void TestReadingRectilinearGrid2(Format format)
|
||||
{
|
||||
if (format == FORMAT_ASCII)
|
||||
{
|
||||
createFile(rectilinearGrid2Ascii, sizeof(rectilinearGrid2Ascii), testFileName);
|
||||
VTKM_TEST_ASSERT(format == FORMAT_ASCII);
|
||||
|
||||
vtkm::cont::DataSet ds = readVTKDataSet(testFileName);
|
||||
std::string testFileName =
|
||||
vtkm::cont::testing::Testing::DataPath("rectilinear/simple_rectilinear2_ascii.vtk");
|
||||
|
||||
VTKM_TEST_ASSERT(ds.GetNumberOfFields() == 2, "Incorrect number of fields");
|
||||
VTKM_TEST_ASSERT(ds.GetNumberOfPoints() == 24, "Incorrect number of points");
|
||||
VTKM_TEST_ASSERT(ds.GetCellSet().GetNumberOfPoints() == 24,
|
||||
"Incorrect number of points (from cell set)");
|
||||
VTKM_TEST_ASSERT(ds.GetNumberOfCells() == 6, "Incorrect number of cells");
|
||||
VTKM_TEST_ASSERT(ds.GetCellSet().IsType<vtkm::cont::CellSetStructured<3>>(),
|
||||
"Incorrect cellset type");
|
||||
}
|
||||
vtkm::cont::DataSet ds = readVTKDataSet(testFileName);
|
||||
|
||||
VTKM_TEST_ASSERT(ds.GetNumberOfFields() == 2, "Incorrect number of fields");
|
||||
VTKM_TEST_ASSERT(ds.GetNumberOfPoints() == 24, "Incorrect number of points");
|
||||
VTKM_TEST_ASSERT(ds.GetCellSet().GetNumberOfPoints() == 24,
|
||||
"Incorrect number of points (from cell set)");
|
||||
VTKM_TEST_ASSERT(ds.GetNumberOfCells() == 6, "Incorrect number of cells");
|
||||
VTKM_TEST_ASSERT(ds.GetCellSet().IsType<vtkm::cont::CellSetStructured<3>>(),
|
||||
"Incorrect cellset type");
|
||||
}
|
||||
|
||||
void TestReadingStructuredGridASCII()
|
||||
{
|
||||
createFile(structuredGridAscii, sizeof(structuredGridAscii), testFileName);
|
||||
std::string testFileName =
|
||||
vtkm::cont::testing::Testing::DataPath("curvilinear/simple_structured_ascii.vtk");
|
||||
|
||||
vtkm::cont::DataSet ds = readVTKDataSet(testFileName);
|
||||
|
||||
VTKM_TEST_ASSERT(ds.GetNumberOfFields() == 2, "Incorrect number of fields");
|
||||
@ -566,7 +186,9 @@ void TestReadingStructuredGridASCII()
|
||||
|
||||
void TestReadingStructuredGridBin()
|
||||
{
|
||||
createFile(structuredGridBin, sizeof(structuredGridBin), testFileName);
|
||||
std::string testFileName =
|
||||
vtkm::cont::testing::Testing::DataPath("curvilinear/simple_structured_bin.vtk");
|
||||
|
||||
vtkm::cont::DataSet ds = readVTKDataSet(testFileName);
|
||||
|
||||
VTKM_TEST_ASSERT(ds.GetNumberOfFields() == 2, "Incorrect number of fields");
|
||||
@ -580,8 +202,7 @@ void TestReadingStructuredGridBin()
|
||||
|
||||
void TestReadingFishTank()
|
||||
{
|
||||
std::string fishtank =
|
||||
vtkm::cont::testing::Testing::GetTestDataBasePath() + "/rectilinear/fishtank.vtk";
|
||||
std::string fishtank = vtkm::cont::testing::Testing::DataPath("rectilinear/fishtank.vtk");
|
||||
vtkm::cont::DataSet ds = readVTKDataSet(fishtank.c_str());
|
||||
|
||||
// This is information you can glean by running 'strings' on fishtank.vtk:
|
||||
@ -662,8 +283,8 @@ void TestReadingFishTank()
|
||||
|
||||
void TestReadingDoublePrecisionFishTank()
|
||||
{
|
||||
std::string fishtank = vtkm::cont::testing::Testing::GetTestDataBasePath() +
|
||||
"/rectilinear/fishtank_double_big_endian.vtk";
|
||||
std::string fishtank =
|
||||
vtkm::cont::testing::Testing::DataPath("rectilinear/fishtank_double_big_endian.vtk");
|
||||
vtkm::cont::DataSet ds = readVTKDataSet(fishtank.c_str());
|
||||
|
||||
// This is information you can glean by running 'strings' on fishtank.vtk:
|
||||
@ -718,7 +339,7 @@ void TestReadingDoublePrecisionFishTank()
|
||||
void TestReadingASCIIFishTank()
|
||||
{
|
||||
std::string fishtank =
|
||||
vtkm::cont::testing::Testing::GetTestDataBasePath() + "/rectilinear/fishtank_double_ascii.vtk";
|
||||
vtkm::cont::testing::Testing::DataPath("rectilinear/fishtank_double_ascii.vtk");
|
||||
vtkm::cont::DataSet ds = readVTKDataSet(fishtank.c_str());
|
||||
VTKM_TEST_ASSERT(ds.GetCellSet().IsType<vtkm::cont::CellSetStructured<3>>(),
|
||||
"Incorrect cellset type");
|
||||
@ -764,8 +385,7 @@ void TestReadingASCIIFishTank()
|
||||
|
||||
void TestReadingFusion()
|
||||
{
|
||||
std::string fusion =
|
||||
vtkm::cont::testing::Testing::GetTestDataBasePath() + "/rectilinear/fusion.vtk";
|
||||
std::string fusion = vtkm::cont::testing::Testing::DataPath("rectilinear/fusion.vtk");
|
||||
vtkm::cont::DataSet ds = readVTKDataSet(fusion.c_str());
|
||||
|
||||
VTKM_TEST_ASSERT(ds.GetCellSet().IsType<vtkm::cont::CellSetStructured<3>>(),
|
||||
|
@ -36,8 +36,7 @@ void RenderTests()
|
||||
colorTable.AddPointAlpha(1.0, .01f);
|
||||
|
||||
vtkm::cont::DataSet rectDS, unsDS;
|
||||
std::string basePath = vtkm::cont::testing::Testing::GetTestDataBasePath();
|
||||
std::string rectfname = basePath + "/rectilinear/noise.vtk";
|
||||
std::string rectfname = vtkm::cont::testing::Testing::DataPath("rectilinear/noise.vtk");
|
||||
vtkm::io::VTKDataSetReader rectReader(rectfname);
|
||||
|
||||
try
|
||||
|
@ -972,8 +972,6 @@ void TestParticleAdvection()
|
||||
TestWorkletsBasic();
|
||||
TestParticleWorkletsWithDataSetTypes();
|
||||
|
||||
std::string basePath = vtkm::cont::testing::Testing::GetTestDataBasePath();
|
||||
|
||||
//Fusion test.
|
||||
std::vector<vtkm::Vec3f> fusionPts, fusionEndPts;
|
||||
fusionPts.push_back(vtkm::Vec3f(0.8f, 0.6f, 0.6f));
|
||||
@ -984,7 +982,7 @@ void TestParticleAdvection()
|
||||
fusionEndPts.push_back(vtkm::Vec3f(0.5601879954f, 0.91389900446f, 0.43989110522f));
|
||||
fusionEndPts.push_back(vtkm::Vec3f(0.7004770041f, 0.63193398714f, 0.64524400234f));
|
||||
vtkm::FloatDefault fusionStep = 0.005f;
|
||||
std::string fusionFile = basePath + "/rectilinear/fusion.vtk";
|
||||
std::string fusionFile = vtkm::cont::testing::Testing::DataPath("rectilinear/fusion.vtk");
|
||||
TestParticleAdvectionFile(fusionFile, fusionPts, fusionStep, 1000, fusionEndPts);
|
||||
|
||||
//Fishtank test.
|
||||
@ -998,7 +996,7 @@ void TestParticleAdvection()
|
||||
fishEndPts.push_back(vtkm::Vec3f(0.8347796798f, 0.1276152730f, 0.4985143244f));
|
||||
|
||||
vtkm::FloatDefault fishStep = 0.001f;
|
||||
std::string fishFile = basePath + "/rectilinear/fishtank.vtk";
|
||||
std::string fishFile = vtkm::cont::testing::Testing::DataPath("rectilinear/fishtank.vtk");
|
||||
TestParticleAdvectionFile(fishFile, fishPts, fishStep, 100, fishEndPts);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user