Exemplo n.º 1
0
    def reset_all(self):

        title = "Remove all nodal loads from the structural model"
        message = "Do you really want to remove all nodal loads from the structural model?\n\n\n"
        message += "Press the Continue button to proceed with removal or press Cancel or Close buttons to abort the current operation."
        read = CallDoubleConfirmationInput(title,
                                           message,
                                           leftButton_label='Cancel',
                                           rightButton_label='Continue')

        if read._continue:
            self.basenames = []
            temp_list_nodes = self.preprocessor.nodes_with_nodal_loads.copy()
            self.nodes_typed = [
                node.external_index for node in temp_list_nodes
            ]

            key_strings = ["forces", "moments"]
            message = None
            remove_bc_from_file(self.nodes_typed, self.structural_bc_info_path,
                                key_strings, message)
            self.remove_all_table_files_from_nodes(self.nodes_typed)
            data = [self.list_Nones, self.list_Nones]
            self.preprocessor.set_structural_load_bc_by_node(
                self.nodes_typed, data)

            self.opv.updateRendererMesh()
            self.load_nodes_info()
            self.close()
    def check_reset(self):
        if len(self.preprocessor.nodes_with_radiation_impedance) > 0:

            title = f"Removal of all applied radiation impedances"
            message = "Do you really want to remove the radiation impedance(s) \napplied to the following node(s)?\n\n"
            for node in self.preprocessor.nodes_with_radiation_impedance:
                message += f"{node.external_index}\n"
            message += "\n\nPress the Continue button to proceed with the resetting or press Cancel or "
            message += "\nClose buttons to abort the current operation."
            read = CallDoubleConfirmationInput(title,
                                               message,
                                               leftButton_label='Cancel',
                                               rightButton_label='Continue')

            _nodes_with_radiation_impedance = self.preprocessor.nodes_with_radiation_impedance.copy(
            )
            if read._continue:
                for node in _nodes_with_radiation_impedance:
                    node_id = node.external_index
                    key_strings = ["radiation impedance"]
                    remove_bc_from_file([node_id], self.acoustic_bc_info_path,
                                        key_strings, None)
                    self.preprocessor.set_radiation_impedance_bc_by_node(
                        node_id, None)

                title = "Radiation impedance resetting process complete"
                message = "All radiation impedances applied to the acoustic\n"
                message += "model have been removed from the model."
                PrintMessageInput([title, message, window_title_2])

                self.opv.updateRendererMesh()
                self.close()
Exemplo n.º 3
0
    def reset_all(self):
        if len(self.preprocessor.nodes_with_compressor_excitation) > 0:
            title = f"Removal of all compressor excitations"
            message = "Do you really want to remove all compressor excitations \napplied to the following nodes?\n\n"
            for node in self.preprocessor.nodes_with_compressor_excitation:
                message += f"{node.external_index}\n"
            message += "\n\nPress the Continue button to proceed with the resetting or press Cancel or "
            message += "\nClose buttons to abort the current operation."
            read = CallDoubleConfirmationInput(title,
                                               message,
                                               leftButton_label='Cancel',
                                               rightButton_label='Continue')

            if read._doNotRun:
                return

            if read._continue:
                self.dict_node_to_compressor_excitation = self.project.file.get_dict_of_compressor_excitation_from_file(
                )
                for node_id in self.dict_node_to_compressor_excitation.keys():
                    self.remove_message = False
                    self.node_ID_remove = node_id
                    self.reset_node()
                self.node_ID_remove = None
                title = "Reset of compressor excitations"
                message = "All compressor excitations have been removed from the model."
                PrintMessageInput([title, message, window_title_2])
Exemplo n.º 4
0
    def confirm_and_generate_mesh(self):

        if self.check_element_size_input_value():
            return
        if self.check_geometry_tolerance_input_value():
            return

        if self.new_element_size > 0:
            if self.lineEdit_current_element_size.text(
            ) == self.lineEdit_new_element_size.text():
                title = "Same element size"
                message = "Please, you should to insert a different value at the "
                message += "'New element size' input field to update the model."
                PrintMessageInput([title, message, window_title_1])
                return
        else:
            self.print_error_message("element size", 'New element size')

        if self.geometry_tolerance > 0:
            pass
        else:
            self.print_error_message("geometry tolerance", 'Mesh tolerance')
        self.process_intermediate_actions()

        if len(self.dict_non_mapped_bcs) > 0:
            title = "Error while mapping boundary conditions"
            message = "The boundary conditions associated to the following nodal coordinates cannot be mapped directly after remesh:\n\n"
            for coord in list(self.dict_non_mapped_bcs.keys()):
                message += f"{coord};\n"
            message = message[:-2]
            message += ".\n\nPress the Return button if you want to change the element size and process remapping once, press the"
            message += "Remove button to remove unmapped boundary conditions or press Close button to abort the mesh operation."
            read = CallDoubleConfirmationInput(title,
                                               message,
                                               leftButton_label='Remove',
                                               rightButton_label='Return')

            if read._doNotRun:
                self.process_intermediate_actions(undo_remesh=True,
                                                  mapping=False)
            elif read._stop:
                self.process_final_actions()
                title = "Removal of unmapped boundary conditions"
                message = "The boundary conditions associated to the following nodal coordinates "
                message += "has been removed from the current model setup:\n\n"
                for coord in list(self.dict_non_mapped_bcs.keys()):
                    message += f"{coord};\n"
                message = message[:-2]
                message += ".\n\nPlease, take this information into account henceforward."
                PrintMessageInput([title, message, window_title_2])
            elif read._continue:
                self.process_intermediate_actions(undo_remesh=True,
                                                  mapping=False)
                return
        else:
            self.process_final_actions()
        self.project.time_to_load_or_create_project = time() - self.t0
        self.close()
