@@ -624,14 +624,14 @@ def _load_boundary_data(self, smv_file: TextIO, line: str, cell_centered: bool):
624
624
625
625
with open (file_path , 'rb' ) as infile :
626
626
# Offset of the binary file to the end of the file header.
627
- offset = 3 * fdtype .new ((('c' , 30 ),)).itemsize
628
- infile .seek (offset )
627
+ initial_offset = 3 * fdtype .new ((('c' , 30 ),)).itemsize
628
+ infile .seek (initial_offset )
629
629
630
630
n_patches = fdtype .read (infile , fdtype .INT , 1 )[0 ][0 ][0 ]
631
631
632
632
dtype_patches = fdtype .new ((('i' , 9 ),))
633
633
patch_infos = fdtype .read (infile , dtype_patches , n_patches )
634
- offset += fdtype .INT .itemsize + dtype_patches .itemsize * n_patches
634
+ initial_offset += fdtype .INT .itemsize + dtype_patches .itemsize * n_patches
635
635
patch_offset = fdtype .FLOAT .itemsize
636
636
637
637
# Determine the size of the data block for all patches
@@ -643,9 +643,10 @@ def _load_boundary_data(self, smv_file: TextIO, line: str, cell_centered: bool):
643
643
644
644
# Time info
645
645
time_bytes = fdtype .FLOAT .itemsize
646
- n_t = (os .stat (file_path ).st_size - offset ) // (time_bytes + patches_data_bytes )
646
+ n_t = (os .stat (file_path ).st_size - initial_offset ) // (time_bytes + patches_data_bytes )
647
647
648
648
times = list ()
649
+ offset = initial_offset
649
650
for _ in range (n_t ):
650
651
time = fdtype .read (infile , fdtype .FLOAT , 1 )[0 ][0 ][0 ]
651
652
times .append (time )
@@ -660,7 +661,7 @@ def _load_boundary_data(self, smv_file: TextIO, line: str, cell_centered: bool):
660
661
obst_index = patch_info [7 ] - 1
661
662
662
663
p = Patch (file_path , dimension , extent , orientation , cell_centered ,
663
- patch_offset , offset , n_t , mesh )
664
+ patch_offset , initial_offset , n_t , mesh )
664
665
665
666
# "Obstacles" with index -1 give the extent of the (whole) mesh faces and refer to
666
667
# "closed" mesh faces, therefore that data will be added to the corresponding mesh instead
0 commit comments