Beispiel #1
0
 def read_files(self):
     # open aero file
     # first, file names
     self.aero_file_name = self.data.case_route + '/' + self.data.case_name + '.aero.h5'
     # then check that the file exists
     h5utils.check_file_exists(self.aero_file_name)
     # read and store the hdf5 file
     with h5.File(self.aero_file_name, 'r') as aero_file_handle:
         # store files in dictionary
         self.aero_data_dict = h5utils.load_h5_in_dict(aero_file_handle)
Beispiel #2
0
    def read_files(self):

        self.input_file_name = self.data.settings['SHARPy'][
            'route'] + '/' + self.data.settings['SHARPy'][
                'case'] + '.lininput.h5'

        # Check that the file exists
        try:
            h5utils.check_file_exists(self.input_file_name)
            # Read and store
            with h5.File(self.input_file_name, 'r') as input_file_handle:
                self.input_data_dict = h5utils.load_h5_in_dict(
                    input_file_handle)
        except FileNotFoundError:
            pass
Beispiel #3
0
 def read_files(self):
     # open fem file
     # first, file names
     self.fem_file_name = self.data.case_route + '/' + self.data.case_name + '.fem.h5'
     if self.settings['unsteady']:
         self.dyn_file_name = self.data.case_route + '/' + self.data.case_name + '.dyn.h5'
     # then check that the files exists
     h5utils.check_file_exists(self.fem_file_name)
     if self.settings['unsteady']:
         h5utils.check_file_exists(self.dyn_file_name)
     # read and store the hdf5 files
     with h5.File(self.fem_file_name, 'r') as fem_file_handle:
         # store files in dictionary
         self.fem_data_dict = h5utils.load_h5_in_dict(fem_file_handle)
         # TODO implement fem file validation
         # self.validate_fem_file()
     if self.settings['unsteady']:
         with h5.File(self.dyn_file_name, 'r') as dyn_file_handle:
             # store files in dictionary
             self.dyn_data_dict = h5utils.load_h5_in_dict(dyn_file_handle)
Beispiel #4
0
    def read_files(self):
        # open fem file
        # first, file names
        self.fem_file_name = self.data.case_route + '/' + self.data.case_name + '.fem.h5'
        if self.settings['unsteady']:
            self.dyn_file_name = self.data.case_route + '/' + self.data.case_name + '.dyn.h5'
        # then check that the files exists
        h5utils.check_file_exists(self.fem_file_name)
        if self.settings['unsteady']:
            try:
                h5utils.check_file_exists(self.dyn_file_name)
            except FileNotFoundError:
                self.settings['unsteady'] = False
        # read and store the hdf5 files
        with h5.File(self.fem_file_name, 'r') as fem_file_handle:
            # store files in dictionary
            self.fem_data_dict = h5utils.load_h5_in_dict(fem_file_handle)
            # TODO implement fem file validation
            # self.validate_fem_file()
        if self.settings['unsteady']:
            with h5.File(self.dyn_file_name, 'r') as dyn_file_handle:
                # store files in dictionary
                self.dyn_data_dict = h5utils.load_h5_in_dict(dyn_file_handle)
                # TODO implement dyn file validation
                # self.validate_dyn_file()

        # Multibody information
        self.mb_file_name = self.data.case_route + '/' + self.data.case_name + '.mb.h5'
        if os.path.isfile(self.mb_file_name):
            # h5utils.check_file_exists(self.mb_file_name)
            with h5.File(self.mb_file_name, 'r') as mb_file_handle:
                self.mb_data_dict = h5utils.load_h5_in_dict(mb_file_handle)

            # Need to redefine strings to remove the "b" at the beginning
            for iconstraint in range(self.mb_data_dict['num_constraints']):
                self.mb_data_dict[
                    "constraint_%02d" %
                    iconstraint]['behaviour'] = self.mb_data_dict[
                        "constraint_%02d" % iconstraint]['behaviour'].decode()