Exemplo n.º 5
0
    def reset_list_projects(self):
        title = f"Resetting of the recent projects list"
        message = "Dear user, do you want to proceed with the 'Recent Projects' list clean-up and resetting?\n\n"
        message += "\n\nPress the Continue button to proceed with the resetting or press Cancel or "
        message += "\nClose buttons to abort the current operation."
        read = CallDoubleConfirmationInput(title, message, leftButton_label='Cancel', rightButton_label='Continue')
        
        if read._doNotRun:
            return

        if read._continue:
            self.config.resetRecentProjectList()
            self.initial_actions()
 def reset_all(self):
     title = "Remove all x-axis rotations attributed to the model"
     message = "Are you really sure you want to remove all x-axis rotations associated to beam elements?\n\n\n"
     message += "Press the Continue button to proceed with removal or press Cancel or Close buttons to abort the current operation."
     read = CallDoubleConfirmationInput(title, message, leftButton_label='Cancel', rightButton_label='Continue')
     if read._doNotRun:
         return
     if read._continue:
         if len(self.project.preprocessor.dict_beam_xaxis_rotating_angle_to_lines) > 0:
             for line in self.project.preprocessor.all_lines:
                 delta_angle = - self.project.preprocessor.dict_lines_to_rotation_angles[line]
                 self.project.set_beam_xaxis_rotation_by_line(line, delta_angle)
             self.project.preprocessor.dict_beam_xaxis_rotating_angle_to_lines.clear()
             self.project.preprocessor.create_dict_lines_to_rotation_angles()
             self.update_plots()
Exemplo n.º 7
0
    def closeEvent(self, event):
        title = "OpenPulse stop execution requested"
        message = "Do you really want to stop the OpenPulse processing and close \nthe current project setup?\n\n\n"
        message += "Note: The current project setup progress has already \nbeen saved in the project files."
        read = CallDoubleConfirmationInput(title,
                                           message,
                                           leftButton_label="No",
                                           rightButton_label="Yes")

        if read._stop:
            event.ignore()
            return

        if read._continue:
            sys.exit()
    def reset_fluid(self):
        title = f"Resetting of the current 'Fluid Composition'"
        message = "Do you really want to reset the current Fluid Composition?\n\n"

        message += "\n\nPress the Continue button to proceed with the resetting or press Cancel or "
        message += "\nClose buttons to abort the current operation."
        read = CallDoubleConfirmationInput(title,
                                           message,
                                           leftButton_label='Cancel',
                                           rightButton_label='Continue')

        if read._stop:
            return

        self.fluid_to_composition.clear()
        self.load_new_gas_composition_info()
        self.update_remainig_composition()
Exemplo n.º 9
0
    def check_reset(self):
        if len(self.preprocessor.nodes_with_acoustic_pressure) > 0:

            title = f"Resetting of all applied acoustic pressures"
            message = "Do you really want to remove the acoustic pressure(s) \napplied to the following node(s)?\n\n"
            for node in self.preprocessor.nodes_with_acoustic_pressure:
                message += f"{node.external_index}\n"
            message += "\n\nPress the Continue button to proceed with the resetting or press Cancel or "
            message += "\nClose buttons to abort the current operation."
            read = CallDoubleConfirmationInput(title,
                                               message,
                                               leftButton_label='Cancel',
                                               rightButton_label='Continue')

            if read._doNotRun:
                return

            _list_table_names = []
            _nodes_with_acoustic_pressure = self.preprocessor.nodes_with_acoustic_pressure.copy(
            )
            if read._continue:
                for node in _nodes_with_acoustic_pressure:
                    node_id = node.external_index
                    key_strings = ["acoustic pressure"]
                    table_name = node.acoustic_pressure_table_name
                    if table_name is not None:
                        if table_name not in _list_table_names:
                            _list_table_names.append(table_name)
                    remove_bc_from_file([node_id], self.acoustic_bc_info_path,
                                        key_strings, None)
                    self.preprocessor.set_acoustic_pressure_bc_by_node(
                        node_id, [None, None])
                self.process_table_file_removal(_list_table_names)

                title = "Acoustic pressure resetting process complete"
                message = "All acoustic pressures applied to the acoustic\n"
                message += "model have been removed from the model."
                PrintMessageInput([title, message, window_title_2])

                self.opv.updateRendererMesh()
                self.close()
Exemplo n.º 10
0
    def reset_library_to_default(self):

        title = "Resetting of materials library"
        message = "Do you really want to reset the material library to default values?\n\n\n"
        message += "Press the 'Proceed' button to proceed with resetting or press 'Cancel' or 'Close' buttons to abort the current operation."
        read = CallDoubleConfirmationInput(title,
                                           message,
                                           leftButton_label='Cancel',
                                           rightButton_label='Proceed')

        if read._doNotRun:
            return

        if read._continue:

            config_cache = configparser.ConfigParser()
            config_cache.read(self.material_path)
            sections_cache = config_cache.sections()

            default_material_library(self.material_path)
            config = configparser.ConfigParser()
            config.read(self.material_path)

            material_names = []
            for section_cache in sections_cache:
                if section_cache not in config.sections():
                    material_names.append(config_cache[section_cache]["name"])

            for line_id, entity in self.dict_tag_to_entity.items():
                if entity.material is not None:
                    if entity.material.name in material_names:
                        self.project.set_material_by_lines(line_id, None)

            self.treeWidget.clear()
            self.loadList()
            self.reset_add_texts()
            self.reset_edit_texts()
            self.reset_remove_texts()