mirror of
https://github.com/OPM/ResInsight.git
synced 2026-11-23 14:28:13 -06:00
VTK: read only scalar point data arrays as node properties
Vector arrays such as "disp" are read by readDisplacements and were parsed again only to be discarded by readNodalData.
This commit is contained in:
1 parent
5fa48d6e60
commit
cdf4e0fa64
3 files changed
+31
-4
No files matched your search
@@ -280,3 +280,27 @@ TEST( RifVtkImportUtilTest, ReadProperties_MissingCellDataSection )
|
||||
auto properties = RifVtkImportUtil::readProperties( piece );
|
||||
EXPECT_TRUE( properties.empty() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
// readPointProperties
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
TEST( RifVtkImportUtilTest, ReadPointProperties_SkipsVectorArrays )
|
||||
{
|
||||
pugi::xml_document doc;
|
||||
auto piece = parsePiece( doc, R"(
|
||||
<UnstructuredGrid>
|
||||
<Piece>
|
||||
<PointData>
|
||||
<DataArray type="Float32" Name="pressure" NumberOfComponents="1" format="ascii">1.0 2.0</DataArray>
|
||||
<DataArray type="Float32" Name="disp" NumberOfComponents="3" format="ascii">0 0 0 0 0 0</DataArray>
|
||||
</PointData>
|
||||
</Piece>
|
||||
</UnstructuredGrid>)" );
|
||||
|
||||
auto properties = RifVtkImportUtil::readPointProperties( piece );
|
||||
|
||||
ASSERT_EQ( properties.size(), 1u );
|
||||
ASSERT_TRUE( properties.count( "pressure" ) > 0 );
|
||||
EXPECT_FLOAT_EQ( properties["pressure"][1], 2.0f );
|
||||
}
|
||||
Reference in new issue
Block a user