Skip to content

Commit

Permalink
Merge topic 'add-netcdf-ugrid-reader'
Browse files Browse the repository at this point in the history
a205fcb Add NetCDF UGRID reader in ParaView: XML and test.

Acked-by: Kitware Robot <[email protected]>
Reviewed-by: Tiffany Chhim <[email protected]>
Merge-request: !6112
  • Loading branch information
francois-kitware authored and kwrobot committed Jan 13, 2023
2 parents 27f4b97 + a205fcb commit d5226af
Show file tree
Hide file tree
Showing 6 changed files with 157 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9402b70c4380fe79683a5a01b65862b541c5c0b14b12b5fdbccadab3839e219b057406c90384ed7644640ab971bc47df4961720c2930f8219f6e0e6564919015
3 changes: 3 additions & 0 deletions Clients/ParaView/Testing/XML/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ ExternalData_Expand_Arguments(ParaViewData _
"DATA{${paraview_test_data_directory_input}/Data/YoungsMaterialInterface/youngs.vtm}"
"DATA{${paraview_test_data_directory_input}/Data/YoungsMaterialInterface/youngs/youngs_0.vtu}"
"DATA{${paraview_test_data_directory_input}/Data/YoungsMaterialInterface/youngs/youngs_1.vtu}"
"DATA{${paraview_test_data_directory_input}/Data/ugrid.nc}"

# Baselines
"DATA{${CMAKE_CURRENT_SOURCE_DIR}/../Data/Baseline/AAXAxis.png}"
Expand Down Expand Up @@ -441,6 +442,7 @@ ExternalData_Expand_Arguments(ParaViewData _
"DATA{${CMAKE_CURRENT_SOURCE_DIR}/../Data/Baseline/MultiBlockInspectorWithoutSelectOnClickSetting.png}"
"DATA{${CMAKE_CURRENT_SOURCE_DIR}/../Data/Baseline/NestedViews.png}"
"DATA{${CMAKE_CURRENT_SOURCE_DIR}/../Data/Baseline/NestedViews_1.png}"
"DATA{${CMAKE_CURRENT_SOURCE_DIR}/../Data/Baseline/NetCDFUGRID.png}"
"DATA{${CMAKE_CURRENT_SOURCE_DIR}/../Data/Baseline/NonlinearSubdivision0Display.png}"
"DATA{${CMAKE_CURRENT_SOURCE_DIR}/../Data/Baseline/NonlinearSubdivision0Display_1.png}"
"DATA{${CMAKE_CURRENT_SOURCE_DIR}/../Data/Baseline/NonlinearSubdivision1Display.png}"
Expand Down Expand Up @@ -883,6 +885,7 @@ SET(TESTS_WITH_BASELINES
EmptyInitialCompositeReader.xml # Issue #21293
MergeVectorComponents.xml
MoleculeScalarBar.xml
NetCDFUGRID.xml
ParticleTracerGlyph.xml
PassArrays.xml
PerlinNoise.xml
Expand Down
16 changes: 16 additions & 0 deletions Clients/ParaView/Testing/XML/NetCDFUGRID.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" ?>
<pqevents>
<pqevent object="pqClientMainWindow/menubar" command="activate" arguments="menuTools" />
<pqevent object="pqClientMainWindow/menubar/menuTools" command="activate" arguments="actionTesting_Window_Size" />
<pqevent object="pqClientMainWindow/menubar" command="activate" arguments="menu_File" />
<pqevent object="pqClientMainWindow/menubar/menu_File" command="activate" arguments="actionFileOpen" />
<pqevent object="pqClientMainWindow/FileOpenDialog" command="filesSelected" arguments="$PARAVIEW_DATA_ROOT/Testing/Data/ugrid.nc" />
<pqevent object="pqClientMainWindow/pqSelectReaderDialog/listWidget" command="setCurrent" arguments="2.0" />
<pqevent object="pqClientMainWindow/pqSelectReaderDialog/listWidget" command="setCheckState" arguments="2.0,0" />
<pqevent object="pqClientMainWindow/pqSelectReaderDialog/okButton" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/Accept" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/variableToolbar/displayColor/Variables" command="activated" arguments="h" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Container/Frame.0/CentralWidgetFrame/Viewport/1QVTKOpenGLNativeWidget0" command="mousePress" arguments="(0.38,0.15,1,1,0)" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Container/Frame.0/CentralWidgetFrame/Viewport/1QVTKOpenGLNativeWidget0" command="mouseMove" arguments="(0.38,0.15,1,0,0)" />
<pqevent object="pqClientMainWindow/centralwidget/MultiViewWidget/CoreWidget/qt_tabwidget_stackedwidget/MultiViewWidget1/Container/Frame.0/CentralWidgetFrame/Viewport/1QVTKOpenGLNativeWidget0" command="mouseRelease" arguments="(0.38,0.15,1,0,0)" />
</pqevents>
6 changes: 6 additions & 0 deletions Documentation/release/dev/netcdf-ugrid-reader.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## NetCDF UGRID Reader

ParaView now provides a new reader to load NetCDF files that follow the [UGRID conventions](https://ugrid-conventions.github.io/ugrid-conventions/).

Only 2D meshes are supported and you can extract points, cells and data arrays associated to them.
You can also replace values denoted as "fill values" with NaN.
130 changes: 130 additions & 0 deletions Remoting/Application/Resources/readers_ionetcdf.xml
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,84 @@
</Proxy>

<!-- ================================================================== -->
<Proxy class="vtkNetCDFUGRIDReader"
label="NetCDF UGRID reader Core"
name="NetCDFUGRIDReaderCore">
<StringVectorProperty animateable="0"
command="SetFileName"
name="FileName"
number_of_elements="1"
panel_visibility="never">
<FileListDomain name="files" />
</StringVectorProperty>
<StringVectorProperty information_only="1"
name="CellArrayInfo">
<ArraySelectionInformationHelper attribute_name="Cell" />
</StringVectorProperty>
<StringVectorProperty command="SetCellArrayStatus"
element_types="2 0"
information_property="CellArrayInfo"
label="Cell Arrays"
name="CellArrayStatus"
number_of_elements="0"
number_of_elements_per_command="2"
repeat_command="1">
<ArraySelectionDomain name="array_list">
<RequiredProperties>
<Property function="ArrayList"
name="CellArrayInfo" />
</RequiredProperties>
</ArraySelectionDomain>
<Documentation>This property lists which cell-centered arrays to
read.</Documentation>
</StringVectorProperty>
<StringVectorProperty information_only="1"
name="PointArrayInfo">
<ArraySelectionInformationHelper attribute_name="Point" />
</StringVectorProperty>
<StringVectorProperty command="SetPointArrayStatus"
element_types="2 0"
information_property="PointArrayInfo"
label="Point Arrays"
name="PointArrayStatus"
number_of_elements="0"
number_of_elements_per_command="2"
repeat_command="1">
<ArraySelectionDomain name="array_list">
<RequiredProperties>
<Property function="ArrayList"
name="PointArrayInfo" />
</RequiredProperties>
</ArraySelectionDomain>
<Documentation>This property lists which point-centered arrays to
read.</Documentation>
</StringVectorProperty>
<IntVectorProperty command="SetReplaceFillValueWithNan"
default_values="0"
name="ReplaceFillValueWithNan"
number_of_elements="1"
panel_visibility="default">
<BooleanDomain name="bool" />
<Documentation>If on, any float or double variable read that has a
_FillValue attribute will have that fill value replaced with a
not-a-number (NaN) value. The advantage of setting these to NaN values
is that, if implemented properly by the system and careful math
operations are used, they can implicitly be ignored by calculations
like finding the range of the values. That said, this option should be
used with caution as VTK does not fully support NaN values and
therefore odd calculations may occur.</Documentation>
</IntVectorProperty>
<DoubleVectorProperty information_only="1"
name="TimestepValues"
repeatable="1">
<TimeStepsInformationHelper />
</DoubleVectorProperty>
<Hints>
<ReaderFactory extensions="nc ncdf"
file_description="NetCDF UGRID file"/>
</Hints>
<!-- End NetCDFUGRIDReaderCore -->
</Proxy>
<!-- end of "internal_sources" -->
</ProxyGroup>

Expand Down Expand Up @@ -562,6 +640,58 @@
<!-- netCDFReader -->
</SourceProxy>

<!-- ================================================================== -->
<SourceProxy class="vtkFileSeriesReader"
file_name_method="SetFileName"
label="NetCDF UGRID reader"
name="NetCDFUGRIDReader"
si_class="vtkSIMetaReaderProxy">
<SubProxy>
<Proxy name="Reader"
proxygroup="internal_sources"
proxyname="NetCDFUGRIDReaderCore">
</Proxy>
<ExposedProperties>
<Property name="CellArrayInfo" />
<Property name="CellArrayStatus" />
<Property name="PointArrayInfo" />
<Property name="PointArrayStatus" />
<Property name="ReplaceFillValueWithNan" />
</ExposedProperties>
</SubProxy>
<Documentation long_help="Reads unstructured grid data from NetCDF files. There are 2 files, a points+fields file which is set as FileName and a cell connectivity file set as ConnectivityFileName."
short_help="Read unstructured grid NetCDF files in UGRID format.">
</Documentation>
<StringVectorProperty command="GetCurrentFileName"
information_only="1"
name="FileNameInfo">
<SimpleStringInformationHelper />
</StringVectorProperty>
<StringVectorProperty animateable="0"
clean_command="RemoveAllFileNames"
command="AddFileName"
information_property="FileNameInfo"
name="FileName"
number_of_elements="1"
panel_visibility="never"
repeat_command="1">
<FileListDomain name="files" />
<Documentation>The list of files to be read by the
reader.</Documentation>
</StringVectorProperty>
<DoubleVectorProperty information_only="1"
name="TimestepValues"
repeatable="1">
<TimeStepsInformationHelper />
<Documentation>Available timestep values.</Documentation>
</DoubleVectorProperty>
<Hints>
<ReaderFactory extensions="nc ncdf"
file_description="UGRID NetCDF (Unstructured)" />
</Hints>
<!-- End NetCDFUGRIDReader -->
</SourceProxy>

<!-- ================================================================== -->
<SourceProxy class="vtkMPASReader"
label="NetCDF MPAS reader"
Expand Down
1 change: 1 addition & 0 deletions Testing/Data/ugrid.nc.sha512
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0ab7bd9f9b0cbf6911638802b88803fccb81bde108e4dbdbdd1e7354a3373e17d42214767a7941c82c8222f5eb6198e09a9c90bc571cbf0897eb24d36d9ba1ed

0 comments on commit d5226af

Please sign in to comment.