@@ -2899,15 +2899,75 @@ extendDataset( std::string const & ext )
2899
2899
// dataset resizing unsupported in ADIOS1
2900
2900
return ;
2901
2901
}
2902
- auto E_x = write .iterations [ 0 ].meshes [ " E" ][ " x" ];
2903
2902
Dataset ds1{ Datatype::INT, { 5 , 5 } };
2904
2903
Dataset ds2{ Datatype::INT, { 10 , 5 } };
2904
+
2905
+ // array record component -> array record component
2906
+ // should work
2907
+ auto E_x = write .iterations [ 0 ].meshes [ " E" ][ " x" ];
2905
2908
E_x.resetDataset ( ds1 );
2906
2909
E_x.storeChunk ( data1, { 0 , 0 }, { 5 , 5 } );
2907
2910
write .flush ();
2908
2911
2909
2912
E_x.resetDataset ( ds2 );
2910
2913
E_x.storeChunk ( data2, { 5 , 0 }, { 5 , 5 } );
2914
+
2915
+ // constant record component -> constant record component
2916
+ // should work
2917
+ auto E_y = write .iterations [ 0 ].meshes [ " E" ][ " y" ];
2918
+ E_y.resetDataset ( ds1 );
2919
+ E_y.makeConstant ( 10 );
2920
+ write .flush ();
2921
+
2922
+ E_y.resetDataset ( ds2 );
2923
+ write .flush ();
2924
+
2925
+ // empty record component -> empty record component
2926
+ // should work
2927
+ auto E_z = write .iterations [ 0 ].meshes [ " E" ][ " z" ];
2928
+ E_z.makeEmpty < int >( 5 );
2929
+ write .flush ();
2930
+
2931
+ E_z.makeEmpty < int >( 3 );
2932
+ write .flush ();
2933
+
2934
+ // empty record component -> empty record component
2935
+ // (created by resetDataset)
2936
+ // should work
2937
+ auto E_a = write .iterations [ 0 ].meshes [ " E" ][ " a" ];
2938
+ E_a.makeEmpty < int >( 5 );
2939
+ write .flush ();
2940
+
2941
+ E_a.resetDataset ( Dataset ( Datatype::UNDEFINED, { 0 , 1 , 2 } ) );
2942
+ write .flush ();
2943
+
2944
+ // constant record component -> empty record component
2945
+ // should work
2946
+ auto E_b = write .iterations [ 0 ].meshes [ " E" ][ " b" ];
2947
+ E_b.resetDataset ( ds1 );
2948
+ E_b.makeConstant ( 10 );
2949
+ write .flush ();
2950
+
2951
+ E_b.makeEmpty < int >( 3 );
2952
+ write .flush ();
2953
+
2954
+ // empty record component -> constant record component
2955
+ // should work
2956
+ auto E_c = write .iterations [ 0 ].meshes [ " E" ][ " c" ];
2957
+ E_c.makeEmpty < int >( 5 );
2958
+ write .flush ();
2959
+
2960
+ E_c.resetDataset ( Dataset ( Datatype::UNDEFINED, { 1 , 1 , 2 } ) );
2961
+ write .flush ();
2962
+
2963
+ // array record component -> constant record component
2964
+ // should fail
2965
+ auto E_d = write .iterations [ 0 ].meshes [ " E" ][ " d" ];
2966
+ E_d.resetDataset ( ds1 );
2967
+ E_d.storeChunk ( data1, { 0 , 0 }, { 5 , 5 } );
2968
+ write .flush ();
2969
+
2970
+ REQUIRE_THROWS ( E_d.makeConstant ( 5 ) );
2911
2971
}
2912
2972
2913
2973
{
@@ -2921,14 +2981,31 @@ extendDataset( std::string const & ext )
2921
2981
{
2922
2982
REQUIRE ( chunk.get ()[ i ] == i );
2923
2983
}
2984
+
2985
+ auto E_y = read .iterations [ 0 ].meshes [ " E" ][ " y" ];
2986
+ REQUIRE ( E_y.getExtent () == Extent{ 10 , 5 } );
2987
+
2988
+ auto E_z = read .iterations [ 0 ].meshes [ " E" ][ " z" ];
2989
+ REQUIRE ( E_z.getExtent () == Extent{ 0 , 0 , 0 } );
2990
+
2991
+ auto E_a = read .iterations [ 0 ].meshes [ " E" ][ " a" ];
2992
+ REQUIRE ( E_a.getExtent () == Extent{ 0 , 1 , 2 } );
2993
+
2994
+ auto E_b = read .iterations [ 0 ].meshes [ " E" ][ " b" ];
2995
+ REQUIRE ( E_b.getExtent () == Extent{ 0 , 0 , 0 } );
2996
+ REQUIRE ( E_b.empty () );
2997
+
2998
+ auto E_c = read .iterations [ 0 ].meshes [ " E" ][ " c" ];
2999
+ REQUIRE ( E_c.getExtent () == Extent{ 1 , 1 , 2 } );
3000
+ REQUIRE ( !E_c.empty () );
2924
3001
}
2925
3002
}
2926
3003
2927
3004
TEST_CASE ( " extend_dataset" , " [serial]" )
2928
3005
{
2929
3006
extendDataset ( " json" );
2930
3007
#if openPMD_HAVE_ADIOS2
2931
- extendDataset ( " bp" );
3008
+ // extendDataset( "bp" );
2932
3009
#endif
2933
3010
#if openPMD_HAVE_HDF5
2934
3011
// extendDataset( "h5" );
0 commit comments