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 check_remove_bc_from_node(self):

        self.check_input_nodes()
        key_strings = ["specific impedance"]
        message = "The specific impedance attributed to the {} node(s) have been removed.".format(self.nodes_typed)
        remove_bc_from_file(self.nodes_typed, self.acoustic_bc_info_path, key_strings, message)
        self.project.mesh.set_specific_impedance_bc_by_node(self.nodes_typed, None)
        self.transform_points(self.nodes_typed)
        self.close()
Exemplo n.º 4
0
 def _single_acoustic_excitation_bc(self, node_id, label):
     if label[0] == 'acoustic pressure':
         key_strings = ['volume velocity']
         remove_bc_from_file(node_id, self._nodeAcousticPath, key_strings,
                             None)
     elif label[0] == 'volume velocity':
         key_strings = ['acoustic pressure']
         remove_bc_from_file(node_id, self._nodeAcousticPath, key_strings,
                             None)
Exemplo n.º 5
0
 def _single_structural_excitation_bc(self, node_id, labels):
     if labels[0] == 'displacements' and labels[1] == 'rotations':
         key_strings = ['forces', 'moments']
         remove_bc_from_file(node_id, self._nodeStructuralPath, key_strings,
                             None)
     elif labels[0] == 'forces' and labels[1] == 'moments':
         key_strings = ['displacements', 'rotations']
         remove_bc_from_file(node_id, self._nodeStructuralPath, key_strings,
                             None)
Exemplo n.º 6
0
 def check_remove_bc_from_node(self):
     self.check_input_nodes()
     key_strings = ["displacements", "rotations"]
     message = "The prescribed dof(s) value(s) attributed to the {} node(s) have been removed.".format(
         self.nodes_typed)
     remove_bc_from_file(self.nodes_typed, self.structural_bc_info_path,
                         key_strings, message)
     self.project.mesh.set_prescribed_dofs_bc_by_node(
         self.nodes_typed, [None, None, None, None, None, None])
     self.transform_points(self.nodes_typed)
     self.close()
Exemplo n.º 7
0
    def check_remove_bc_from_node(self):

        self.check_input_nodes()
        key_strings = ["volume velocity"]
        message = "The volume velocity attributed to the {} node(s) have been removed.".format(
            self.nodes_typed)
        remove_bc_from_file(self.nodes_typed, self.acoustic_bc_info_path,
                            key_strings, message)
        self.project.mesh.set_volume_velocity_bc_by_node(
            self.nodes_typed, None)
        self.transform_points(self.nodes_typed)
        self.close()
Exemplo n.º 8
0
    def check_remove_bc_from_node(self):

        self.check_input_nodes()
        key_strings = ["forces", "moments"]
        message = "The nodal loads attributed to the {} node(s) have been removed.".format(
            self.nodes_typed)
        remove_bc_from_file(self.nodes_typed, self.structural_bc_info_path,
                            key_strings, message)
        self.project.mesh.set_structural_load_bc_by_node(
            self.nodes_typed, [None, None, None, None, None, None])
        self.transform_points(self.nodes_typed)
        self.close()
 def check_remove_bc_from_node(self):
     if self.lineEdit_nodeID.text() != "":
         picked_node_id = int(self.lineEdit_nodeID.text())
         node = self.preprocessor.nodes[picked_node_id]            
         if node in self.preprocessor.nodes_with_specific_impedance:
             key_strings = ["specific impedance"]
             message = f"The specific impedance attributed to the {picked_node_id} node \nhas been removed."
             remove_bc_from_file([picked_node_id], self.acoustic_bc_info_path, key_strings, message)
             list_table_names = self.get_list_table_names_from_selected_nodes([picked_node_id])
             self.process_table_file_removal(list_table_names)
             self.preprocessor.set_specific_impedance_bc_by_node(picked_node_id, [None, None])
             self.opv.updateRendererMesh()
             self.load_nodes_info()
Exemplo n.º 10
0
    def check_remove_bc_from_node(self):

        lineEdit_nodeID = self.lineEdit_nodeID.text()
        self.stop, self.nodes_typed = self.before_run.check_input_NodeID(
            lineEdit_nodeID)
        if self.stop:
            return

        key_strings = ["radiation impedance"]
        message = "The radiation impedance attributed to the {} node(s) have been removed.".format(
            self.nodes_typed)
        remove_bc_from_file(self.nodes_typed, self.acoustic_bc_info_path,
                            key_strings, message)
        self.preprocessor.set_radiation_impedance_bc_by_node(
            self.nodes_typed, None)
        self.opv.updateRendererMesh()
        self.load_nodes_info()
