@@ -248,8 +248,7 @@ def __init__(self, geim_offline_object, snaps, rank_reconstruct = None):
248248 self .list_sensor_to_field = self .geim_offline .list_sensor_to_field
249249 self .list_sensor_to_basis_paths = self .geim_offline .list_sensor_to_basis_paths
250250 self .virtual_openFoam_directory = self .geim_offline .virtual_openFoam_directory
251- self .A = self .geim_offline .A
252- #self.rank = self.geim_offline.rank
251+ self .A = self .geim_offline .A [:self .rank_reconstruct , :self .rank_reconstruct ]
253252
254253 # We create a directory for each snap in the symlinked directory. Reconstruted snapshots are named as shown.
255254 self .list_reconstructed_snaps = []
@@ -259,7 +258,7 @@ def __init__(self, geim_offline_object, snaps, rank_reconstruct = None):
259258 # For a list of snapshots, this method reconstructs each snapshot using the coefficients obtained from the sensor data and the bases. The coefficients are obtained by solving the linear system defined
260259 # by the system matrix and the sensor data.
261260 def reconstruct_snaps (self ):
262- scaled_dirac_measure_data = np .zeros ((self .rank , len (self .snaps )))
261+ scaled_dirac_measure_data = np .zeros ((self .rank_reconstruct , len (self .snaps )))
263262 for i in range (self .rank_reconstruct ):
264263 sensor_point = self .list_points [i ]
265264 sensor_field = self .list_sensor_to_field [i ]
@@ -272,4 +271,4 @@ def reconstruct_snaps(self):
272271 reconstructed_snap = self .list_reconstructed_snaps [i ]
273272 for field in self .all_fields :
274273 region , field_name = split_on_slash (field )
275- linAlg4Foam .linearCombination (self .virtual_openFoam_directory , [self .list_sensor_to_basis_paths ], [field ], [coeffs_list ], [os .path .join ("../symlinked_cases" , reconstructed_snap , region )])
274+ linAlg4Foam .linearCombination (self .virtual_openFoam_directory , [self .list_sensor_to_basis_paths [: self . rank_reconstruct ], [field ], [coeffs_list ], [os .path .join ("../symlinked_cases" , reconstructed_snap , region )])
0 commit comments