Exemplo n.º 11
0
    def check_remove_bc_from_node(self):
        
        self.basenames = []
        lineEdit_nodeID = self.lineEdit_nodeID.text()
        self.stop, self.nodes_typed = self.before_run.check_input_NodeID(lineEdit_nodeID)
        if self.stop:
            return

        key_strings = ["displacements", "rotations"]
        message = f"The prescribed dof(s) value(s) attributed to the {self.nodes_typed} node(s) \nhave been removed."

        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_prescribed_dofs_bc_by_node(self.nodes_typed, data)
        self.opv.updateRendererMesh()
        self.load_nodes_info()
        self.close()
Exemplo n.º 12
0
    def remove_function(self, key):
        section = key

        if self.log_removal:
            group_label = section.split(" || ")[1]
            message = f"The element length correction attributed to the {group_label}\n"
            message += "group of elements have been removed."
        else:
            message = None

        values = self.dict_group_elements[section]
        self.project.preprocessor.set_length_correction_by_element(
            values[1], None, section, delete_from_dict=True)
        key_strings = ["length correction type", "list of elements"]

        remove_bc_from_file([section], self.elements_info_path, key_strings,
                            message)
        self.load_elements_info()
        self.log_removal = True
Exemplo n.º 13
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.º 14
0
    def check_remove_bc_from_node(self):

        self.remove_mass = self.checkBox_remove_mass.isChecked()
        self.remove_spring = self.checkBox_remove_spring.isChecked()
        self.remove_damper = self.checkBox_remove_damper.isChecked()

        if self.check_input_nodes():
            return

        if self.remove_mass:
            key_strings = ["masses", "moments of inertia"]
            message = "The masses and moments of inertia attributed to the {} node(s) have been removed.".format(self.nodes_typed)
            remove_bc_from_file(self.nodes_typed, self.structural_bc_info_path, key_strings, message)
            self.project.mesh.add_mass_to_node(self.nodes_typed, [None, None, None, None, None, None])

        if self.remove_spring:
            key_strings = ["spring stiffness", "torsional spring stiffness"]
            message = "The stiffness (translational and tosional) attributed to the {} node(s) have been removed.".format(self.nodes_typed)
            remove_bc_from_file(self.nodes_typed, self.structural_bc_info_path, key_strings, message)
            self.project.mesh.add_spring_to_node(self.nodes_typed, [None, None, None, None, None, None])

        if self.remove_damper:
            key_strings = ["damping coefficients", "torsional damping coefficients"]
            message = "The dampings (translational and tosional) attributed to the {} node(s) have been removed.".format(self.nodes_typed)
            remove_bc_from_file(self.nodes_typed, self.structural_bc_info_path, key_strings, message)
            self.project.mesh.add_damper_to_node(self.nodes_typed, [None, None, None, None, None, None])

        self.close()
Exemplo n.º 15
0
    def remove_table(self):
        self.dict_node_to_compressor_excitation = self.project.file.get_dict_of_compressor_excitation_from_file(
        )
        self.selected_node = self.lineEdit_node_ID_info.text()
        self.selected_table = self.lineEdit_table_name_info.text()
        if self.selected_node == "":
            title = "EMPTY TABLE SELECTION"
            message = "You should to select a table from list before continue."
            PrintMessageInput([title, message, window_title_2])
            return

        else:

            node_id = int(self.selected_node)
            node = self.preprocessor.nodes[node_id]
            prefix = self.selected_table.split("_node")[0]
            str_table_index = prefix.split("table")[1]
            table_index = int(str_table_index)

            if table_index in node.compressor_excitation_table_indexes:
                node.compressor_excitation_table_indexes.remove(table_index)
            if table_index in node.dict_index_to_compressor_connection_info.keys(
            ):
                node.dict_index_to_compressor_connection_info.pop(table_index)
            for list_data in self.dict_node_to_compressor_excitation[node_id]:
                [str_key, table_name_file] = list_data
                if self.selected_table in table_name_file:
                    remove_bc_from_file([node_id], self.node_acoustic_path,
                                        [str_key], None)

            title = "Compressor excitation table removal finished"
            message = f"The following compressor excitation table attributed to \n"
            message += f"the {node_id} node has been removed from the model:\n\n"
            message += f"{self.selected_table}"
            PrintMessageInput([title, message, window_title_2])

            self.load_compressor_excitation_tables_info()
            self.reset_node_and_reload(node_id)