From 80ed4a9dd84047b9e8314ee5949e31af6630f755 Mon Sep 17 00:00:00 2001 From: Carine Khalil <79253004+CarineKhalil22@users.noreply.github.com> Date: Thu, 11 Nov 2021 15:12:41 +0100 Subject: [PATCH 1/4] Update staticAnalysisSettings.py --- .../staticAnalysisSettings.py | 1062 ++++++++--------- 1 file changed, 529 insertions(+), 533 deletions(-) diff --git a/RFEM/LoadCasesAndCombinations/staticAnalysisSettings.py b/RFEM/LoadCasesAndCombinations/staticAnalysisSettings.py index 507c08aa..0af6bb3d 100644 --- a/RFEM/LoadCasesAndCombinations/staticAnalysisSettings.py +++ b/RFEM/LoadCasesAndCombinations/staticAnalysisSettings.py @@ -45,588 +45,584 @@ def __init__(self, # Add Static Analysis Settings to client model clientModel.service.set_static_analysis_settings(clientObject) - # def GeometricallyLinear(self, - # no: int = 1, - # name: str = None, - # load_modification = [False, None, None], - # bourdon_effect: bool = True, - # nonsymmetric_direct_solver: bool = True, - # method_of_equation_system = StaticAnalysisSettingsMethodOfEquationSystem.METHOD_OF_EQUATION_SYSTEM_DIRECT, - # plate_bending_theory = StaticAnalysisSettingsPlateBendingTheory.PLATE_BENDING_THEORY_MINDLIN, - # mass_conversion = [False, None, None, None], - # comment: str = '', - # params: dict = {}): - - # ''' - # Args: - # no (int): - # name (str, optional): Static Analysis Name - # load_modification (list, optional): [loading_by_multiplier_factor, multiplier_factor, dividing_results] - # For loading_by_multiplier_factor == False: - # multiplier_factor = None - # dividing_results = None - # For loading_by_multiplier_factor == True: - # multiplier_factor = int - # dividing_results = bool - # bourdon_effect (bool, optional): - # nonsymmetric_direct_solver (bool, optional): - # method_of_equation_system (enum): Static Analysis Settings Method of Equation System Enumeration - # plate_bending_theory (enum): Static Analysis Settings Plate Bending Theory Enumeration - # mass_conversion (list, optional): [mass_conversion_enabled, mass_conversion_factor_in_direction_x, mass_conversion_factor_in_direction_y, mass_conversion_factor_in_direction_z] - # For mass_conversion_enabled == False: - # mass_conversion_factors = [None, None, None] - # For mass_conversion_enabled == True: - # mass_conversion_factors = [double, double, double] - # comment (str, optional): - # params (dict, optional): - # ''' - - # # Client model - # clientObject = clientModel.factory.create('ns0:static_analysis_settings') - - # # Clears object atributes | Sets all atributes to None - # clearAtributes(clientObject) - - # # Static Analysis Settings No. - # clientObject.no = no - - # # Name - # if name != None: - # clientObject.user_defined_name_enabled = True - # clientObject.name = name - - # # Static Analysis Type - # clientObject.analysis_type = StaticAnalysisType.GEOMETRICALLY_LINEAR.name - - # # Load Modification - - # clientObject.modify_loading_by_multiplier_factor = load_modification[0] - # clientObject.number_of_iterations_for_loading_prestress = load_modification[1] - # clientObject.divide_results_by_loading_factor = load_modification[2] - - # clientObject.modify_loading_by_multiplier_factor = loading_by_multiplier_factor - # clientObject.number_of_iterations_for_loading_prestress = multiplier_factor - # clientObject.divide_results_by_loading_factor = dividing_results - - # if loading_by_multiplier_factor != False: - # loading_by_multiplier_factor = True - # multiplier_factor = int - # dividing_results = bool - - # if len(load_modification) != 3: - # raise Exception('WARNING: The load modification parameter needs to be of length 3. Kindly check list inputs for completeness and correctness.') + def GeometricallyLinear(self, + no: int = 1, + name: str = None, + load_modification = [False, None, None], + bourdon_effect: bool = True, + nonsymmetric_direct_solver: bool = True, + method_of_equation_system = StaticAnalysisSettingsMethodOfEquationSystem.METHOD_OF_EQUATION_SYSTEM_DIRECT, + plate_bending_theory = StaticAnalysisSettingsPlateBendingTheory.PLATE_BENDING_THEORY_MINDLIN, + mass_conversion = [False, None, None, None], + comment: str = '', + params: dict = {}): + + """ + Args: + no (int): + name (str, optional): Static Analysis Name + load_modification (list, optional): [loading_by_multiplier_factor, multiplier_factor, dividing_results] + For loading_by_multiplier_factor == False: + multiplier_factor = None + dividing_results = None + For loading_by_multiplier_factor == True: + multiplier_factor = int + dividing_results = bool + bourdon_effect (bool, optional): + nonsymmetric_direct_solver (bool, optional): + method_of_equation_system (enum): Static Analysis Settings Method of Equation System Enumeration + plate_bending_theory (enum): Static Analysis Settings Plate Bending Theory Enumeration + mass_conversion (list, optional): [mass_conversion_enabled, mass_conversion_factor_in_direction_x, mass_conversion_factor_in_direction_y, mass_conversion_factor_in_direction_z] + For mass_conversion_enabled == False: + mass_conversion_factors = [None, None, None] + For mass_conversion_enabled == True: + mass_conversion_factors = [double, double, double] + comment (str, optional): + params (dict, optional): + """ + + # Client model + clientObject = clientModel.factory.create('ns0:static_analysis_settings') + + # Clears object atributes | Sets all atributes to None + clearAtributes(clientObject) + + # Static Analysis Settings No. + clientObject.no = no + + # Name + if name != None: + clientObject.user_defined_name_enabled = True + clientObject.name = name + + # Static Analysis Type + clientObject.analysis_type = StaticAnalysisType.GEOMETRICALLY_LINEAR.name + + # Load Modification + clientObject.modify_loading_by_multiplier_factor = loading_by_multiplier_factor + clientObject.number_of_iterations_for_loading_prestress = multiplier_factor + clientObject.divide_results_by_loading_factor = dividing_results + + clientObject.modify_loading_by_multiplier_factor = load_modification[0] + clientObject.number_of_iterations_for_loading_prestress = load_modification[1] + clientObject.divide_results_by_loading_factor = load_modification[2] + + if loading_by_multiplier_factor != False: + loading_by_multiplier_factor = True + multiplier_factor = int + dividing_results = bool + + if len(load_modification) != 3: + raise Exception('WARNING: The load modification parameter needs to be of length 3. Kindly check list inputs for completeness and correctness.') - # if type(load_modification[0]) != bool : - # raise Exception ('WARNING: Load multiplier factor parameter at index 0 to be of type "int"') - # if type(load_modification[1]) != int : - # raise Exception ('WARNING: Multiplier factor parameter at index 1 to be of type "int"') - # if type(load_modification[2]) != bool : - # raise Exception ('WARNING: Dividing results parameter at index 0 to be of type "int"') - - # if loading_by_multiplier_factor != False: - # loading_by_multiplier_factor = True - # multiplier_factor = int - # dividing_results = bool + if type(load_modification[0]) != bool : + raise Exception ('WARNING: Load multiplier factor parameter at index 0 to be of type "int"') + if type(load_modification[1]) != int : + raise Exception ('WARNING: Multiplier factor parameter at index 1 to be of type "int"') + if type(load_modification[2]) != bool : + raise Exception ('WARNING: Dividing results parameter at index 0 to be of type "int"') + + if loading_by_multiplier_factor != False: + loading_by_multiplier_factor = True + multiplier_factor = int + dividing_results = bool - # # Bourdon Effect Displacement - # clientObject.displacements_due_to_bourdon_effect = bourdon_effect - - # # Nonsymetric Direct Solver - # clientObject.nonsymmetric_direct_solver = nonsymmetric_direct_solver - - # # Equation System - # clientObject.method_of_equation_system = method_of_equation_system.name - - # # Plate Bending Theory - # clientObject.plate_bending_theory = plate_bending_theory.name - - # # Mass Conversion - # clientObject.mass_conversion_enabled = mass_conversion_enabled - # clientObject.mass_conversion_factor_in_direction_x = mass_conversion_factor_in_direction_x - # clientObject.mass_conversion_factor_in_direction_y = mass_conversion_factor_in_direction_y - # clientObject.mass_conversion_factor_in_direction_z = mass_conversion_factor_in_direction_z - - # mass_conversion_enabled = mass_conversion[0] - # mass_conversion_factor_in_direction_x = mass_conversion[1] - # mass_conversion_factor_in_direction_y = mass_conversion[2] - # mass_conversion_factor_in_direction_z = mass_conversion[3] - # if mass_conversion_enabled != False: - # mass_conversion_factor_in_direction_x = float - # mass_conversion_acceleration_in_direction_y = float - # mass_conversion_acceleration_in_direction_z = float + # Bourdon Effect Displacement + clientObject.displacements_due_to_bourdon_effect = bourdon_effect + + # Nonsymetric Direct Solver + clientObject.nonsymmetric_direct_solver = nonsymmetric_direct_solver + + # Equation System + clientObject.method_of_equation_system = method_of_equation_system.name + + # Plate Bending Theory + clientObject.plate_bending_theory = plate_bending_theory.name + + # Mass Conversion + clientObject.mass_conversion_enabled = mass_conversion_enabled + clientObject.mass_conversion_factor_in_direction_x = mass_conversion_factor_in_direction_x + clientObject.mass_conversion_factor_in_direction_y = mass_conversion_factor_in_direction_y + clientObject.mass_conversion_factor_in_direction_z = mass_conversion_factor_in_direction_z + + mass_conversion_enabled = mass_conversion[0] + mass_conversion_factor_in_direction_x = mass_conversion[1] + mass_conversion_factor_in_direction_y = mass_conversion[2] + mass_conversion_factor_in_direction_z = mass_conversion[3] + if mass_conversion_enabled != False: + mass_conversion_factor_in_direction_x = float + mass_conversion_acceleration_in_direction_y = float + mass_conversion_acceleration_in_direction_z = float - # if len(mass_conversion) != 4: - # raise Exception('WARNING: The mass conversion parameter needs to be of length 4. Kindly check list inputs for completeness and correctness.') + if len(mass_conversion) != 4: + raise Exception('WARNING: The mass conversion parameter needs to be of length 4. Kindly check list inputs for completeness and correctness.') - # if type(mass_conversion[0]) != bool : - # raise Exception ('WARNING: Enabling the mass conversion at index 0 has to be of type "bool"') - # if type(mass_conversion[1]) != float or type(mass_conversion[1]) != int: - # raise Exception ('WARNING: Mass conversion factor in direction x at index 1 has to be of type "float" or "int"') - # if type(mass_conversion[2]) != float or type(mass_conversion[2]) != int: - # raise Exception ('WARNING: Mass conversion factor in direction y at index 2 has to be of type "float" or "int"') - # if type(mass_conversion[3]) != float or type(mass_conversion[3]) != int : - # raise Exception ('WARNING: Mass conversion factor in direction z at index 3 has to be of type "float" or "int"') + if type(mass_conversion[0]) != bool : + raise Exception ('WARNING: Enabling the mass conversion at index 0 has to be of type "bool"') + if type(mass_conversion[1]) != float or type(mass_conversion[1]) != int: + raise Exception ('WARNING: Mass conversion factor in direction x at index 1 has to be of type "float" or "int"') + if type(mass_conversion[2]) != float or type(mass_conversion[2]) != int: + raise Exception ('WARNING: Mass conversion factor in direction y at index 2 has to be of type "float" or "int"') + if type(mass_conversion[3]) != float or type(mass_conversion[3]) != int : + raise Exception ('WARNING: Mass conversion factor in direction z at index 3 has to be of type "float" or "int"') - # # Comment - # clientObject.comment = comment - - # # Adding optional parameters via dictionary - # for key in params: - # clientObject[key] = params[key] - - # # Add Static Analysis Settings to client model - # clientModel.service.set_static_analysis_settings(clientObject) - - # def LargeDeformation(self, - # no: int = 1, - # name: str = None, - # iterative_method = StaticAnalysisSettingsIterativeMethodForNonlinearAnalysis.NEWTON_RAPHSON, - # standard_precision_and_tolerance_settings = [False, None, None, None], - # control_nonlinear_analysis = [100, 1], - # load_modification = [False, None, None], - # instabil_structure_calculation : bool = True, - # bourdon_effect: bool = True, - # nonsymmetric_direct_solver: bool = True, - # method_of_equation_system = StaticAnalysisSettingsMethodOfEquationSystem.METHOD_OF_EQUATION_SYSTEM_DIRECT, - # plate_bending_theory = StaticAnalysisSettingsPlateBendingTheory.PLATE_BENDING_THEORY_MINDLIN, - # mass_conversion = [False, None, None, None], - # comment: str = '', - # params: dict = {}): - # ''' - # Args: - # no (int): - # name (str, optional): Static Analysis Name - # iterative_method (enum): Static Analysis Settings Iterative Method for Non-linear Analysis Enumeration - # For iterative_method == "NEWTON_RAPHSON" or iterative_method.name == "NEWTON_RAPHSON_COMBINED_WITH_PICARD" or iterative_method.name == "PICARD" or iterative_method.name == "NEWTON_RAPHSON_WITH_POSTCRITICAL_ANALYSIS" - # max_number_of_iterations = int - # number_of_load_increments = int - # For iterative_method == "DYNAMIC_RELAXATION": - # max_number_of_iterations = None - # number_of_load_increments = None - # standard_precision_and_tolerance_settings (list, optional): [standard_precision_and_tolerance_settings_enabled, precision_of_convergence_criteria_for_nonlinear_calculation, tolerance_for_detection_of_instability, robustness_of_iterative_calculation] - # control_nonlinear_analysis (list): [max_number_of_iterations, number_of_load_increments] - # load_modification (list, optional): [loading_by_multiplier_factor, multiplier_factor, dividing_results] - # For loading_by_multiplier_factor == False: - # multiplier_factor = None - # dividing_results = None - # For loading_by_multiplier_factor == True: - # multiplier_factor = int - # dividing_results = bool - # instabil_structure_calculation (bool, optional): - # bourdon_effect (bool, optional): - # nonsymmetric_direct_solver (bool, optional): - # method_of_equation_system (enum): Static Analysis Settings Method of Equation System Enumeration - # plate_bending_theory (enum): Static Analysis Settings Plate Bending Theory Enumeration - # mass_conversion (list, optional): [mass_conversion_enabled, mass_conversion_factor_in_direction_x, mass_conversion_factor_in_direction_y, mass_conversion_factor_in_direction_z] - # For mass_conversion_enabled == False: - # mass_conversion_factors = [None, None, None] - # For mass_conversion_enabled == True: - # mass_conversion_factors = [double, double, double] - # comment (str, optional): - # params (dict, optional): - # ''' + # Comment + clientObject.comment = comment + + # Adding optional parameters via dictionary + for key in params: + clientObject[key] = params[key] + + # Add Static Analysis Settings to client model + clientModel.service.set_static_analysis_settings(clientObject) + + def LargeDeformation(self, + no: int = 1, + name: str = None, + iterative_method = StaticAnalysisSettingsIterativeMethodForNonlinearAnalysis.NEWTON_RAPHSON, + standard_precision_and_tolerance_settings = [False, None, None, None], + control_nonlinear_analysis = [100, 1], + load_modification = [False, None, None], + instabil_structure_calculation : bool = True, + bourdon_effect: bool = True, + nonsymmetric_direct_solver: bool = True, + method_of_equation_system = StaticAnalysisSettingsMethodOfEquationSystem.METHOD_OF_EQUATION_SYSTEM_DIRECT, + plate_bending_theory = StaticAnalysisSettingsPlateBendingTheory.PLATE_BENDING_THEORY_MINDLIN, + mass_conversion = [False, None, None, None], + comment: str = '', + params: dict = {}): + + """ + Args: + no (int): + name (str, optional): Static Analysis Name + iterative_method (enum): Static Analysis Settings Iterative Method for Non-linear Analysis Enumeration + For iterative_method == "NEWTON_RAPHSON" or iterative_method.name == "NEWTON_RAPHSON_COMBINED_WITH_PICARD" or iterative_method.name == "PICARD" or iterative_method.name == "NEWTON_RAPHSON_WITH_POSTCRITICAL_ANALYSIS" + max_number_of_iterations = int + number_of_load_increments = int + For iterative_method == "DYNAMIC_RELAXATION": + max_number_of_iterations = None + number_of_load_increments = None + standard_precision_and_tolerance_settings (list, optional): [standard_precision_and_tolerance_settings_enabled, precision_of_convergence_criteria_for_nonlinear_calculation, tolerance_for_detection_of_instability, robustness_of_iterative_calculation] + control_nonlinear_analysis (list): [max_number_of_iterations, number_of_load_increments] + load_modification (list, optional): [loading_by_multiplier_factor, multiplier_factor, dividing_results] + For loading_by_multiplier_factor == False: + multiplier_factor = None + dividing_results = None + For loading_by_multiplier_factor == True: + multiplier_factor = int + dividing_results = bool + instabil_structure_calculation (bool, optional): + bourdon_effect (bool, optional): + nonsymmetric_direct_solver (bool, optional): + method_of_equation_system (enum): Static Analysis Settings Method of Equation System Enumeration + plate_bending_theory (enum): Static Analysis Settings Plate Bending Theory Enumeration + mass_conversion (list, optional): [mass_conversion_enabled, mass_conversion_factor_in_direction_x, mass_conversion_factor_in_direction_y, mass_conversion_factor_in_direction_z] + For mass_conversion_enabled == False: + mass_conversion_factors = [None, None, None] + For mass_conversion_enabled == True: + mass_conversion_factors = [double, double, double] + comment (str, optional): + params (dict, optional): + """ - # # Client model - # clientObject = clientModel.factory.create('ns0:static_analysis_settings') - - # # Clears object atributes | Sets all atributes to None - # clearAtributes(clientObject) - - # # Static Analysis Settings No. - # clientObject.no = no - - # # Name - # if name != None: - # clientObject.user_defined_name_enabled = True - # clientObject.name = name - - # # Static Analysis Type - # clientObject.analysis_type = StaticAnalysisType.LARGE_DEFORMATIONS.name - - # # Iterative Method - # clientObject.iterative_method_for_nonlinear_analysis = iterative_method.name - # if iterative_method.name == "NEWTON_RAPHSON" or iterative_method.name == "NEWTON_RAPHSON_COMBINED_WITH_PICARD" or iterative_method.name == "PICARD" or iterative_method.name == "NEWTON_RAPHSON_WITH_POSTCRITICAL_ANALYSIS": - # max_number_of_iterations = int - # number_of_load_increments = int - # elif iterative_method.name == "DYNAMIC_RELAXATION": - # max_number_of_iterations = None - # number_of_load_increments = None - - # # Standard Precision and Tolerance - - # clientObject.standard_precision_and_tolerance_settings_enabled = standard_precision_and_tolerance_settings[0] - # clientObject.precision_of_convergence_criteria_for_nonlinear_calculation = standard_precision_and_tolerance_settings[1] - # clientObject.instability_detection_tolerance = standard_precision_and_tolerance_settings[2] - # clientObject.iterative_calculation_robustness = standard_precision_and_tolerance_settings[3] - - # clientObject.standard_precision_and_tolerance_settings_enabled = standard_precision_and_tolerance_settings_enabled - # clientObject.precision_of_convergence_criteria_for_nonlinear_calculation = precision_of_convergence_criteria_for_nonlinear_calculation - # clientObject.instability_detection_tolerance = tolerance_for_detection_of_instability - # clientObject.iterative_calculation_robustness = robustness_of_iterative_calculation - - # if standard_precision_and_tolerance_settings_enabled != False: - # clientObject.precision_of_convergence_criteria_for_nonlinear_calculation = float - # clientObject.instability_detection_tolerance = float - # clientObject.iterative_calculation_robustness = float - - # if len(mass_conversion) != 4: - # raise Exception('WARNING: The standard precision and tolerance settings parameter needs to be of length 4. Kindly check list inputs for completeness and correctness.') - - # if type(standard_precision_and_tolerance_settings[0]) != bool : - # raise Exception ('WARNING: Enabling the standard precision and tolerance settings at index 0 to be of type "bool"') - # if type(standard_precision_and_tolerance_settings[1]) != float or type(standard_precision_and_tolerance_settings[1]) != int: - # raise Exception ('WARNING: Precision of convergence criteria for nonlinear calculation factor at index 1 to be of type "float" or "int"') - # if type(standard_precision_and_tolerance_settings[2]) != float or type(standard_precision_and_tolerance_settings[2]) != int: - # raise Exception ('WARNING: Tolerance for detection of instability factor at index 2 to be of type "float" or "int"') - # if type(standard_precision_and_tolerance_settings[3]) != float or type(standard_precision_and_tolerance_settings[3]) != int: - # raise Exception ('WARNING: Robustness of iterative calculation factor at index 3 to be of type "float" or "int"') - - # while not float(precision_of_convergence_criteria_for_nonlinear_calculation) or not int(precision_of_convergence_criteria_for_nonlinear_calculation) in range(0.01,100): - # raise Exception ('WARNING: Precision of convergence criteria for nonlinear calculations at index 1 is out of range. Input has to be in the range [0.01 ... 100].') - - # while not float(tolerance_for_detection_of_instability) or not int(tolerance_for_detection_of_instability) in range(0.01,100): - # raise Exception ('WARNING: Tolerance for detection of instability at index 2 is out of range. Input has to be in the range [0.01 ... 100].') - - # while not float(robustness_of_iterative_calculation) or not int(robustness_of_iterative_calculation) in range(1.00,100): - # raise Exception ('WARNING: Robustness of iterative calculation at index 3 is out of range. Input has to be in the range [1.00 ... 100].') - + # Client model + clientObject = clientModel.factory.create('ns0:static_analysis_settings') - # # Control nonlinear Analysis - # clientObject.max_number_of_iterations = control_nonlinear_analysis[0] - # clientObject.number_of_load_increments = control_nonlinear_analysis[1] - - # clientObject.max_number_of_iterations = max_number_of_iterations - # clientObject.number_of_load_increments = number_of_load_increments - - # if len(control_nonlinear_analysis) != 2: - # raise Exception('WARNING: The nonlinear analysis control parameter needs to be of length 2. Kindly check list inputs for completeness and correctness.') - - # if type(control_nonlinear_analysis[0]) != int : - # raise Exception ('WARNING: Enabling the standard precision and tolerance settings at index 0 has to be of type "int"') - # if type(control_nonlinear_analysis[1]) != int : - # raise Exception ('WARNING: Precision of convergence criteria for nonlinear calculation factor at index 1 has to be of type "int"') + # Clears object atributes | Sets all atributes to None + clearAtributes(clientObject) - # # Load Modification - - # clientObject.modify_loading_by_multiplier_factor = load_modification[0] - # clientObject.number_of_iterations_for_loading_prestress = load_modification[1] - # clientObject.divide_results_by_loading_factor = load_modification[2] - - # clientObject.modify_loading_by_multiplier_factor = loading_by_multiplier_factor - # clientObject.number_of_iterations_for_loading_prestress = multiplier_factor - # clientObject.divide_results_by_loading_factor = dividing_results - - # if loading_by_multiplier_factor != False: - # loading_by_multiplier_factor = True - # multiplier_factor = int - # dividing_results = bool + # Static Analysis Settings No. + clientObject.no = no + + # Name + if name != None: + clientObject.user_defined_name_enabled = True + clientObject.name = name + + # Static Analysis Type + clientObject.analysis_type = StaticAnalysisType.LARGE_DEFORMATIONS.name + + # Iterative Method + clientObject.iterative_method_for_nonlinear_analysis = iterative_method.name + if iterative_method.name == "NEWTON_RAPHSON" or iterative_method.name == "NEWTON_RAPHSON_COMBINED_WITH_PICARD" or iterative_method.name == "PICARD" or iterative_method.name == "NEWTON_RAPHSON_WITH_POSTCRITICAL_ANALYSIS": + max_number_of_iterations = int + number_of_load_increments = int + elif iterative_method.name == "DYNAMIC_RELAXATION": + max_number_of_iterations = None + number_of_load_increments = None + + # Standard Precision and Tolerance + + clientObject.standard_precision_and_tolerance_settings_enabled = standard_precision_and_tolerance_settings_enabled + clientObject.precision_of_convergence_criteria_for_nonlinear_calculation = precision_of_convergence_criteria_for_nonlinear_calculation + clientObject.instability_detection_tolerance = tolerance_for_detection_of_instability + clientObject.iterative_calculation_robustness = robustness_of_iterative_calculation + + clientObject.standard_precision_and_tolerance_settings_enabled = standard_precision_and_tolerance_settings[0] + clientObject.precision_of_convergence_criteria_for_nonlinear_calculation = standard_precision_and_tolerance_settings[1] + clientObject.instability_detection_tolerance = standard_precision_and_tolerance_settings[2] + clientObject.iterative_calculation_robustness = standard_precision_and_tolerance_settings[3] + + if standard_precision_and_tolerance_settings_enabled != False: + clientObject.precision_of_convergence_criteria_for_nonlinear_calculation = float + clientObject.instability_detection_tolerance = float + clientObject.iterative_calculation_robustness = float - # if len(load_modification) != 3: - # raise Exception('WARNING: The load modification parameter needs to be of length 3. Kindly check list inputs for completeness and correctness.') + if len(mass_conversion) != 4: + raise Exception('WARNING: The standard precision and tolerance settings parameter needs to be of length 4. Kindly check list inputs for completeness and correctness.') + + if type(standard_precision_and_tolerance_settings[0]) != bool : + raise Exception ('WARNING: Enabling the standard precision and tolerance settings at index 0 to be of type "bool"') + if type(standard_precision_and_tolerance_settings[1]) != float or type(standard_precision_and_tolerance_settings[1]) != int: + raise Exception ('WARNING: Precision of convergence criteria for nonlinear calculation factor at index 1 to be of type "float" or "int"') + if type(standard_precision_and_tolerance_settings[2]) != float or type(standard_precision_and_tolerance_settings[2]) != int: + raise Exception ('WARNING: Tolerance for detection of instability factor at index 2 to be of type "float" or "int"') + if type(standard_precision_and_tolerance_settings[3]) != float or type(standard_precision_and_tolerance_settings[3]) != int: + raise Exception ('WARNING: Robustness of iterative calculation factor at index 3 to be of type "float" or "int"') + + while not float(precision_of_convergence_criteria_for_nonlinear_calculation) or not int(precision_of_convergence_criteria_for_nonlinear_calculation) in range(0.01,100): + raise Exception ('WARNING: Precision of convergence criteria for nonlinear calculations at index 1 is out of range. Input has to be in the range [0.01 ... 100].') + + while not float(tolerance_for_detection_of_instability) or not int(tolerance_for_detection_of_instability) in range(0.01,100): + raise Exception ('WARNING: Tolerance for detection of instability at index 2 is out of range. Input has to be in the range [0.01 ... 100].') + + while not float(robustness_of_iterative_calculation) or not int(robustness_of_iterative_calculation) in range(1.00,100): + raise Exception ('WARNING: Robustness of iterative calculation at index 3 is out of range. Input has to be in the range [1.00 ... 100].') + + + # Control nonlinear Analysis + clientObject.max_number_of_iterations = control_nonlinear_analysis[0] + clientObject.number_of_load_increments = control_nonlinear_analysis[1] + + clientObject.max_number_of_iterations = max_number_of_iterations + clientObject.number_of_load_increments = number_of_load_increments + + if len(control_nonlinear_analysis) != 2: + raise Exception('WARNING: The nonlinear analysis control parameter needs to be of length 2. Kindly check list inputs for completeness and correctness.') + + if type(control_nonlinear_analysis[0]) != int : + raise Exception ('WARNING: Enabling the standard precision and tolerance settings at index 0 has to be of type "int"') + if type(control_nonlinear_analysis[1]) != int : + raise Exception ('WARNING: Precision of convergence criteria for nonlinear calculation factor at index 1 has to be of type "int"') + + # Load Modification + + clientObject.modify_loading_by_multiplier_factor = loading_by_multiplier_factor + clientObject.number_of_iterations_for_loading_prestress = multiplier_factor + clientObject.divide_results_by_loading_factor = dividing_results + + clientObject.modify_loading_by_multiplier_factor = load_modification[0] + clientObject.number_of_iterations_for_loading_prestress = load_modification[1] + clientObject.divide_results_by_loading_factor = load_modification[2] + + if loading_by_multiplier_factor != False: + loading_by_multiplier_factor = True + multiplier_factor = int + dividing_results = bool - # if type(load_modification[0]) != bool : - # raise Exception ('WARNING: Load multiplier factor parameter at index 0 has to be of type "int"') - # if type(load_modification[1]) != int : - # raise Exception ('WARNING: Multiplier factor parameter at index 1 has to be of type "int"') - # if type(load_modification[2]) != bool : - # raise Exception ('WARNING: Dividing results parameter at index 0 has to be of type "int"') - - # if loading_by_multiplier_factor != False: - # loading_by_multiplier_factor = True - # multiplier_factor = int - # dividing_results = bool - - - # # Instabil Structure - # clientObject.try_to_calculate_instabil_structure = instabil_structure_calculation - - # # Bourdon Effect Displacement - # clientObject.displacements_due_to_bourdon_effect = bourdon_effect - - # # Nonsymetric Direct Solver - # clientObject.nonsymmetric_direct_solver = nonsymmetric_direct_solver - - # # Equation System - # clientObject.method_of_equation_system = method_of_equation_system.name - - # # Plate Bending Theory - # clientObject.plate_bending_theory = plate_bending_theory.name - - # # Mass Conversion - # clientObject.mass_conversion_enabled = mass_conversion_enabled - # clientObject.mass_conversion_factor_in_direction_x = mass_conversion_factor_in_direction_x - # clientObject.mass_conversion_factor_in_direction_y = mass_conversion_factor_in_direction_y - # clientObject.mass_conversion_factor_in_direction_z = mass_conversion_factor_in_direction_z - - # mass_conversion_enabled = mass_conversion[0] - # mass_conversion_factor_in_direction_x = mass_conversion[1] - # mass_conversion_factor_in_direction_y = mass_conversion[2] - # mass_conversion_factor_in_direction_z = mass_conversion[3] - # if mass_conversion_enabled != False: - # mass_conversion_factor_in_direction_x = float - # mass_conversion_acceleration_in_direction_y = float - # mass_conversion_acceleration_in_direction_z = float + if len(load_modification) != 3: + raise Exception('WARNING: The load modification parameter needs to be of length 3. Kindly check list inputs for completeness and correctness.') - # if len(mass_conversion) != 4: - # raise Exception('WARNING: The mass conversion parameter needs to be of length 4. Kindly check list inputs for completeness and correctness.') + if type(load_modification[0]) != bool : + raise Exception ('WARNING: Load multiplier factor parameter at index 0 has to be of type "int"') + if type(load_modification[1]) != int : + raise Exception ('WARNING: Multiplier factor parameter at index 1 has to be of type "int"') + if type(load_modification[2]) != bool : + raise Exception ('WARNING: Dividing results parameter at index 0 has to be of type "int"') + + if loading_by_multiplier_factor != False: + loading_by_multiplier_factor = True + multiplier_factor = int + dividing_results = bool + + # Instabil Structure + clientObject.try_to_calculate_instabil_structure = instabil_structure_calculation + + # Bourdon Effect Displacement + clientObject.displacements_due_to_bourdon_effect = bourdon_effect + + # Nonsymetric Direct Solver + clientObject.nonsymmetric_direct_solver = nonsymmetric_direct_solver + + # Equation System + clientObject.method_of_equation_system = method_of_equation_system.name + + # Plate Bending Theory + clientObject.plate_bending_theory = plate_bending_theory.name + + # Mass Conversion + clientObject.mass_conversion_enabled = mass_conversion_enabled + clientObject.mass_conversion_factor_in_direction_x = mass_conversion_factor_in_direction_x + clientObject.mass_conversion_factor_in_direction_y = mass_conversion_factor_in_direction_y + clientObject.mass_conversion_factor_in_direction_z = mass_conversion_factor_in_direction_z + + mass_conversion_enabled = mass_conversion[0] + mass_conversion_factor_in_direction_x = mass_conversion[1] + mass_conversion_factor_in_direction_y = mass_conversion[2] + mass_conversion_factor_in_direction_z = mass_conversion[3] + if mass_conversion_enabled != False: + mass_conversion_factor_in_direction_x = float + mass_conversion_acceleration_in_direction_y = float + mass_conversion_acceleration_in_direction_z = float - # if type(mass_conversion[0]) != bool : - # raise Exception ('WARNING: Enabling the mass conversion at index 0 has to be of type "bool"') - # if type(mass_conversion[1]) != float or type(mass_conversion[1]) != int : - # raise Exception ('WARNING: Mass conversion factor in direction x at index 1 has to be of type "float" or "int"') - # if type(mass_conversion[2]) != float or type(mass_conversion[1]) != int : - # raise Exception ('WARNING: Mass conversion factor in direction y at index 2 has to be of type "float" or "int"') - # if type(mass_conversion[3]) != float or type(mass_conversion[1]) != int : - # raise Exception ('WARNING: Mass conversion factor in direction z at index 3 has to be of type "float" or "int"') - - # # Comment - # clientObject.comment = comment - - # # Adding optional parameters via dictionary - # for key in params: - # clientObject[key] = params[key] - - # # Add Static Analysis Settings to client model - # clientModel.service.set_static_analysis_settings(clientObject) - - # def SecondOrderPDelta (self, - # no: int = 1, - # name: str = None, - # iterative_method = StaticAnalysisSettingsIterativeMethodForNonlinearAnalysis.NEWTON_RAPHSON, - # standard_precision_and_tolerance_settings = [False, None, None, None], - # control_nonlinear_analysis = [100, 1], - # load_modification = [False, None, None], - # favorable_effect_due_to_tension_in_members : bool = False, - # bourdon_effect: bool = True, - # nonsymmetric_direct_solver: bool = True, - # internal_forces_to_deformed_structure = [False, None, None, None], - # method_of_equation_system = StaticAnalysisSettingsMethodOfEquationSystem.METHOD_OF_EQUATION_SYSTEM_DIRECT, - # plate_bending_theory = StaticAnalysisSettingsPlateBendingTheory.PLATE_BENDING_THEORY_MINDLIN, - # mass_conversion = [False, None, None, None], - # comment: str = '', - # params: dict = {}): + if len(mass_conversion) != 4: + raise Exception('WARNING: The mass conversion parameter needs to be of length 4. Kindly check list inputs for completeness and correctness.') - # ''' - # Args: - # no (int): - # name (str, optional): Static Analysis Name - # iterative_method (enum): Static Analysis Settings Iterative Method for Non-linear Analysis Enumeration - # standard_precision_and_tolerance_settings (list, optional): [standard_precision_and_tolerance_settings_enabled, precision_of_convergence_criteria_for_nonlinear_calculation, tolerance_for_detection_of_instability, robustness_of_iterative_calculation] - # control_nonlinear_analysis (list): [max_number_of_iterations, number_of_load_increments] - # loading_by_multiplier_factor (bool, optional): - # For loading_by_multiplier_factor == False: - # multiplier_factor = None - # dividing_results = None - # For loading_by_multiplier_factor == True: - # multiplier_factor = int - # dividing_results = bool - # favorable_effect_due_to_tension_in_members (bool, optional): - # bourdon_effect (bool, optional): - # nonsymmetric_direct_solver (bool, optional): - # internal_forces_to_deformed_structure (list, optional): [refer_internal_forces_to_deformed_structure, internal_forces_to_deformed_structure_for_moments, internal_forces_to_deformed_structure_for_normal_forces, internal_forces_to_deformed_structure_for_shear_forces] - # For refer_internal_forces_to_deformed_structure == False: - # internal_forces_to_deformed_structure_for_moments = None - # internal_forces_to_deformed_structure_for_normal_forces = None - # internal_forces_to_deformed_structure_for_shear_forces = None - # For refer_internal_forces_to_deformed_structure == True: - # internal_forces_to_deformed_structure_for_moments = bool - # internal_forces_to_deformed_structure_for_normal_forces = bool - # internal_forces_to_deformed_structure_for_shear_forces = bool - # method_of_equation_system (enum): Static Analysis Settings Method of Equation System Enumeration - # plate_bending_theory (enum): Static Analysis Settings Plate Bending Theory Enumeration - # mass_conversion (list, optional): [mass_conversion_enabled, mass_conversion_factor_in_direction_x, mass_conversion_factor_in_direction_y, mass_conversion_factor_in_direction_z] - # For mass_conversion_enabled == False: - # mass_conversion_factors = [None, None, None] - # For mass_conversion_enabled == True: - # mass_conversion_factors = [double, double, double] - # comment (str, optional): - # params (dict, optional): - # ''' + if type(mass_conversion[0]) != bool : + raise Exception ('WARNING: Enabling the mass conversion at index 0 has to be of type "bool"') + if type(mass_conversion[1]) != float or type(mass_conversion[1]) != int : + raise Exception ('WARNING: Mass conversion factor in direction x at index 1 has to be of type "float" or "int"') + if type(mass_conversion[2]) != float or type(mass_conversion[1]) != int : + raise Exception ('WARNING: Mass conversion factor in direction y at index 2 has to be of type "float" or "int"') + if type(mass_conversion[3]) != float or type(mass_conversion[1]) != int : + raise Exception ('WARNING: Mass conversion factor in direction z at index 3 has to be of type "float" or "int"') + + # Comment + clientObject.comment = comment + + # Adding optional parameters via dictionary + for key in params: + clientObject[key] = params[key] + + # Add Static Analysis Settings to client model + clientModel.service.set_static_analysis_settings(clientObject) + + def SecondOrderPDelta (self, + no: int = 1, + name: str = None, + iterative_method = StaticAnalysisSettingsIterativeMethodForNonlinearAnalysis.NEWTON_RAPHSON, + standard_precision_and_tolerance_settings = [False, None, None, None], + control_nonlinear_analysis = [100, 1], + load_modification = [False, None, None], + favorable_effect_due_to_tension_in_members : bool = False, + bourdon_effect: bool = True, + nonsymmetric_direct_solver: bool = True, + internal_forces_to_deformed_structure = [False, None, None, None], + method_of_equation_system = StaticAnalysisSettingsMethodOfEquationSystem.METHOD_OF_EQUATION_SYSTEM_DIRECT, + plate_bending_theory = StaticAnalysisSettingsPlateBendingTheory.PLATE_BENDING_THEORY_MINDLIN, + mass_conversion = [False, None, None, None], + comment: str = '', + params: dict = {}): + """ + Args: + no (int): + name (str, optional): Static Analysis Name + iterative_method (enum): Static Analysis Settings Iterative Method for Non-linear Analysis Enumeration + standard_precision_and_tolerance_settings (list, optional): [standard_precision_and_tolerance_settings_enabled, precision_of_convergence_criteria_for_nonlinear_calculation, tolerance_for_detection_of_instability, robustness_of_iterative_calculation] + control_nonlinear_analysis (list): [max_number_of_iterations, number_of_load_increments] + loading_by_multiplier_factor (bool, optional): + For loading_by_multiplier_factor == False: + multiplier_factor = None + dividing_results = None + For loading_by_multiplier_factor == True: + multiplier_factor = int + dividing_results = bool + favorable_effect_due_to_tension_in_members (bool, optional): + bourdon_effect (bool, optional): + nonsymmetric_direct_solver (bool, optional): + internal_forces_to_deformed_structure (list, optional): [refer_internal_forces_to_deformed_structure, internal_forces_to_deformed_structure_for_moments, internal_forces_to_deformed_structure_for_normal_forces, internal_forces_to_deformed_structure_for_shear_forces] + For refer_internal_forces_to_deformed_structure == False: + internal_forces_to_deformed_structure_for_moments = None + internal_forces_to_deformed_structure_for_normal_forces = None + internal_forces_to_deformed_structure_for_shear_forces = None + For refer_internal_forces_to_deformed_structure == True: + internal_forces_to_deformed_structure_for_moments = bool + internal_forces_to_deformed_structure_for_normal_forces = bool + internal_forces_to_deformed_structure_for_shear_forces = bool + method_of_equation_system (enum): Static Analysis Settings Method of Equation System Enumeration + plate_bending_theory (enum): Static Analysis Settings Plate Bending Theory Enumeration + mass_conversion (list, optional): [mass_conversion_enabled, mass_conversion_factor_in_direction_x, mass_conversion_factor_in_direction_y, mass_conversion_factor_in_direction_z] + For mass_conversion_enabled == False: + mass_conversion_factors = [None, None, None] + For mass_conversion_enabled == True: + mass_conversion_factors = [double, double, double] + comment (str, optional): + params (dict, optional): + """ - # # Client model - # clientObject = clientModel.factory.create('ns0:static_analysis_settings') + # Client model + clientObject = clientModel.factory.create('ns0:static_analysis_settings') - # # Clears object atributes | Sets all atributes to None - # clearAtributes(clientObject) + # Clears object atributes | Sets all atributes to None + clearAtributes(clientObject) - # # Static Analysis Settings No. - # clientObject.no = no + # Static Analysis Settings No. + clientObject.no = no - # # Name - # if name != None: - # clientObject.user_defined_name_enabled = True - # clientObject.name = name + # Name + if name != None: + clientObject.user_defined_name_enabled = True + clientObject.name = name - # # Static Analysis Type - # clientObject.analysis_type = StaticAnalysisType.SECOND_ORDER_P_DELTA.name + # Static Analysis Type + clientObject.analysis_type = StaticAnalysisType.SECOND_ORDER_P_DELTA.name - # # Iterative Method - # clientObject.iterative_method_for_nonlinear_analysis = iterative_method.name - - # # Standard Precision and Tolerance + # Iterative Method + clientObject.iterative_method_for_nonlinear_analysis = iterative_method.name - # clientObject.standard_precision_and_tolerance_settings_enabled = standard_precision_and_tolerance_settings[0] - # clientObject.precision_of_convergence_criteria_for_nonlinear_calculation = standard_precision_and_tolerance_settings[1] - # clientObject.instability_detection_tolerance = standard_precision_and_tolerance_settings[2] - # clientObject.iterative_calculation_robustness = standard_precision_and_tolerance_settings[3] + # Standard Precision and Tolerance - # clientObject.standard_precision_and_tolerance_settings_enabled = standard_precision_and_tolerance_settings_enabled - # clientObject.precision_of_convergence_criteria_for_nonlinear_calculation = precision_of_convergence_criteria_for_nonlinear_calculation - # clientObject.instability_detection_tolerance = tolerance_for_detection_of_instability - # clientObject.iterative_calculation_robustness = robustness_of_iterative_calculation + clientObject.standard_precision_and_tolerance_settings_enabled = standard_precision_and_tolerance_settings_enabled + clientObject.precision_of_convergence_criteria_for_nonlinear_calculation = precision_of_convergence_criteria_for_nonlinear_calculation + clientObject.instability_detection_tolerance = tolerance_for_detection_of_instability + clientObject.iterative_calculation_robustness = robustness_of_iterative_calculation + + clientObject.standard_precision_and_tolerance_settings_enabled = standard_precision_and_tolerance_settings[0] + clientObject.precision_of_convergence_criteria_for_nonlinear_calculation = standard_precision_and_tolerance_settings[1] + clientObject.instability_detection_tolerance = standard_precision_and_tolerance_settings[2] + clientObject.iterative_calculation_robustness = standard_precision_and_tolerance_settings[3] - # if standard_precision_and_tolerance_settings_enabled != False: - # clientObject.precision_of_convergence_criteria_for_nonlinear_calculation = float - # clientObject.instability_detection_tolerance = float - # clientObject.iterative_calculation_robustness = float + if standard_precision_and_tolerance_settings_enabled != False: + clientObject.precision_of_convergence_criteria_for_nonlinear_calculation = float + clientObject.instability_detection_tolerance = float + clientObject.iterative_calculation_robustness = float - # if len(mass_conversion) != 4: - # raise Exception('WARNING: The standard precision and tolerance settings parameter needs to be of length 4. Kindly check list inputs for completeness and correctness.') + if len(mass_conversion) != 4: + raise Exception('WARNING: The standard precision and tolerance settings parameter needs to be of length 4. Kindly check list inputs for completeness and correctness.') - # if type(standard_precision_and_tolerance_settings[0]) != bool : - # raise Exception ('WARNING: Enabling the standard precision and tolerance settings at index 0 to be of type "bool"') - # if type(standard_precision_and_tolerance_settings[1]) != float or type(standard_precision_and_tolerance_settings[1]) != int : - # raise Exception ('WARNING: Precision of convergence criteria for nonlinear calculation factor at index 1 to be of type "float" or "int"') - # if type(standard_precision_and_tolerance_settings[2]) != float or type(standard_precision_and_tolerance_settings[2]) != int : - # raise Exception ('WARNING: Tolerance for detection of instability factor at index 2 to be of type "float" or "int"') - # if type(standard_precision_and_tolerance_settings[3]) != float or type(standard_precision_and_tolerance_settings[3]) != int : - # raise Exception ('WARNING: Robustness of iterative calculation factor at index 3 to be of type "float" or "int"') + if type(standard_precision_and_tolerance_settings[0]) != bool : + raise Exception ('WARNING: Enabling the standard precision and tolerance settings at index 0 to be of type "bool"') + if type(standard_precision_and_tolerance_settings[1]) != float or type(standard_precision_and_tolerance_settings[1]) != int : + raise Exception ('WARNING: Precision of convergence criteria for nonlinear calculation factor at index 1 to be of type "float" or "int"') + if type(standard_precision_and_tolerance_settings[2]) != float or type(standard_precision_and_tolerance_settings[2]) != int : + raise Exception ('WARNING: Tolerance for detection of instability factor at index 2 to be of type "float" or "int"') + if type(standard_precision_and_tolerance_settings[3]) != float or type(standard_precision_and_tolerance_settings[3]) != int : + raise Exception ('WARNING: Robustness of iterative calculation factor at index 3 to be of type "float" or "int"') - # while not float(precision_of_convergence_criteria_for_nonlinear_calculation) or not int(precision_of_convergence_criteria_for_nonlinear_calculation) in range(0.01,100): - # raise Exception ('WARNING: Precision of convergence criteria for nonlinear calculations at index 1 is out of range. Input has to be in the range [0.01 ... 100].') + while not float(precision_of_convergence_criteria_for_nonlinear_calculation) or not int(precision_of_convergence_criteria_for_nonlinear_calculation) in range(0.01,100): + raise Exception ('WARNING: Precision of convergence criteria for nonlinear calculations at index 1 is out of range. Input has to be in the range [0.01 ... 100].') - # while not float(tolerance_for_detection_of_instability) or not int(tolerance_for_detection_of_instability) in range(0.01,100): - # raise Exception ('WARNING: Tolerance for detection of instability at index 2 is out of range. Input has to be in the range [0.01 ... 100].') + while not float(tolerance_for_detection_of_instability) or not int(tolerance_for_detection_of_instability) in range(0.01,100): + raise Exception ('WARNING: Tolerance for detection of instability at index 2 is out of range. Input has to be in the range [0.01 ... 100].') - # while not float(robustness_of_iterative_calculation) or not int(robustness_of_iterative_calculation) in range(1.00,100): - # raise Exception ('WARNING: Robustness of iterative calculation at index 3 is out of range. Input has to be in the range [1.00 ... 100].') + while not float(robustness_of_iterative_calculation) or not int(robustness_of_iterative_calculation) in range(1.00,100): + raise Exception ('WARNING: Robustness of iterative calculation at index 3 is out of range. Input has to be in the range [1.00 ... 100].') - # # Control nonlinear Analysis - # clientObject.max_number_of_iterations = control_nonlinear_analysis[0] - # clientObject.number_of_load_increments = control_nonlinear_analysis[1] + # Control nonlinear Analysis + clientObject.max_number_of_iterations = control_nonlinear_analysis[0] + clientObject.number_of_load_increments = control_nonlinear_analysis[1] - # clientObject.max_number_of_iterations = max_number_of_iterations - # clientObject.number_of_load_increments = number_of_load_increments + clientObject.max_number_of_iterations = max_number_of_iterations + clientObject.number_of_load_increments = number_of_load_increments - # if len(control_nonlinear_analysis) != 2: - # raise Exception('WARNING: The nonlinear analysis control parameter needs to be of length 2. Kindly check list inputs for completeness and correctness.') + if len(control_nonlinear_analysis) != 2: + raise Exception('WARNING: The nonlinear analysis control parameter needs to be of length 2. Kindly check list inputs for completeness and correctness.') - # if type(control_nonlinear_analysis[0]) != int : - # raise Exception ('WARNING: Enabling the standard precision and tolerance settings at index 0 to be of type "int"') - # if type(control_nonlinear_analysis[1]) != int : - # raise Exception ('WARNING: Precision of convergence criteria for nonlinear calculation factor at index 1 to be of type "int"') + if type(control_nonlinear_analysis[0]) != int : + raise Exception ('WARNING: Enabling the standard precision and tolerance settings at index 0 to be of type "int"') + if type(control_nonlinear_analysis[1]) != int : + raise Exception ('WARNING: Precision of convergence criteria for nonlinear calculation factor at index 1 to be of type "int"') - # # Load Modification + # Load Modification - # clientObject.modify_loading_by_multiplier_factor = load_modification[0] - # clientObject.number_of_iterations_for_loading_prestress = load_modification[1] - # clientObject.divide_results_by_loading_factor = load_modification[2] + clientObject.modify_loading_by_multiplier_factor = load_modification[0] + clientObject.number_of_iterations_for_loading_prestress = load_modification[1] + clientObject.divide_results_by_loading_factor = load_modification[2] - # clientObject.modify_loading_by_multiplier_factor = loading_by_multiplier_factor - # clientObject.number_of_iterations_for_loading_prestress = multiplier_factor - # clientObject.divide_results_by_loading_factor = dividing_results + clientObject.modify_loading_by_multiplier_factor = loading_by_multiplier_factor + clientObject.number_of_iterations_for_loading_prestress = multiplier_factor + clientObject.divide_results_by_loading_factor = dividing_results - # if loading_by_multiplier_factor != False: - # loading_by_multiplier_factor = True - # multiplier_factor = int - # dividing_results = bool + if loading_by_multiplier_factor != False: + loading_by_multiplier_factor = True + multiplier_factor = int + dividing_results = bool - # if len(load_modification) != 3: - # raise Exception('WARNING: The load modification parameter needs to be of length 3. Kindly check list inputs for completeness and correctness.') + if len(load_modification) != 3: + raise Exception('WARNING: The load modification parameter needs to be of length 3. Kindly check list inputs for completeness and correctness.') - # if type(load_modification[0]) != bool : - # raise Exception ('WARNING: Load multiplier factor parameter at index 0 to be of type "int"') - # if type(load_modification[1]) != int : - # raise Exception ('WARNING: Multiplier factor parameter at index 1 to be of type "int"') - # if type(load_modification[2]) != bool : - # raise Exception ('WARNING: Dividing results parameter at index 0 to be of type "int"') + if type(load_modification[0]) != bool : + raise Exception ('WARNING: Load multiplier factor parameter at index 0 to be of type "int"') + if type(load_modification[1]) != int : + raise Exception ('WARNING: Multiplier factor parameter at index 1 to be of type "int"') + if type(load_modification[2]) != bool : + raise Exception ('WARNING: Dividing results parameter at index 0 to be of type "int"') - # if loading_by_multiplier_factor != False: - # loading_by_multiplier_factor = True - # multiplier_factor = int - # dividing_results = bool + if loading_by_multiplier_factor != False: + loading_by_multiplier_factor = True + multiplier_factor = int + dividing_results = bool - # # Effect due to Tension in Members - # clientObject.consider_favorable_effect_due_to_tension_in_members = favorable_effect_due_to_tension_in_members + # Effect due to Tension in Members + clientObject.consider_favorable_effect_due_to_tension_in_members = favorable_effect_due_to_tension_in_members - # # Bourdon Effect Displacement - # clientObject.displacements_due_to_bourdon_effect = bourdon_effect + # Bourdon Effect Displacement + clientObject.displacements_due_to_bourdon_effect = bourdon_effect - # # Nonsymetric Direct Solver - # clientObject.nonsymmetric_direct_solver = nonsymmetric_direct_solver + # Nonsymetric Direct Solver + clientObject.nonsymmetric_direct_solver = nonsymmetric_direct_solver - # # Internal Forces to Deformed Structure - - # clientObject.refer_internal_forces_to_deformed_structure = refer_internal_forces_to_deformed_structure - # clientObject.refer_internal_forces_to_deformed_structure_for_moments = internal_forces_to_deformed_structure_for_moments - # clientObject.refer_internal_forces_to_deformed_structure_for_normal_forces = internal_forces_to_deformed_structure_for_normal_forces - # clientObject.refer_internal_forces_to_deformed_structure_for_shear_forces = internal_forces_to_deformed_structure_for_shear_forces + # Internal Forces to Deformed Structure + clientObject.refer_internal_forces_to_deformed_structure = refer_internal_forces_to_deformed_structure + clientObject.refer_internal_forces_to_deformed_structure_for_moments = internal_forces_to_deformed_structure_for_moments + clientObject.refer_internal_forces_to_deformed_structure_for_normal_forces = internal_forces_to_deformed_structure_for_normal_forces + clientObject.refer_internal_forces_to_deformed_structure_for_shear_forces = internal_forces_to_deformed_structure_for_shear_forces - # refer_internal_forces_to_deformed_structure = internal_forces_to_deformed_structure[0] - # internal_forces_to_deformed_structure_for_moments = internal_forces_to_deformed_structure[1] - # internal_forces_to_deformed_structure_for_normal_forces = internal_forces_to_deformed_structure[2] - # internal_forces_to_deformed_structure_for_shear_forces = internal_forces_to_deformed_structure[3] - # if refer_internal_forces_to_deformed_structure != False: - # internal_forces_to_deformed_structure_for_moments = bool - # internal_forces_to_deformed_structure_for_normal_forces = bool - # internal_forces_to_deformed_structure_for_shear_forces = bool + refer_internal_forces_to_deformed_structure = internal_forces_to_deformed_structure[0] + internal_forces_to_deformed_structure_for_moments = internal_forces_to_deformed_structure[1] + internal_forces_to_deformed_structure_for_normal_forces = internal_forces_to_deformed_structure[2] + internal_forces_to_deformed_structure_for_shear_forces = internal_forces_to_deformed_structure[3] + if refer_internal_forces_to_deformed_structure != False: + internal_forces_to_deformed_structure_for_moments = bool + internal_forces_to_deformed_structure_for_normal_forces = bool + internal_forces_to_deformed_structure_for_shear_forces = bool - # if len(internal_forces_to_deformed_structure) != 4: - # raise Exception('WARNING: The internal forces to deformed structure parameter needs to be of length 4. Kindly check list inputs for completeness and correctness.') - - # if type(mass_conversion[0]) != bool : - # raise Exception ('WARNING: Refering internal forces to deformed structure at index 0 to be of type "bool"') - # if type(mass_conversion[1]) != bool : - # raise Exception ('WARNING: Internal forces to deformed structure for moments at index 1 to be of type "bool"') - # if type(mass_conversion[2]) != bool : - # raise Exception ('WARNING: Internal forces to deformed structure for normal forces at index 2 to be of type "bool"') - # if type(mass_conversion[3]) != bool : - # raise Exception ('WARNING: Internal forces to deformed structure for shear forces at index 3 to be of type "bool"') + if len(internal_forces_to_deformed_structure) != 4: + raise Exception('WARNING: The internal forces to deformed structure parameter needs to be of length 4. Kindly check list inputs for completeness and correctness.') + if type(mass_conversion[0]) != bool : + raise Exception ('WARNING: Refering internal forces to deformed structure at index 0 to be of type "bool"') + if type(mass_conversion[1]) != bool : + raise Exception ('WARNING: Internal forces to deformed structure for moments at index 1 to be of type "bool"') + if type(mass_conversion[2]) != bool : + raise Exception ('WARNING: Internal forces to deformed structure for normal forces at index 2 to be of type "bool"') + if type(mass_conversion[3]) != bool : + raise Exception ('WARNING: Internal forces to deformed structure for shear forces at index 3 to be of type "bool"') - # # Equation System - # clientObject.method_of_equation_system = method_of_equation_system.name - - # # Plate Bending Theory - # clientObject.plate_bending_theory = plate_bending_theory.name - - # # Mass Conversion - # clientObject.mass_conversion_enabled = mass_conversion_enabled - # clientObject.mass_conversion_factor_in_direction_x = mass_conversion_factor_in_direction_x - # clientObject.mass_conversion_factor_in_direction_y = mass_conversion_factor_in_direction_y - # clientObject.mass_conversion_factor_in_direction_z = mass_conversion_factor_in_direction_z - - # mass_conversion_enabled = mass_conversion[0] - # mass_conversion_factor_in_direction_x = mass_conversion[1] - # mass_conversion_factor_in_direction_y = mass_conversion[2] - # mass_conversion_factor_in_direction_z = mass_conversion[3] - # if mass_conversion_enabled != False: - # mass_conversion_factor_in_direction_x = float - # mass_conversion_acceleration_in_direction_y = float - # mass_conversion_acceleration_in_direction_z = float + # Equation System + clientObject.method_of_equation_system = method_of_equation_system.name + + # Plate Bending Theory + clientObject.plate_bending_theory = plate_bending_theory.name + + # Mass Conversion + clientObject.mass_conversion_enabled = mass_conversion_enabled + clientObject.mass_conversion_factor_in_direction_x = mass_conversion_factor_in_direction_x + clientObject.mass_conversion_factor_in_direction_y = mass_conversion_factor_in_direction_y + clientObject.mass_conversion_factor_in_direction_z = mass_conversion_factor_in_direction_z + + mass_conversion_enabled = mass_conversion[0] + mass_conversion_factor_in_direction_x = mass_conversion[1] + mass_conversion_factor_in_direction_y = mass_conversion[2] + mass_conversion_factor_in_direction_z = mass_conversion[3] + if mass_conversion_enabled != False: + mass_conversion_factor_in_direction_x = float + mass_conversion_acceleration_in_direction_y = float + mass_conversion_acceleration_in_direction_z = float - # if len(mass_conversion) != 4: - # raise Exception('WARNING: The mass conversion parameter needs to be of length 4. Kindly check list inputs for completeness and correctness.') + if len(mass_conversion) != 4: + raise Exception('WARNING: The mass conversion parameter needs to be of length 4. Kindly check list inputs for completeness and correctness.') - # if type(mass_conversion[0]) != bool : - # raise Exception ('WARNING: Enabling the mass conversion at index 0 to be of type "bool"') - # if type(mass_conversion[1]) != float or type(mass_conversion[1]) != int : - # raise Exception ('WARNING: Mass conversion factor in direction x at index 1 to be of type "float" or "int"') - # if type(mass_conversion[2]) != float or type(mass_conversion[2]) != int : - # raise Exception ('WARNING: Mass conversion factor in direction y at index 2 to be of type "float" or "int"') - # if type(mass_conversion[3]) != float or type(mass_conversion[3]) != int : - # raise Exception ('WARNING: Mass conversion factor in direction z at index 3 to be of type "float" or "int"') - - # # Comment - # clientObject.comment = comment - - # # Adding optional parameters via dictionary - # for key in params: - # clientObject[key] = params[key] - - # # Add Static Analysis Settings to client model - # clientModel.service.set_static_analysis_settings(clientObject) + if type(mass_conversion[0]) != bool : + raise Exception ('WARNING: Enabling the mass conversion at index 0 to be of type "bool"') + if type(mass_conversion[1]) != float or type(mass_conversion[1]) != int : + raise Exception ('WARNING: Mass conversion factor in direction x at index 1 to be of type "float" or "int"') + if type(mass_conversion[2]) != float or type(mass_conversion[2]) != int : + raise Exception ('WARNING: Mass conversion factor in direction y at index 2 to be of type "float" or "int"') + if type(mass_conversion[3]) != float or type(mass_conversion[3]) != int : + raise Exception ('WARNING: Mass conversion factor in direction z at index 3 to be of type "float" or "int"') + + # Comment + clientObject.comment = comment + + # Adding optional parameters via dictionary + for key in params: + clientObject[key] = params[key] + + # Add Static Analysis Settings to client model + clientModel.service.set_static_analysis_settings(clientObject) From 87819698c12aef5797986a3865fb6a3a030915a0 Mon Sep 17 00:00:00 2001 From: CarineKhalil22 <79253004+CarineKhalil22@users.noreply.github.com> Date: Thu, 11 Nov 2021 15:31:02 +0100 Subject: [PATCH 2/4] Update staticAnalysisSettings.py --- .../staticAnalysisSettings.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/RFEM/LoadCasesAndCombinations/staticAnalysisSettings.py b/RFEM/LoadCasesAndCombinations/staticAnalysisSettings.py index 0af6bb3d..f19673e8 100644 --- a/RFEM/LoadCasesAndCombinations/staticAnalysisSettings.py +++ b/RFEM/LoadCasesAndCombinations/staticAnalysisSettings.py @@ -11,14 +11,14 @@ def __init__(self, analysis_type = StaticAnalysisType.GEOMETRICALLY_LINEAR, comment: str = '', params: dict = {}): - """ + ''' Args: no (int): Setting Tag name (str): Setting Name analysis_type (enum): Analysis Type Enumeration comment (str): Comments params (dict): Parameters - """ + ''' # Client model | Surface clientObject = clientModel.factory.create('ns0:static_analysis_settings') @@ -57,7 +57,7 @@ def GeometricallyLinear(self, comment: str = '', params: dict = {}): - """ + ''' Args: no (int): name (str, optional): Static Analysis Name @@ -79,7 +79,7 @@ def GeometricallyLinear(self, mass_conversion_factors = [double, double, double] comment (str, optional): params (dict, optional): - """ + ''' # Client model clientObject = clientModel.factory.create('ns0:static_analysis_settings') @@ -192,7 +192,7 @@ def LargeDeformation(self, comment: str = '', params: dict = {}): - """ + ''' Args: no (int): name (str, optional): Static Analysis Name @@ -224,7 +224,7 @@ def LargeDeformation(self, mass_conversion_factors = [double, double, double] comment (str, optional): params (dict, optional): - """ + ''' # Client model clientObject = clientModel.factory.create('ns0:static_analysis_settings') @@ -404,7 +404,7 @@ def SecondOrderPDelta (self, mass_conversion = [False, None, None, None], comment: str = '', params: dict = {}): - """ + ''' Args: no (int): name (str, optional): Static Analysis Name @@ -439,8 +439,8 @@ def SecondOrderPDelta (self, mass_conversion_factors = [double, double, double] comment (str, optional): params (dict, optional): - """ - + ''' + # Client model clientObject = clientModel.factory.create('ns0:static_analysis_settings') From 6c5d4b3672ba46b96ae50211e57ba24e0426fb7a Mon Sep 17 00:00:00 2001 From: Jaroslav Broz Date: Thu, 11 Nov 2021 17:11:18 +0100 Subject: [PATCH 3/4] First bunch of fixed code --- .../staticAnalysisSettings.py | 783 +++++++++--------- UnitTests/test_staticAnalysisSetting.py | 34 + 2 files changed, 405 insertions(+), 412 deletions(-) create mode 100644 UnitTests/test_staticAnalysisSetting.py diff --git a/RFEM/LoadCasesAndCombinations/staticAnalysisSettings.py b/RFEM/LoadCasesAndCombinations/staticAnalysisSettings.py index 0af6bb3d..a3ea8278 100644 --- a/RFEM/LoadCasesAndCombinations/staticAnalysisSettings.py +++ b/RFEM/LoadCasesAndCombinations/staticAnalysisSettings.py @@ -8,7 +8,7 @@ class StaticAnalysisSettings(): def __init__(self, no: int = 1, name: str = None, - analysis_type = StaticAnalysisType.GEOMETRICALLY_LINEAR, + analysis_type=StaticAnalysisType.GEOMETRICALLY_LINEAR, comment: str = '', params: dict = {}): """ @@ -20,7 +20,8 @@ def __init__(self, params (dict): Parameters """ # Client model | Surface - clientObject = clientModel.factory.create('ns0:static_analysis_settings') + clientObject = clientModel.factory.create( + 'ns0:static_analysis_settings') # Clears object atributes | Sets all atributes to None clearAtributes(clientObject) @@ -34,7 +35,7 @@ def __init__(self, # Analysis Type clientObject.analysis_type = StaticAnalysisType.GEOMETRICALLY_LINEAR.name - + # Comment clientObject.comment = comment @@ -44,22 +45,22 @@ def __init__(self, # Add Static Analysis Settings to client model clientModel.service.set_static_analysis_settings(clientObject) - + def GeometricallyLinear(self, no: int = 1, name: str = None, - load_modification = [False, None, None], - bourdon_effect: bool = True, - nonsymmetric_direct_solver: bool = True, + load_modification = [False, 1, False], + bourdon_effect: bool = False, + nonsymmetric_direct_solver: bool = False, method_of_equation_system = StaticAnalysisSettingsMethodOfEquationSystem.METHOD_OF_EQUATION_SYSTEM_DIRECT, plate_bending_theory = StaticAnalysisSettingsPlateBendingTheory.PLATE_BENDING_THEORY_MINDLIN, - mass_conversion = [False, None, None, None], + mass_conversion = [False, 0, 0, 0], comment: str = '', - params: dict = {}): - + params: dict = {}): + """ Args: - no (int): + no (int): name (str, optional): Static Analysis Name load_modification (list, optional): [loading_by_multiplier_factor, multiplier_factor, dividing_results] For loading_by_multiplier_factor == False: @@ -68,8 +69,8 @@ def GeometricallyLinear(self, For loading_by_multiplier_factor == True: multiplier_factor = int dividing_results = bool - bourdon_effect (bool, optional): - nonsymmetric_direct_solver (bool, optional): + bourdon_effect (bool, optional): + nonsymmetric_direct_solver (bool, optional): method_of_equation_system (enum): Static Analysis Settings Method of Equation System Enumeration plate_bending_theory (enum): Static Analysis Settings Plate Bending Theory Enumeration mass_conversion (list, optional): [mass_conversion_enabled, mass_conversion_factor_in_direction_x, mass_conversion_factor_in_direction_y, mass_conversion_factor_in_direction_z] @@ -94,78 +95,67 @@ def GeometricallyLinear(self, if name != None: clientObject.user_defined_name_enabled = True clientObject.name = name - + # Static Analysis Type clientObject.analysis_type = StaticAnalysisType.GEOMETRICALLY_LINEAR.name # Load Modification - clientObject.modify_loading_by_multiplier_factor = loading_by_multiplier_factor - clientObject.number_of_iterations_for_loading_prestress = multiplier_factor - clientObject.divide_results_by_loading_factor = dividing_results - - clientObject.modify_loading_by_multiplier_factor = load_modification[0] - clientObject.number_of_iterations_for_loading_prestress = load_modification[1] - clientObject.divide_results_by_loading_factor = load_modification[2] - - if loading_by_multiplier_factor != False: - loading_by_multiplier_factor = True - multiplier_factor = int - dividing_results = bool - if len(load_modification) != 3: raise Exception('WARNING: The load modification parameter needs to be of length 3. Kindly check list inputs for completeness and correctness.') - - if type(load_modification[0]) != bool : - raise Exception ('WARNING: Load multiplier factor parameter at index 0 to be of type "int"') - if type(load_modification[1]) != int : - raise Exception ('WARNING: Multiplier factor parameter at index 1 to be of type "int"') - if type(load_modification[2]) != bool : - raise Exception ('WARNING: Dividing results parameter at index 0 to be of type "int"') - - if loading_by_multiplier_factor != False: - loading_by_multiplier_factor = True - multiplier_factor = int - dividing_results = bool - - # Bourdon Effect Displacement - clientObject.displacements_due_to_bourdon_effect = bourdon_effect + + # if type(load_modification[0]) != bool : + # raise Exception ('WARNING: Load multiplier factor parameter at index 0 to be of type "int"') + # if type(load_modification[1]) != int : + # raise Exception ('WARNING: Multiplier factor parameter at index 1 to be of type "int"') + # if type(load_modification[2]) != bool : + # raise Exception ('WARNING: Dividing results parameter at index 2 to be of type "bool"') + + if load_modification[0] == True: + clientObject.modify_loading_by_multiplier_factor = True + clientObject.loading_multiplier_factor = load_modification[1] + clientObject.divide_results_by_loading_factor = load_modification[2] + # Bourdon Effect Displacement + clientObject.displacements_due_to_bourdon_effect = bourdon_effect + # Nonsymetric Direct Solver clientObject.nonsymmetric_direct_solver = nonsymmetric_direct_solver - + # Equation System clientObject.method_of_equation_system = method_of_equation_system.name # Plate Bending Theory clientObject.plate_bending_theory = plate_bending_theory.name + + + + # mass_conversion_enabled = mass_conversion[0] + # mass_conversion_factor_in_direction_x = mass_conversion[1] + # mass_conversion_factor_in_direction_y = mass_conversion[2] + # mass_conversion_factor_in_direction_z = mass_conversion[3] + # mass_conversion_factor_in_direction_x = float + # mass_conversion_acceleration_in_direction_y = float + # mass_conversion_acceleration_in_direction_z = float + # Mass Conversion - clientObject.mass_conversion_enabled = mass_conversion_enabled - clientObject.mass_conversion_factor_in_direction_x = mass_conversion_factor_in_direction_x - clientObject.mass_conversion_factor_in_direction_y = mass_conversion_factor_in_direction_y - clientObject.mass_conversion_factor_in_direction_z = mass_conversion_factor_in_direction_z - - mass_conversion_enabled = mass_conversion[0] - mass_conversion_factor_in_direction_x = mass_conversion[1] - mass_conversion_factor_in_direction_y = mass_conversion[2] - mass_conversion_factor_in_direction_z = mass_conversion[3] - if mass_conversion_enabled != False: - mass_conversion_factor_in_direction_x = float - mass_conversion_acceleration_in_direction_y = float - mass_conversion_acceleration_in_direction_z = float - if len(mass_conversion) != 4: - raise Exception('WARNING: The mass conversion parameter needs to be of length 4. Kindly check list inputs for completeness and correctness.') - - if type(mass_conversion[0]) != bool : - raise Exception ('WARNING: Enabling the mass conversion at index 0 has to be of type "bool"') - if type(mass_conversion[1]) != float or type(mass_conversion[1]) != int: - raise Exception ('WARNING: Mass conversion factor in direction x at index 1 has to be of type "float" or "int"') - if type(mass_conversion[2]) != float or type(mass_conversion[2]) != int: - raise Exception ('WARNING: Mass conversion factor in direction y at index 2 has to be of type "float" or "int"') - if type(mass_conversion[3]) != float or type(mass_conversion[3]) != int : - raise Exception ('WARNING: Mass conversion factor in direction z at index 3 has to be of type "float" or "int"') - + raise Exception('WARNING: The mass conversion parameter needs to be of length 4. Kindly check list inputs for completeness and correctness.') + # if type(mass_conversion[0]) != bool : + # raise Exception ('WARNING: Enabling the mass conversion at index 0 has to be of type "bool"') + # if type(mass_conversion[1]) != float or type(mass_conversion[1]) != int: + # raise Exception ('WARNING: Mass conversion factor in direction x at index 1 has to be of type "float" or "int"') + # if type(mass_conversion[2]) != float or type(mass_conversion[2]) != int: + # raise Exception ('WARNING: Mass conversion factor in direction y at index 2 has to be of type "float" or "int"') + # if type(mass_conversion[3]) != float or type(mass_conversion[3]) != int : + # raise Exception ('WARNING: Mass conversion factor in direction z at index 3 has to be of type "float" or "int"') + + clientObject.mass_conversion_enabled = mass_conversion[0] + if mass_conversion[0] != False: + clientObject.mass_conversion_factor_in_direction_x = mass_conversion[1] + clientObject.mass_conversion_factor_in_direction_y = mass_conversion[2] + clientObject.mass_conversion_factor_in_direction_z = mass_conversion[3] + # Comment clientObject.comment = comment @@ -180,21 +170,21 @@ def LargeDeformation(self, no: int = 1, name: str = None, iterative_method = StaticAnalysisSettingsIterativeMethodForNonlinearAnalysis.NEWTON_RAPHSON, - standard_precision_and_tolerance_settings = [False, None, None, None], + standard_precision_and_tolerance_settings = [False, 0.01, 0.01, 1.0], control_nonlinear_analysis = [100, 1], - load_modification = [False, None, None], + load_modification = [False, 1, False], instabil_structure_calculation : bool = True, bourdon_effect: bool = True, nonsymmetric_direct_solver: bool = True, method_of_equation_system = StaticAnalysisSettingsMethodOfEquationSystem.METHOD_OF_EQUATION_SYSTEM_DIRECT, plate_bending_theory = StaticAnalysisSettingsPlateBendingTheory.PLATE_BENDING_THEORY_MINDLIN, - mass_conversion = [False, None, None, None], + mass_conversion = [False, 0, 0, 1], comment: str = '', - params: dict = {}): + params: dict = {}): """ Args: - no (int): + no (int): name (str, optional): Static Analysis Name iterative_method (enum): Static Analysis Settings Iterative Method for Non-linear Analysis Enumeration For iterative_method == "NEWTON_RAPHSON" or iterative_method.name == "NEWTON_RAPHSON_COMBINED_WITH_PICARD" or iterative_method.name == "PICARD" or iterative_method.name == "NEWTON_RAPHSON_WITH_POSTCRITICAL_ANALYSIS" @@ -212,9 +202,9 @@ def LargeDeformation(self, For loading_by_multiplier_factor == True: multiplier_factor = int dividing_results = bool - instabil_structure_calculation (bool, optional): - bourdon_effect (bool, optional): - nonsymmetric_direct_solver (bool, optional): + instabil_structure_calculation (bool, optional): + bourdon_effect (bool, optional): + nonsymmetric_direct_solver (bool, optional): method_of_equation_system (enum): Static Analysis Settings Method of Equation System Enumeration plate_bending_theory (enum): Static Analysis Settings Plate Bending Theory Enumeration mass_conversion (list, optional): [mass_conversion_enabled, mass_conversion_factor_in_direction_x, mass_conversion_factor_in_direction_y, mass_conversion_factor_in_direction_z] @@ -222,10 +212,10 @@ def LargeDeformation(self, mass_conversion_factors = [None, None, None] For mass_conversion_enabled == True: mass_conversion_factors = [double, double, double] - comment (str, optional): + comment (str, optional): params (dict, optional): """ - + # Client model clientObject = clientModel.factory.create('ns0:static_analysis_settings') @@ -253,370 +243,100 @@ def LargeDeformation(self, number_of_load_increments = None # Standard Precision and Tolerance + # if standard_precision_and_tolerance_settings_enabled != False: + # clientObject.precision_of_convergence_criteria_for_nonlinear_calculation = float + # clientObject.instability_detection_tolerance = float + # clientObject.iterative_calculation_robustness = float + if len(standard_precision_and_tolerance_settings) != 4: + raise Exception('WARNING: The standard precision and tolerance settings parameter needs to be of length 4. Kindly check list inputs for completeness and correctness.') - clientObject.standard_precision_and_tolerance_settings_enabled = standard_precision_and_tolerance_settings_enabled - clientObject.precision_of_convergence_criteria_for_nonlinear_calculation = precision_of_convergence_criteria_for_nonlinear_calculation - clientObject.instability_detection_tolerance = tolerance_for_detection_of_instability - clientObject.iterative_calculation_robustness = robustness_of_iterative_calculation - - clientObject.standard_precision_and_tolerance_settings_enabled = standard_precision_and_tolerance_settings[0] - clientObject.precision_of_convergence_criteria_for_nonlinear_calculation = standard_precision_and_tolerance_settings[1] - clientObject.instability_detection_tolerance = standard_precision_and_tolerance_settings[2] - clientObject.iterative_calculation_robustness = standard_precision_and_tolerance_settings[3] - - if standard_precision_and_tolerance_settings_enabled != False: - clientObject.precision_of_convergence_criteria_for_nonlinear_calculation = float - clientObject.instability_detection_tolerance = float - clientObject.iterative_calculation_robustness = float - - if len(mass_conversion) != 4: - raise Exception('WARNING: The standard precision and tolerance settings parameter needs to be of length 4. Kindly check list inputs for completeness and correctness.') - if type(standard_precision_and_tolerance_settings[0]) != bool : raise Exception ('WARNING: Enabling the standard precision and tolerance settings at index 0 to be of type "bool"') - if type(standard_precision_and_tolerance_settings[1]) != float or type(standard_precision_and_tolerance_settings[1]) != int: - raise Exception ('WARNING: Precision of convergence criteria for nonlinear calculation factor at index 1 to be of type "float" or "int"') - if type(standard_precision_and_tolerance_settings[2]) != float or type(standard_precision_and_tolerance_settings[2]) != int: - raise Exception ('WARNING: Tolerance for detection of instability factor at index 2 to be of type "float" or "int"') - if type(standard_precision_and_tolerance_settings[3]) != float or type(standard_precision_and_tolerance_settings[3]) != int: - raise Exception ('WARNING: Robustness of iterative calculation factor at index 3 to be of type "float" or "int"') + # if type(standard_precision_and_tolerance_settings[1]) != float or type(standard_precision_and_tolerance_settings[1]) != int: + # raise Exception ('WARNING: Precision of convergence criteria for nonlinear calculation factor at index 1 to be of type "float" or "int"') + # if type(standard_precision_and_tolerance_settings[2]) != float or type(standard_precision_and_tolerance_settings[2]) != int: + # raise Exception ('WARNING: Tolerance for detection of instability factor at index 2 to be of type "float" or "int"') + # if type(standard_precision_and_tolerance_settings[3]) != float or type(standard_precision_and_tolerance_settings[3]) != int: + # raise Exception ('WARNING: Robustness of iterative calculation factor at index 3 to be of type "float" or "int"') + + # while not float(standard_precision_and_tolerance_settings[1]) or not int(standard_precision_and_tolerance_settings[1]) in range(0.01,100): + # raise Exception ('WARNING: Precision of convergence criteria for nonlinear calculations at index 1 is out of range. Input has to be in the range [0.01 ... 100].') + + # while not float(standard_precision_and_tolerance_settings[2]) or not int(standard_precision_and_tolerance_settings[2]) in range(0.01,100): + # raise Exception ('WARNING: Tolerance for detection of instability at index 2 is out of range. Input has to be in the range [0.01 ... 100].') + + # while not float(standard_precision_and_tolerance_settings[3]) or not int(standard_precision_and_tolerance_settings[3]) in range(1.00,100): + # raise Exception ('WARNING: Robustness of iterative calculation at index 3 is out of range. Input has to be in the range [1.00 ... 100].') + if standard_precision_and_tolerance_settings[0] == True: + clientObject.standard_precision_and_tolerance_settings_enabled = True + clientObject.precision_of_convergence_criteria_for_nonlinear_calculation = standard_precision_and_tolerance_settings[1] + clientObject.instability_detection_tolerance = standard_precision_and_tolerance_settings[2] + clientObject.iterative_calculation_robustness = standard_precision_and_tolerance_settings[3] - while not float(precision_of_convergence_criteria_for_nonlinear_calculation) or not int(precision_of_convergence_criteria_for_nonlinear_calculation) in range(0.01,100): - raise Exception ('WARNING: Precision of convergence criteria for nonlinear calculations at index 1 is out of range. Input has to be in the range [0.01 ... 100].') - - while not float(tolerance_for_detection_of_instability) or not int(tolerance_for_detection_of_instability) in range(0.01,100): - raise Exception ('WARNING: Tolerance for detection of instability at index 2 is out of range. Input has to be in the range [0.01 ... 100].') - - while not float(robustness_of_iterative_calculation) or not int(robustness_of_iterative_calculation) in range(1.00,100): - raise Exception ('WARNING: Robustness of iterative calculation at index 3 is out of range. Input has to be in the range [1.00 ... 100].') - - # Control nonlinear Analysis - clientObject.max_number_of_iterations = control_nonlinear_analysis[0] - clientObject.number_of_load_increments = control_nonlinear_analysis[1] - - clientObject.max_number_of_iterations = max_number_of_iterations - clientObject.number_of_load_increments = number_of_load_increments - if len(control_nonlinear_analysis) != 2: raise Exception('WARNING: The nonlinear analysis control parameter needs to be of length 2. Kindly check list inputs for completeness and correctness.') - + if type(control_nonlinear_analysis[0]) != int : raise Exception ('WARNING: Enabling the standard precision and tolerance settings at index 0 has to be of type "int"') if type(control_nonlinear_analysis[1]) != int : raise Exception ('WARNING: Precision of convergence criteria for nonlinear calculation factor at index 1 has to be of type "int"') - # Load Modification - - clientObject.modify_loading_by_multiplier_factor = loading_by_multiplier_factor - clientObject.number_of_iterations_for_loading_prestress = multiplier_factor - clientObject.divide_results_by_loading_factor = dividing_results - - clientObject.modify_loading_by_multiplier_factor = load_modification[0] - clientObject.number_of_iterations_for_loading_prestress = load_modification[1] - clientObject.divide_results_by_loading_factor = load_modification[2] - - if loading_by_multiplier_factor != False: - loading_by_multiplier_factor = True - multiplier_factor = int - dividing_results = bool - - if len(load_modification) != 3: - raise Exception('WARNING: The load modification parameter needs to be of length 3. Kindly check list inputs for completeness and correctness.') - - if type(load_modification[0]) != bool : - raise Exception ('WARNING: Load multiplier factor parameter at index 0 has to be of type "int"') - if type(load_modification[1]) != int : - raise Exception ('WARNING: Multiplier factor parameter at index 1 has to be of type "int"') - if type(load_modification[2]) != bool : - raise Exception ('WARNING: Dividing results parameter at index 0 has to be of type "int"') - - if loading_by_multiplier_factor != False: - loading_by_multiplier_factor = True - multiplier_factor = int - dividing_results = bool - - # Instabil Structure - clientObject.try_to_calculate_instabil_structure = instabil_structure_calculation - - # Bourdon Effect Displacement - clientObject.displacements_due_to_bourdon_effect = bourdon_effect - - # Nonsymetric Direct Solver - clientObject.nonsymmetric_direct_solver = nonsymmetric_direct_solver - - # Equation System - clientObject.method_of_equation_system = method_of_equation_system.name - - # Plate Bending Theory - clientObject.plate_bending_theory = plate_bending_theory.name - - # Mass Conversion - clientObject.mass_conversion_enabled = mass_conversion_enabled - clientObject.mass_conversion_factor_in_direction_x = mass_conversion_factor_in_direction_x - clientObject.mass_conversion_factor_in_direction_y = mass_conversion_factor_in_direction_y - clientObject.mass_conversion_factor_in_direction_z = mass_conversion_factor_in_direction_z - - mass_conversion_enabled = mass_conversion[0] - mass_conversion_factor_in_direction_x = mass_conversion[1] - mass_conversion_factor_in_direction_y = mass_conversion[2] - mass_conversion_factor_in_direction_z = mass_conversion[3] - if mass_conversion_enabled != False: - mass_conversion_factor_in_direction_x = float - mass_conversion_acceleration_in_direction_y = float - mass_conversion_acceleration_in_direction_z = float - - if len(mass_conversion) != 4: - raise Exception('WARNING: The mass conversion parameter needs to be of length 4. Kindly check list inputs for completeness and correctness.') - - if type(mass_conversion[0]) != bool : - raise Exception ('WARNING: Enabling the mass conversion at index 0 has to be of type "bool"') - if type(mass_conversion[1]) != float or type(mass_conversion[1]) != int : - raise Exception ('WARNING: Mass conversion factor in direction x at index 1 has to be of type "float" or "int"') - if type(mass_conversion[2]) != float or type(mass_conversion[1]) != int : - raise Exception ('WARNING: Mass conversion factor in direction y at index 2 has to be of type "float" or "int"') - if type(mass_conversion[3]) != float or type(mass_conversion[1]) != int : - raise Exception ('WARNING: Mass conversion factor in direction z at index 3 has to be of type "float" or "int"') - - # Comment - clientObject.comment = comment - - # Adding optional parameters via dictionary - for key in params: - clientObject[key] = params[key] - - # Add Static Analysis Settings to client model - clientModel.service.set_static_analysis_settings(clientObject) - - def SecondOrderPDelta (self, - no: int = 1, - name: str = None, - iterative_method = StaticAnalysisSettingsIterativeMethodForNonlinearAnalysis.NEWTON_RAPHSON, - standard_precision_and_tolerance_settings = [False, None, None, None], - control_nonlinear_analysis = [100, 1], - load_modification = [False, None, None], - favorable_effect_due_to_tension_in_members : bool = False, - bourdon_effect: bool = True, - nonsymmetric_direct_solver: bool = True, - internal_forces_to_deformed_structure = [False, None, None, None], - method_of_equation_system = StaticAnalysisSettingsMethodOfEquationSystem.METHOD_OF_EQUATION_SYSTEM_DIRECT, - plate_bending_theory = StaticAnalysisSettingsPlateBendingTheory.PLATE_BENDING_THEORY_MINDLIN, - mass_conversion = [False, None, None, None], - comment: str = '', - params: dict = {}): - """ - Args: - no (int): - name (str, optional): Static Analysis Name - iterative_method (enum): Static Analysis Settings Iterative Method for Non-linear Analysis Enumeration - standard_precision_and_tolerance_settings (list, optional): [standard_precision_and_tolerance_settings_enabled, precision_of_convergence_criteria_for_nonlinear_calculation, tolerance_for_detection_of_instability, robustness_of_iterative_calculation] - control_nonlinear_analysis (list): [max_number_of_iterations, number_of_load_increments] - loading_by_multiplier_factor (bool, optional): - For loading_by_multiplier_factor == False: - multiplier_factor = None - dividing_results = None - For loading_by_multiplier_factor == True: - multiplier_factor = int - dividing_results = bool - favorable_effect_due_to_tension_in_members (bool, optional): - bourdon_effect (bool, optional): - nonsymmetric_direct_solver (bool, optional): - internal_forces_to_deformed_structure (list, optional): [refer_internal_forces_to_deformed_structure, internal_forces_to_deformed_structure_for_moments, internal_forces_to_deformed_structure_for_normal_forces, internal_forces_to_deformed_structure_for_shear_forces] - For refer_internal_forces_to_deformed_structure == False: - internal_forces_to_deformed_structure_for_moments = None - internal_forces_to_deformed_structure_for_normal_forces = None - internal_forces_to_deformed_structure_for_shear_forces = None - For refer_internal_forces_to_deformed_structure == True: - internal_forces_to_deformed_structure_for_moments = bool - internal_forces_to_deformed_structure_for_normal_forces = bool - internal_forces_to_deformed_structure_for_shear_forces = bool - method_of_equation_system (enum): Static Analysis Settings Method of Equation System Enumeration - plate_bending_theory (enum): Static Analysis Settings Plate Bending Theory Enumeration - mass_conversion (list, optional): [mass_conversion_enabled, mass_conversion_factor_in_direction_x, mass_conversion_factor_in_direction_y, mass_conversion_factor_in_direction_z] - For mass_conversion_enabled == False: - mass_conversion_factors = [None, None, None] - For mass_conversion_enabled == True: - mass_conversion_factors = [double, double, double] - comment (str, optional): - params (dict, optional): - """ - - # Client model - clientObject = clientModel.factory.create('ns0:static_analysis_settings') - - # Clears object atributes | Sets all atributes to None - clearAtributes(clientObject) - - # Static Analysis Settings No. - clientObject.no = no - - # Name - if name != None: - clientObject.user_defined_name_enabled = True - clientObject.name = name - - # Static Analysis Type - clientObject.analysis_type = StaticAnalysisType.SECOND_ORDER_P_DELTA.name - - # Iterative Method - clientObject.iterative_method_for_nonlinear_analysis = iterative_method.name - - # Standard Precision and Tolerance - - clientObject.standard_precision_and_tolerance_settings_enabled = standard_precision_and_tolerance_settings_enabled - clientObject.precision_of_convergence_criteria_for_nonlinear_calculation = precision_of_convergence_criteria_for_nonlinear_calculation - clientObject.instability_detection_tolerance = tolerance_for_detection_of_instability - clientObject.iterative_calculation_robustness = robustness_of_iterative_calculation - - clientObject.standard_precision_and_tolerance_settings_enabled = standard_precision_and_tolerance_settings[0] - clientObject.precision_of_convergence_criteria_for_nonlinear_calculation = standard_precision_and_tolerance_settings[1] - clientObject.instability_detection_tolerance = standard_precision_and_tolerance_settings[2] - clientObject.iterative_calculation_robustness = standard_precision_and_tolerance_settings[3] - - if standard_precision_and_tolerance_settings_enabled != False: - clientObject.precision_of_convergence_criteria_for_nonlinear_calculation = float - clientObject.instability_detection_tolerance = float - clientObject.iterative_calculation_robustness = float - - if len(mass_conversion) != 4: - raise Exception('WARNING: The standard precision and tolerance settings parameter needs to be of length 4. Kindly check list inputs for completeness and correctness.') - - if type(standard_precision_and_tolerance_settings[0]) != bool : - raise Exception ('WARNING: Enabling the standard precision and tolerance settings at index 0 to be of type "bool"') - if type(standard_precision_and_tolerance_settings[1]) != float or type(standard_precision_and_tolerance_settings[1]) != int : - raise Exception ('WARNING: Precision of convergence criteria for nonlinear calculation factor at index 1 to be of type "float" or "int"') - if type(standard_precision_and_tolerance_settings[2]) != float or type(standard_precision_and_tolerance_settings[2]) != int : - raise Exception ('WARNING: Tolerance for detection of instability factor at index 2 to be of type "float" or "int"') - if type(standard_precision_and_tolerance_settings[3]) != float or type(standard_precision_and_tolerance_settings[3]) != int : - raise Exception ('WARNING: Robustness of iterative calculation factor at index 3 to be of type "float" or "int"') - - while not float(precision_of_convergence_criteria_for_nonlinear_calculation) or not int(precision_of_convergence_criteria_for_nonlinear_calculation) in range(0.01,100): - raise Exception ('WARNING: Precision of convergence criteria for nonlinear calculations at index 1 is out of range. Input has to be in the range [0.01 ... 100].') - - while not float(tolerance_for_detection_of_instability) or not int(tolerance_for_detection_of_instability) in range(0.01,100): - raise Exception ('WARNING: Tolerance for detection of instability at index 2 is out of range. Input has to be in the range [0.01 ... 100].') - - while not float(robustness_of_iterative_calculation) or not int(robustness_of_iterative_calculation) in range(1.00,100): - raise Exception ('WARNING: Robustness of iterative calculation at index 3 is out of range. Input has to be in the range [1.00 ... 100].') - - # Control nonlinear Analysis clientObject.max_number_of_iterations = control_nonlinear_analysis[0] clientObject.number_of_load_increments = control_nonlinear_analysis[1] - - clientObject.max_number_of_iterations = max_number_of_iterations - clientObject.number_of_load_increments = number_of_load_increments - - if len(control_nonlinear_analysis) != 2: - raise Exception('WARNING: The nonlinear analysis control parameter needs to be of length 2. Kindly check list inputs for completeness and correctness.') - - if type(control_nonlinear_analysis[0]) != int : - raise Exception ('WARNING: Enabling the standard precision and tolerance settings at index 0 to be of type "int"') - if type(control_nonlinear_analysis[1]) != int : - raise Exception ('WARNING: Precision of convergence criteria for nonlinear calculation factor at index 1 to be of type "int"') - - - # Load Modification - - clientObject.modify_loading_by_multiplier_factor = load_modification[0] - clientObject.number_of_iterations_for_loading_prestress = load_modification[1] - clientObject.divide_results_by_loading_factor = load_modification[2] - - clientObject.modify_loading_by_multiplier_factor = loading_by_multiplier_factor - clientObject.number_of_iterations_for_loading_prestress = multiplier_factor - clientObject.divide_results_by_loading_factor = dividing_results - - if loading_by_multiplier_factor != False: - loading_by_multiplier_factor = True - multiplier_factor = int - dividing_results = bool - + + + ## Load Modification if len(load_modification) != 3: raise Exception('WARNING: The load modification parameter needs to be of length 3. Kindly check list inputs for completeness and correctness.') - - if type(load_modification[0]) != bool : - raise Exception ('WARNING: Load multiplier factor parameter at index 0 to be of type "int"') - if type(load_modification[1]) != int : - raise Exception ('WARNING: Multiplier factor parameter at index 1 to be of type "int"') - if type(load_modification[2]) != bool : - raise Exception ('WARNING: Dividing results parameter at index 0 to be of type "int"') - - if loading_by_multiplier_factor != False: - loading_by_multiplier_factor = True - multiplier_factor = int - dividing_results = bool - - # Effect due to Tension in Members - clientObject.consider_favorable_effect_due_to_tension_in_members = favorable_effect_due_to_tension_in_members + # if type(load_modification[0]) != bool : + # raise Exception ('WARNING: Load multiplier factor parameter at index 0 to be of type "int"') + # if type(load_modification[1]) != int : + # raise Exception ('WARNING: Multiplier factor parameter at index 1 to be of type "int"') + # if type(load_modification[2]) != bool : + # raise Exception ('WARNING: Dividing results parameter at index 2 to be of type "bool"') + + if load_modification[0] == True: + clientObject.modify_loading_by_multiplier_factor = True + clientObject.loading_multiplier_factor = load_modification[1] + clientObject.divide_results_by_loading_factor = load_modification[2] + dividing_results = bool - - # Bourdon Effect Displacement - clientObject.displacements_due_to_bourdon_effect = bourdon_effect + # Instabil Structure + clientObject.try_to_calculate_instabil_structure = instabil_structure_calculation + # Bourdon Effect Displacement + clientObject.displacements_due_to_bourdon_effect = bourdon_effect # Nonsymetric Direct Solver clientObject.nonsymmetric_direct_solver = nonsymmetric_direct_solver - - # Internal Forces to Deformed Structure - clientObject.refer_internal_forces_to_deformed_structure = refer_internal_forces_to_deformed_structure - clientObject.refer_internal_forces_to_deformed_structure_for_moments = internal_forces_to_deformed_structure_for_moments - clientObject.refer_internal_forces_to_deformed_structure_for_normal_forces = internal_forces_to_deformed_structure_for_normal_forces - clientObject.refer_internal_forces_to_deformed_structure_for_shear_forces = internal_forces_to_deformed_structure_for_shear_forces - - refer_internal_forces_to_deformed_structure = internal_forces_to_deformed_structure[0] - internal_forces_to_deformed_structure_for_moments = internal_forces_to_deformed_structure[1] - internal_forces_to_deformed_structure_for_normal_forces = internal_forces_to_deformed_structure[2] - internal_forces_to_deformed_structure_for_shear_forces = internal_forces_to_deformed_structure[3] - if refer_internal_forces_to_deformed_structure != False: - internal_forces_to_deformed_structure_for_moments = bool - internal_forces_to_deformed_structure_for_normal_forces = bool - internal_forces_to_deformed_structure_for_shear_forces = bool - - if len(internal_forces_to_deformed_structure) != 4: - raise Exception('WARNING: The internal forces to deformed structure parameter needs to be of length 4. Kindly check list inputs for completeness and correctness.') - if type(mass_conversion[0]) != bool : - raise Exception ('WARNING: Refering internal forces to deformed structure at index 0 to be of type "bool"') - if type(mass_conversion[1]) != bool : - raise Exception ('WARNING: Internal forces to deformed structure for moments at index 1 to be of type "bool"') - if type(mass_conversion[2]) != bool : - raise Exception ('WARNING: Internal forces to deformed structure for normal forces at index 2 to be of type "bool"') - if type(mass_conversion[3]) != bool : - raise Exception ('WARNING: Internal forces to deformed structure for shear forces at index 3 to be of type "bool"') - # Equation System clientObject.method_of_equation_system = method_of_equation_system.name - + # Plate Bending Theory clientObject.plate_bending_theory = plate_bending_theory.name # Mass Conversion - clientObject.mass_conversion_enabled = mass_conversion_enabled - clientObject.mass_conversion_factor_in_direction_x = mass_conversion_factor_in_direction_x - clientObject.mass_conversion_factor_in_direction_y = mass_conversion_factor_in_direction_y - clientObject.mass_conversion_factor_in_direction_z = mass_conversion_factor_in_direction_z - - mass_conversion_enabled = mass_conversion[0] - mass_conversion_factor_in_direction_x = mass_conversion[1] - mass_conversion_factor_in_direction_y = mass_conversion[2] - mass_conversion_factor_in_direction_z = mass_conversion[3] - if mass_conversion_enabled != False: - mass_conversion_factor_in_direction_x = float - mass_conversion_acceleration_in_direction_y = float - mass_conversion_acceleration_in_direction_z = float - + # Mass Conversion if len(mass_conversion) != 4: - raise Exception('WARNING: The mass conversion parameter needs to be of length 4. Kindly check list inputs for completeness and correctness.') - - if type(mass_conversion[0]) != bool : - raise Exception ('WARNING: Enabling the mass conversion at index 0 to be of type "bool"') - if type(mass_conversion[1]) != float or type(mass_conversion[1]) != int : - raise Exception ('WARNING: Mass conversion factor in direction x at index 1 to be of type "float" or "int"') - if type(mass_conversion[2]) != float or type(mass_conversion[2]) != int : - raise Exception ('WARNING: Mass conversion factor in direction y at index 2 to be of type "float" or "int"') - if type(mass_conversion[3]) != float or type(mass_conversion[3]) != int : - raise Exception ('WARNING: Mass conversion factor in direction z at index 3 to be of type "float" or "int"') - + raise Exception('WARNING: The mass conversion parameter needs to be of length 4. Kindly check list inputs for completeness and correctness.') + # if type(mass_conversion[0]) != bool : + # raise Exception ('WARNING: Enabling the mass conversion at index 0 has to be of type "bool"') + # if type(mass_conversion[1]) != float or type(mass_conversion[1]) != int: + # raise Exception ('WARNING: Mass conversion factor in direction x at index 1 has to be of type "float" or "int"') + # if type(mass_conversion[2]) != float or type(mass_conversion[2]) != int: + # raise Exception ('WARNING: Mass conversion factor in direction y at index 2 has to be of type "float" or "int"') + # if type(mass_conversion[3]) != float or type(mass_conversion[3]) != int : + # raise Exception ('WARNING: Mass conversion factor in direction z at index 3 has to be of type "float" or "int"') + + clientObject.mass_conversion_enabled = mass_conversion[0] + if mass_conversion[0] != False: + clientObject.mass_conversion_factor_in_direction_x = mass_conversion[1] + clientObject.mass_conversion_factor_in_direction_y = mass_conversion[2] + clientObject.mass_conversion_factor_in_direction_z = mass_conversion[3] + # Comment clientObject.comment = comment @@ -626,3 +346,242 @@ def SecondOrderPDelta (self, # Add Static Analysis Settings to client model clientModel.service.set_static_analysis_settings(clientObject) + +# def SecondOrderPDelta (self, +# no: int = 1, +# name: str = None, +# iterative_method = StaticAnalysisSettingsIterativeMethodForNonlinearAnalysis.NEWTON_RAPHSON, +# standard_precision_and_tolerance_settings = [False, None, None, None], +# control_nonlinear_analysis = [100, 1], +# load_modification = [False, None, None], +# favorable_effect_due_to_tension_in_members : bool = False, +# bourdon_effect: bool = True, +# nonsymmetric_direct_solver: bool = True, +# internal_forces_to_deformed_structure = [False, None, None, None], +# method_of_equation_system = StaticAnalysisSettingsMethodOfEquationSystem.METHOD_OF_EQUATION_SYSTEM_DIRECT, +# plate_bending_theory = StaticAnalysisSettingsPlateBendingTheory.PLATE_BENDING_THEORY_MINDLIN, +# mass_conversion = [False, None, None, None], +# comment: str = '', +# params: dict = {}): +# """ +# Args: +# no (int): +# name (str, optional): Static Analysis Name +# iterative_method (enum): Static Analysis Settings Iterative Method for Non-linear Analysis Enumeration +# standard_precision_and_tolerance_settings (list, optional): [standard_precision_and_tolerance_settings_enabled, precision_of_convergence_criteria_for_nonlinear_calculation, tolerance_for_detection_of_instability, robustness_of_iterative_calculation] +# control_nonlinear_analysis (list): [max_number_of_iterations, number_of_load_increments] +# loading_by_multiplier_factor (bool, optional): +# For loading_by_multiplier_factor == False: +# multiplier_factor = None +# dividing_results = None +# For loading_by_multiplier_factor == True: +# multiplier_factor = int +# dividing_results = bool +# favorable_effect_due_to_tension_in_members (bool, optional): +# bourdon_effect (bool, optional): +# nonsymmetric_direct_solver (bool, optional): +# internal_forces_to_deformed_structure (list, optional): [refer_internal_forces_to_deformed_structure, internal_forces_to_deformed_structure_for_moments, internal_forces_to_deformed_structure_for_normal_forces, internal_forces_to_deformed_structure_for_shear_forces] +# For refer_internal_forces_to_deformed_structure == False: +# internal_forces_to_deformed_structure_for_moments = None +# internal_forces_to_deformed_structure_for_normal_forces = None +# internal_forces_to_deformed_structure_for_shear_forces = None +# For refer_internal_forces_to_deformed_structure == True: +# internal_forces_to_deformed_structure_for_moments = bool +# internal_forces_to_deformed_structure_for_normal_forces = bool +# internal_forces_to_deformed_structure_for_shear_forces = bool +# method_of_equation_system (enum): Static Analysis Settings Method of Equation System Enumeration +# plate_bending_theory (enum): Static Analysis Settings Plate Bending Theory Enumeration +# mass_conversion (list, optional): [mass_conversion_enabled, mass_conversion_factor_in_direction_x, mass_conversion_factor_in_direction_y, mass_conversion_factor_in_direction_z] +# For mass_conversion_enabled == False: +# mass_conversion_factors = [None, None, None] +# For mass_conversion_enabled == True: +# mass_conversion_factors = [double, double, double] +# comment (str, optional): +# params (dict, optional): +# """ + +# # Client model +# clientObject = clientModel.factory.create('ns0:static_analysis_settings') + +# # Clears object atributes | Sets all atributes to None +# clearAtributes(clientObject) + +# # Static Analysis Settings No. +# clientObject.no = no + +# # Name +# if name != None: +# clientObject.user_defined_name_enabled = True +# clientObject.name = name + +# # Static Analysis Type +# clientObject.analysis_type = StaticAnalysisType.SECOND_ORDER_P_DELTA.name + +# # Iterative Method +# clientObject.iterative_method_for_nonlinear_analysis = iterative_method.name + +# # Standard Precision and Tolerance + +# clientObject.standard_precision_and_tolerance_settings_enabled = standard_precision_and_tolerance_settings_enabled +# clientObject.precision_of_convergence_criteria_for_nonlinear_calculation = precision_of_convergence_criteria_for_nonlinear_calculation +# clientObject.instability_detection_tolerance = tolerance_for_detection_of_instability +# clientObject.iterative_calculation_robustness = robustness_of_iterative_calculation + +# clientObject.standard_precision_and_tolerance_settings_enabled = standard_precision_and_tolerance_settings[0] +# clientObject.precision_of_convergence_criteria_for_nonlinear_calculation = standard_precision_and_tolerance_settings[1] +# clientObject.instability_detection_tolerance = standard_precision_and_tolerance_settings[2] +# clientObject.iterative_calculation_robustness = standard_precision_and_tolerance_settings[3] + +# if standard_precision_and_tolerance_settings_enabled != False: +# clientObject.precision_of_convergence_criteria_for_nonlinear_calculation = float +# clientObject.instability_detection_tolerance = float +# clientObject.iterative_calculation_robustness = float + +# if len(mass_conversion) != 4: +# raise Exception('WARNING: The standard precision and tolerance settings parameter needs to be of length 4. Kindly check list inputs for completeness and correctness.') + +# if type(standard_precision_and_tolerance_settings[0]) != bool : +# raise Exception ('WARNING: Enabling the standard precision and tolerance settings at index 0 to be of type "bool"') +# if type(standard_precision_and_tolerance_settings[1]) != float or type(standard_precision_and_tolerance_settings[1]) != int : +# raise Exception ('WARNING: Precision of convergence criteria for nonlinear calculation factor at index 1 to be of type "float" or "int"') +# if type(standard_precision_and_tolerance_settings[2]) != float or type(standard_precision_and_tolerance_settings[2]) != int : +# raise Exception ('WARNING: Tolerance for detection of instability factor at index 2 to be of type "float" or "int"') +# if type(standard_precision_and_tolerance_settings[3]) != float or type(standard_precision_and_tolerance_settings[3]) != int : +# raise Exception ('WARNING: Robustness of iterative calculation factor at index 3 to be of type "float" or "int"') + +# while not float(precision_of_convergence_criteria_for_nonlinear_calculation) or not int(precision_of_convergence_criteria_for_nonlinear_calculation) in range(0.01,100): +# raise Exception ('WARNING: Precision of convergence criteria for nonlinear calculations at index 1 is out of range. Input has to be in the range [0.01 ... 100].') + +# while not float(tolerance_for_detection_of_instability) or not int(tolerance_for_detection_of_instability) in range(0.01,100): +# raise Exception ('WARNING: Tolerance for detection of instability at index 2 is out of range. Input has to be in the range [0.01 ... 100].') + +# while not float(robustness_of_iterative_calculation) or not int(robustness_of_iterative_calculation) in range(1.00,100): +# raise Exception ('WARNING: Robustness of iterative calculation at index 3 is out of range. Input has to be in the range [1.00 ... 100].') + +# # Control nonlinear Analysis +# clientObject.max_number_of_iterations = control_nonlinear_analysis[0] +# clientObject.number_of_load_increments = control_nonlinear_analysis[1] + +# clientObject.max_number_of_iterations = max_number_of_iterations +# clientObject.number_of_load_increments = number_of_load_increments + +# if len(control_nonlinear_analysis) != 2: +# raise Exception('WARNING: The nonlinear analysis control parameter needs to be of length 2. Kindly check list inputs for completeness and correctness.') + +# if type(control_nonlinear_analysis[0]) != int : +# raise Exception ('WARNING: Enabling the standard precision and tolerance settings at index 0 to be of type "int"') +# if type(control_nonlinear_analysis[1]) != int : +# raise Exception ('WARNING: Precision of convergence criteria for nonlinear calculation factor at index 1 to be of type "int"') + + +# # Load Modification + +# clientObject.modify_loading_by_multiplier_factor = load_modification[0] +# clientObject.number_of_iterations_for_loading_prestress = load_modification[1] +# clientObject.divide_results_by_loading_factor = load_modification[2] + +# clientObject.modify_loading_by_multiplier_factor = loading_by_multiplier_factor +# clientObject.number_of_iterations_for_loading_prestress = multiplier_factor +# clientObject.divide_results_by_loading_factor = dividing_results + +# if loading_by_multiplier_factor != False: +# loading_by_multiplier_factor = True +# multiplier_factor = int +# dividing_results = bool + +# if len(load_modification) != 3: +# raise Exception('WARNING: The load modification parameter needs to be of length 3. Kindly check list inputs for completeness and correctness.') + +# if type(load_modification[0]) != bool : +# raise Exception ('WARNING: Load multiplier factor parameter at index 0 to be of type "int"') +# if type(load_modification[1]) != int : +# raise Exception ('WARNING: Multiplier factor parameter at index 1 to be of type "int"') +# if type(load_modification[2]) != bool : +# raise Exception ('WARNING: Dividing results parameter at index 0 to be of type "int"') + +# if loading_by_multiplier_factor != False: +# loading_by_multiplier_factor = True +# multiplier_factor = int +# dividing_results = bool + + +# # Effect due to Tension in Members +# clientObject.consider_favorable_effect_due_to_tension_in_members = favorable_effect_due_to_tension_in_members + + +# # Bourdon Effect Displacement +# clientObject.displacements_due_to_bourdon_effect = bourdon_effect + + +# # Nonsymetric Direct Solver +# clientObject.nonsymmetric_direct_solver = nonsymmetric_direct_solver + + +# # Internal Forces to Deformed Structure +# clientObject.refer_internal_forces_to_deformed_structure = refer_internal_forces_to_deformed_structure +# clientObject.refer_internal_forces_to_deformed_structure_for_moments = internal_forces_to_deformed_structure_for_moments +# clientObject.refer_internal_forces_to_deformed_structure_for_normal_forces = internal_forces_to_deformed_structure_for_normal_forces +# clientObject.refer_internal_forces_to_deformed_structure_for_shear_forces = internal_forces_to_deformed_structure_for_shear_forces + +# refer_internal_forces_to_deformed_structure = internal_forces_to_deformed_structure[0] +# internal_forces_to_deformed_structure_for_moments = internal_forces_to_deformed_structure[1] +# internal_forces_to_deformed_structure_for_normal_forces = internal_forces_to_deformed_structure[2] +# internal_forces_to_deformed_structure_for_shear_forces = internal_forces_to_deformed_structure[3] +# if refer_internal_forces_to_deformed_structure != False: +# internal_forces_to_deformed_structure_for_moments = bool +# internal_forces_to_deformed_structure_for_normal_forces = bool +# internal_forces_to_deformed_structure_for_shear_forces = bool + +# if len(internal_forces_to_deformed_structure) != 4: +# raise Exception('WARNING: The internal forces to deformed structure parameter needs to be of length 4. Kindly check list inputs for completeness and correctness.') +# if type(mass_conversion[0]) != bool : +# raise Exception ('WARNING: Refering internal forces to deformed structure at index 0 to be of type "bool"') +# if type(mass_conversion[1]) != bool : +# raise Exception ('WARNING: Internal forces to deformed structure for moments at index 1 to be of type "bool"') +# if type(mass_conversion[2]) != bool : +# raise Exception ('WARNING: Internal forces to deformed structure for normal forces at index 2 to be of type "bool"') +# if type(mass_conversion[3]) != bool : +# raise Exception ('WARNING: Internal forces to deformed structure for shear forces at index 3 to be of type "bool"') + +# # Equation System +# clientObject.method_of_equation_system = method_of_equation_system.name + +# # Plate Bending Theory +# clientObject.plate_bending_theory = plate_bending_theory.name + +# # Mass Conversion +# clientObject.mass_conversion_enabled = mass_conversion_enabled +# clientObject.mass_conversion_factor_in_direction_x = mass_conversion_factor_in_direction_x +# clientObject.mass_conversion_factor_in_direction_y = mass_conversion_factor_in_direction_y +# clientObject.mass_conversion_factor_in_direction_z = mass_conversion_factor_in_direction_z + +# mass_conversion_enabled = mass_conversion[0] +# mass_conversion_factor_in_direction_x = mass_conversion[1] +# mass_conversion_factor_in_direction_y = mass_conversion[2] +# mass_conversion_factor_in_direction_z = mass_conversion[3] +# if mass_conversion_enabled != False: +# mass_conversion_factor_in_direction_x = float +# mass_conversion_acceleration_in_direction_y = float +# mass_conversion_acceleration_in_direction_z = float + +# if len(mass_conversion) != 4: +# raise Exception('WARNING: The mass conversion parameter needs to be of length 4. Kindly check list inputs for completeness and correctness.') + +# if type(mass_conversion[0]) != bool : +# raise Exception ('WARNING: Enabling the mass conversion at index 0 to be of type "bool"') +# if type(mass_conversion[1]) != float or type(mass_conversion[1]) != int : +# raise Exception ('WARNING: Mass conversion factor in direction x at index 1 to be of type "float" or "int"') +# if type(mass_conversion[2]) != float or type(mass_conversion[2]) != int : +# raise Exception ('WARNING: Mass conversion factor in direction y at index 2 to be of type "float" or "int"') +# if type(mass_conversion[3]) != float or type(mass_conversion[3]) != int : +# raise Exception ('WARNING: Mass conversion factor in direction z at index 3 to be of type "float" or "int"') + +# # Comment +# clientObject.comment = comment + +# # Adding optional parameters via dictionary +# for key in params: +# clientObject[key] = params[key] + +# # Add Static Analysis Settings to client model +# clientModel.service.set_static_analysis_settings(clientObject) diff --git a/UnitTests/test_staticAnalysisSetting.py b/UnitTests/test_staticAnalysisSetting.py new file mode 100644 index 00000000..b1e857fc --- /dev/null +++ b/UnitTests/test_staticAnalysisSetting.py @@ -0,0 +1,34 @@ +import sys +sys.path.append(".") +import pytest +from RFEM.enums import * +from RFEM.LoadCasesAndCombinations.staticAnalysisSettings import * + +def test_default(): + + clientModel.service.begin_modification() + + # Set Base Settings + StaticAnalysisSettings(1, 'Geometrisch-linear', StaticAnalysisType.GEOMETRICALLY_LINEAR) + + clientModel.service.finish_modification() + +def test_GeometricallyLinear(): + + clientModel.service.begin_modification() + + # Set Base Settings + StaticAnalysisSettings.GeometricallyLinear(1,2,'Geometric-linear',[True, 1.5, True],False,False,StaticAnalysisSettingsMethodOfEquationSystem.METHOD_OF_EQUATION_SYSTEM_DIRECT,StaticAnalysisSettingsPlateBendingTheory.PLATE_BENDING_THEORY_MINDLIN,[True,0,0,1.0]) + + clientModel.service.finish_modification() + +def test_LargeDeformation(): + + clientModel.service.begin_modification() + + # Set Base Settings + StaticAnalysisSettings.LargeDeformation(1,standard_precision_and_tolerance_settings = [True, 0.01, 0.01, 1.0],) + + clientModel.service.finish_modification() + +test_LargeDeformation() \ No newline at end of file From 6b603bff25c49f0e69a75ce164179eaad671407c Mon Sep 17 00:00:00 2001 From: Jaroslav Broz Date: Fri, 12 Nov 2021 13:25:55 +0100 Subject: [PATCH 4/4] Fixed issues in staticAnalysisSettings --- .vscode/settings.json | 1 - RFEM/BasicObjects/bracing.py | 248 +++++----- RFEM/BasicObjects/frame.py | 212 ++++---- .../staticAnalysisSettings.py | 461 +++++++----------- UnitTests/report.html | 235 +-------- UnitTests/test_staticAnalysisSetting.py | 10 +- 6 files changed, 425 insertions(+), 742 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 093e81b4..740be252 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -8,7 +8,6 @@ "python.testing.pytestArgs": [ "--html=UnitTests\\report.html", "--self-contained-html", - "--cov=RFEM", ], "markdownlint.config": { "MD028": false, diff --git a/RFEM/BasicObjects/bracing.py b/RFEM/BasicObjects/bracing.py index 2ca1e2e5..7d0ff4d3 100644 --- a/RFEM/BasicObjects/bracing.py +++ b/RFEM/BasicObjects/bracing.py @@ -1,170 +1,170 @@ -from RFEM.initModel import * -from RFEM.enums import BracingType +# from RFEM.initModel import * +# from RFEM.enums import BracingType -class Bracing(): - def __init__(self, - no: int = 1, - member_type = BracingType.TYPE_HORIZONTAL, - start_node_no: int = 1, - end_node_no: int = 2, - rotation_angle: float = 0.0, - start_section_no: int = 1, - end_section_no: int = 1, - comment: str = '', - params: dict = {}): +# class Bracing(): +# def __init__(self, +# no: int = 1, +# member_type = BracingType.TYPE_HORIZONTAL, +# start_node_no: int = 1, +# end_node_no: int = 2, +# rotation_angle: float = 0.0, +# start_section_no: int = 1, +# end_section_no: int = 1, +# comment: str = '', +# params: dict = {}): - # Client model | Bracing - clientObject = clientModel.factory.create('ns0:bracing') +# # Client model | Bracing +# clientObject = clientModel.factory.create('ns0:bracing') - # Clears object atributes | Sets all atributes to None - clearAtributes(clientObject) +# # Clears object atributes | Sets all atributes to None +# clearAtributes(clientObject) - # Bracing No. - clientObject.no = no +# # Bracing No. +# clientObject.no = no - # Bracing Type - clientObject.type = bracing_type.name +# # Bracing Type +# clientObject.type = bracing_type.name - # Start Node No. - clientObject.node_start = start_node_no +# # Start Node No. +# clientObject.node_start = start_node_no - # End Node No. - clientObject.node_end = end_node_no +# # End Node No. +# clientObject.node_end = end_node_no - # Bracing Rotation Angle beta - clientObject.rotation_angle = rotation_angle +# # Bracing Rotation Angle beta +# clientObject.rotation_angle = rotation_angle - # Start Section No. - clientObject.section_start = start_section_no +# # Start Section No. +# clientObject.section_start = start_section_no - # End Section No. - clientObject.section_end = end_section_no +# # End Section No. +# clientObject.section_end = end_section_no - # Start Bracing Hinge No. - clientObject.bracing_hinge_start = start_bracing_hinge_no +# # Start Bracing Hinge No. +# clientObject.bracing_hinge_start = start_bracing_hinge_no - # End Bracing Hinge No. - clientObject.bracing_hinge_end = end_bracing_hinge_no +# # End Bracing Hinge No. +# clientObject.bracing_hinge_end = end_bracing_hinge_no - # Comment - clientObject.comment = comment +# # Comment +# clientObject.comment = comment - # Adding optional parameters via dictionary - for key in params: - clientObject[key] = params[key] +# # Adding optional parameters via dictionary +# for key in params: +# clientObject[key] = params[key] - # Add Member to client model - clientModel.service.set_bracing(clientObject) +# # Add Member to client model +# clientModel.service.set_bracing(clientObject) - def Horizontal(self, - no: int = 1, - bracing_type = BracingType.TYPE_HORIZONTAL, - start_node_no: int = 1, - end_node_no: int = 2, - rotation_angle: float = 0.0, - start_section_no: int = 1, - end_section_no: int = 1, - start_bracing_hinge_no: int = 0, - end_bracing_hinge_no: int = 0, - comment: str = '', - params: dict = {}): +# def Horizontal(self, +# no: int = 1, +# bracing_type = BracingType.TYPE_HORIZONTAL, +# start_node_no: int = 1, +# end_node_no: int = 2, +# rotation_angle: float = 0.0, +# start_section_no: int = 1, +# end_section_no: int = 1, +# start_bracing_hinge_no: int = 0, +# end_bracing_hinge_no: int = 0, +# comment: str = '', +# params: dict = {}): - # Client model | Bracing - clientObject = clientModel.factory.create('ns0:bracing') +# # Client model | Bracing +# clientObject = clientModel.factory.create('ns0:bracing') - # Clears object atributes | Sets all atributes to None - clearAtributes(clientObject) +# # Clears object atributes | Sets all atributes to None +# clearAtributes(clientObject) - # Bracing No. - clientObject.no = no +# # Bracing No. +# clientObject.no = no - # Bracing Type - clientObject.type = bracing_type.name +# # Bracing Type +# clientObject.type = bracing_type.name - # Start Node No. - clientObject.node_start = start_node_no +# # Start Node No. +# clientObject.node_start = start_node_no - # End Node No. - clientObject.node_end = end_node_no +# # End Node No. +# clientObject.node_end = end_node_no - # Bracing Rotation Angle beta - clientObject.rotation_angle = rotation_angle +# # Bracing Rotation Angle beta +# clientObject.rotation_angle = rotation_angle - # Start Section No. - clientObject.section_start = start_section_no +# # Start Section No. +# clientObject.section_start = start_section_no - # End Section No. - clientObject.section_end = end_section_no +# # End Section No. +# clientObject.section_end = end_section_no - # Start Bracing Hinge No. - clientObject.bracing_hinge_start = start_bracing_hinge_no +# # Start Bracing Hinge No. +# clientObject.bracing_hinge_start = start_bracing_hinge_no - # End Bracing Hinge No. - clientObject.bracing_hinge_end = end_bracing_hinge_no +# # End Bracing Hinge No. +# clientObject.bracing_hinge_end = end_bracing_hinge_no - # Comment - clientObject.comment = comment +# # Comment +# clientObject.comment = comment - # Adding optional parameters via dictionary - for key in params: - clientObject[key] = params[key] +# # Adding optional parameters via dictionary +# for key in params: +# clientObject[key] = params[key] - # Add Bracing to client model - clientModel.service.set_bracing(clientObject) +# # Add Bracing to client model +# clientModel.service.set_bracing(clientObject) - def Vertical(self, - no: int = 1, - bracing_type = BracingType.TYPE_VERTICAL, - start_node_no: int = 1, - end_node_no: int = 2, - rotation_angle: float = 0.0, - start_section_no: int = 1, - end_section_no: int = 1, - start_bracing_hinge_no: int = 0, - end_bracing_hinge_no: int = 0, - comment: str = '', - params: dict = {}): +# def Vertical(self, +# no: int = 1, +# bracing_type = BracingType.TYPE_VERTICAL, +# start_node_no: int = 1, +# end_node_no: int = 2, +# rotation_angle: float = 0.0, +# start_section_no: int = 1, +# end_section_no: int = 1, +# start_bracing_hinge_no: int = 0, +# end_bracing_hinge_no: int = 0, +# comment: str = '', +# params: dict = {}): - # Client model | Bracing - clientObject = clientModel.factory.create('ns0:bracing') +# # Client model | Bracing +# clientObject = clientModel.factory.create('ns0:bracing') - # Clears object atributes | Sets all atributes to None - clearAtributes(clientObject) +# # Clears object atributes | Sets all atributes to None +# clearAtributes(clientObject) - # Bracing No. - clientObject.no = no +# # Bracing No. +# clientObject.no = no - # Bracing Type - clientObject.type = bracing_type.name +# # Bracing Type +# clientObject.type = bracing_type.name - # Start Node No. - clientObject.node_start = start_node_no +# # Start Node No. +# clientObject.node_start = start_node_no - # End Node No. - clientObject.node_end = end_node_no +# # End Node No. +# clientObject.node_end = end_node_no - # Bracing Rotation Angle beta - clientObject.rotation_angle = rotation_angle +# # Bracing Rotation Angle beta +# clientObject.rotation_angle = rotation_angle - # Start Section No. - clientObject.section_start = start_section_no +# # Start Section No. +# clientObject.section_start = start_section_no - # End Section No. - clientObject.section_end = end_section_no +# # End Section No. +# clientObject.section_end = end_section_no - # Start Bracing Hinge No. - clientObject.bracing_hinge_start = start_bracing_hinge_no +# # Start Bracing Hinge No. +# clientObject.bracing_hinge_start = start_bracing_hinge_no - # End Bracing Hinge No. - clientObject.bracing_hinge_end = end_bracing_hinge_no +# # End Bracing Hinge No. +# clientObject.bracing_hinge_end = end_bracing_hinge_no - # Comment - clientObject.comment = comment +# # Comment +# clientObject.comment = comment - # Adding optional parameters via dictionary - for key in params: - clientObject[key] = params[key] +# # Adding optional parameters via dictionary +# for key in params: +# clientObject[key] = params[key] - # Add Bracing to client model - clientModel.service.set_bracing(clientObject) +# # Add Bracing to client model +# clientModel.service.set_bracing(clientObject) diff --git a/RFEM/BasicObjects/frame.py b/RFEM/BasicObjects/frame.py index e7b80996..7a945307 100644 --- a/RFEM/BasicObjects/frame.py +++ b/RFEM/BasicObjects/frame.py @@ -1,106 +1,106 @@ -from RFEM.initModel import * - -class Frame(): - def __init__(self, - number_of_frames: int = 1, - span_l: int = 2, - height_h: int = 1, - column_cross_section: 1, - column_member_type = MemberType.TYPE_BEAM, - girder_cross_section: 2, - girder_member_type = MemberType.TYPE_BEAM, - support_type = NodalSupportType.HINGED, - insertion_point_x: int = 3, - insertion_point_y: int = 4, - insertion_point_z: int = 3, - comment: str = '', - params: dict = {}): - - # Client model | Frame - clientObject = clientModel.factory.create('ns0:member') - - # Clears object atributes | Sets all atributes to None - clearAtributes(clientObject) - - ------------------------------------------------------------------------- - # Number of frames: da soll man eine Funktion zu clientModel. herstellen... oder? - - i = 1 - while i <= n: - j = (i-1) * 5 - Node(j+1, 0.0, -(i-1)*d, 0.0) - Node(j+2, 0.0, -(i-1)*d, -h) - Node(j+3, l/2, -(i-1)*d, -h) - Node(j+4, l, -(i-1)*d, -h) - Node(j+5, l, -(i-1)*d, 0.0) - i += 1 - - # Nodal Supports - i = 1 - nodes_no = "" - while i <= n: - j = (i-1) * 5 - nodes_no += str(j+1) + " " - nodes_no += str(j+5) + " " - i += 1 - nodes_no = nodes_no.rstrip(nodes_no[-1]) - NodalSupport(1, nodes_no, NodalSupportType.HINGED, "Hinged support") - - #members: what's about the sections? maybe an input field where the user gives the materials - Material (1 , 'S235') - Material (2, 'C25/30') - - Section (1, 'HEM 700',1) - Section (2, 'IPE 500',1) - - #members x direction - i = 1 - while i <= n: - j = (i-1) * 5 - k = (i-1) * 4 - Member(k+1, MemberType.TYPE_BEAM, j+1, j+2, 0.0, 1, 1) - Member(k+2, MemberType.TYPE_BEAM, j+2, j+3, 0.0, 2, 2) - Member(k+3, MemberType.TYPE_BEAM, j+3, j+4, 0.0, 2, 2) - Member(k+4, MemberType.TYPE_BEAM, j+4, j+5, 0.0, 1, 1) - i += 1 - print(k+1,k+2,k+3,k+4) - - #members y direction - i = 1 - while i <= n-1: - j = (i-1) * 5 - print(k+4+2*(i-1)+1, k+4+2*(i-1)+2) - Member(int(k+4+2*(i-1)+1), MemberType.TYPE_BEAM, j+2, j+7, 0.0, 2, 2) - Member(int(k+4+2*(i-1)+2), MemberType.TYPE_BEAM, j+4, j+9, 0.0, 2, 2) - i += 1 - - ------------------------------------------------------------------------- - - clientObject. = NodeType.TYPE_BETWEEN_TWO_NODES.name - = column_cross_section - - #column cross section - clientobject. = columnn_cross_section.name - - #column member type - clientObject.type = column_member_type.name - - #girder cross section - clientobject. = girder_cross_section.name - - #girder member type - clientObject.type = girder_member_type.name - - # Nodal Support - - clientObject. = support_type.name - - # Comment - clientObject.comment = comment - - # Adding optional parameters via dictionary - for key in params: - clientObject[key] = params[key] - - # Add Member to client model - clientModel.service.set_frame(clientObject) +# from RFEM.initModel import * + +# class Frame(): +# def __init__(self, +# number_of_frames: int = 1, +# span_l: int = 2, +# height_h: int = 1, +# column_cross_section: 1, +# column_member_type = MemberType.TYPE_BEAM, +# girder_cross_section: 2, +# girder_member_type = MemberType.TYPE_BEAM, +# support_type = NodalSupportType.HINGED, +# insertion_point_x: int = 3, +# insertion_point_y: int = 4, +# insertion_point_z: int = 3, +# comment: str = '', +# params: dict = {}): + +# # Client model | Frame +# clientObject = clientModel.factory.create('ns0:member') + +# # Clears object atributes | Sets all atributes to None +# clearAtributes(clientObject) + +# ------------------------------------------------------------------------- +# # Number of frames: da soll man eine Funktion zu clientModel. herstellen... oder? + +# i = 1 +# while i <= n: +# j = (i-1) * 5 +# Node(j+1, 0.0, -(i-1)*d, 0.0) +# Node(j+2, 0.0, -(i-1)*d, -h) +# Node(j+3, l/2, -(i-1)*d, -h) +# Node(j+4, l, -(i-1)*d, -h) +# Node(j+5, l, -(i-1)*d, 0.0) +# i += 1 + +# # Nodal Supports +# i = 1 +# nodes_no = "" +# while i <= n: +# j = (i-1) * 5 +# nodes_no += str(j+1) + " " +# nodes_no += str(j+5) + " " +# i += 1 +# nodes_no = nodes_no.rstrip(nodes_no[-1]) +# NodalSupport(1, nodes_no, NodalSupportType.HINGED, "Hinged support") + +# #members: what's about the sections? maybe an input field where the user gives the materials +# Material (1 , 'S235') +# Material (2, 'C25/30') + +# Section (1, 'HEM 700',1) +# Section (2, 'IPE 500',1) + +# #members x direction +# i = 1 +# while i <= n: +# j = (i-1) * 5 +# k = (i-1) * 4 +# Member(k+1, MemberType.TYPE_BEAM, j+1, j+2, 0.0, 1, 1) +# Member(k+2, MemberType.TYPE_BEAM, j+2, j+3, 0.0, 2, 2) +# Member(k+3, MemberType.TYPE_BEAM, j+3, j+4, 0.0, 2, 2) +# Member(k+4, MemberType.TYPE_BEAM, j+4, j+5, 0.0, 1, 1) +# i += 1 +# print(k+1,k+2,k+3,k+4) + +# #members y direction +# i = 1 +# while i <= n-1: +# j = (i-1) * 5 +# print(k+4+2*(i-1)+1, k+4+2*(i-1)+2) +# Member(int(k+4+2*(i-1)+1), MemberType.TYPE_BEAM, j+2, j+7, 0.0, 2, 2) +# Member(int(k+4+2*(i-1)+2), MemberType.TYPE_BEAM, j+4, j+9, 0.0, 2, 2) +# i += 1 + +# ------------------------------------------------------------------------- + +# clientObject. = NodeType.TYPE_BETWEEN_TWO_NODES.name +# = column_cross_section + +# #column cross section +# clientobject. = columnn_cross_section.name + +# #column member type +# clientObject.type = column_member_type.name + +# #girder cross section +# clientobject. = girder_cross_section.name + +# #girder member type +# clientObject.type = girder_member_type.name + +# # Nodal Support + +# clientObject. = support_type.name + +# # Comment +# clientObject.comment = comment + +# # Adding optional parameters via dictionary +# for key in params: +# clientObject[key] = params[key] + +# # Add Member to client model +# clientModel.service.set_frame(clientObject) diff --git a/RFEM/LoadCasesAndCombinations/staticAnalysisSettings.py b/RFEM/LoadCasesAndCombinations/staticAnalysisSettings.py index a3ea8278..3e815548 100644 --- a/RFEM/LoadCasesAndCombinations/staticAnalysisSettings.py +++ b/RFEM/LoadCasesAndCombinations/staticAnalysisSettings.py @@ -63,21 +63,11 @@ def GeometricallyLinear(self, no (int): name (str, optional): Static Analysis Name load_modification (list, optional): [loading_by_multiplier_factor, multiplier_factor, dividing_results] - For loading_by_multiplier_factor == False: - multiplier_factor = None - dividing_results = None - For loading_by_multiplier_factor == True: - multiplier_factor = int - dividing_results = bool bourdon_effect (bool, optional): nonsymmetric_direct_solver (bool, optional): method_of_equation_system (enum): Static Analysis Settings Method of Equation System Enumeration plate_bending_theory (enum): Static Analysis Settings Plate Bending Theory Enumeration mass_conversion (list, optional): [mass_conversion_enabled, mass_conversion_factor_in_direction_x, mass_conversion_factor_in_direction_y, mass_conversion_factor_in_direction_z] - For mass_conversion_enabled == False: - mass_conversion_factors = [None, None, None] - For mass_conversion_enabled == True: - mass_conversion_factors = [double, double, double] comment (str, optional): params (dict, optional): """ @@ -99,6 +89,17 @@ def GeometricallyLinear(self, # Static Analysis Type clientObject.analysis_type = StaticAnalysisType.GEOMETRICALLY_LINEAR.name + # Bourdon Effect Displacement + clientObject.displacements_due_to_bourdon_effect = bourdon_effect + + # Nonsymetric Direct Solver + clientObject.nonsymmetric_direct_solver = nonsymmetric_direct_solver + + # Equation System + clientObject.method_of_equation_system = method_of_equation_system.name + + # Plate Bending Theory + clientObject.plate_bending_theory = plate_bending_theory.name # Load Modification if len(load_modification) != 3: raise Exception('WARNING: The load modification parameter needs to be of length 3. Kindly check list inputs for completeness and correctness.') @@ -114,26 +115,12 @@ def GeometricallyLinear(self, clientObject.modify_loading_by_multiplier_factor = True clientObject.loading_multiplier_factor = load_modification[1] clientObject.divide_results_by_loading_factor = load_modification[2] - - # Bourdon Effect Displacement - clientObject.displacements_due_to_bourdon_effect = bourdon_effect - - # Nonsymetric Direct Solver - clientObject.nonsymmetric_direct_solver = nonsymmetric_direct_solver - - # Equation System - clientObject.method_of_equation_system = method_of_equation_system.name - - # Plate Bending Theory - clientObject.plate_bending_theory = plate_bending_theory.name - - # mass_conversion_enabled = mass_conversion[0] # mass_conversion_factor_in_direction_x = mass_conversion[1] # mass_conversion_factor_in_direction_y = mass_conversion[2] # mass_conversion_factor_in_direction_z = mass_conversion[3] - + # mass_conversion_factor_in_direction_x = float # mass_conversion_acceleration_in_direction_y = float # mass_conversion_acceleration_in_direction_z = float @@ -149,13 +136,12 @@ def GeometricallyLinear(self, # raise Exception ('WARNING: Mass conversion factor in direction y at index 2 has to be of type "float" or "int"') # if type(mass_conversion[3]) != float or type(mass_conversion[3]) != int : # raise Exception ('WARNING: Mass conversion factor in direction z at index 3 has to be of type "float" or "int"') - + clientObject.mass_conversion_enabled = mass_conversion[0] if mass_conversion[0] != False: clientObject.mass_conversion_factor_in_direction_x = mass_conversion[1] clientObject.mass_conversion_factor_in_direction_y = mass_conversion[2] clientObject.mass_conversion_factor_in_direction_z = mass_conversion[3] - # Comment clientObject.comment = comment @@ -170,7 +156,7 @@ def LargeDeformation(self, no: int = 1, name: str = None, iterative_method = StaticAnalysisSettingsIterativeMethodForNonlinearAnalysis.NEWTON_RAPHSON, - standard_precision_and_tolerance_settings = [False, 0.01, 0.01, 1.0], + standard_precision_and_tolerance_settings = [False, 1.0, 1.0, 1.0], control_nonlinear_analysis = [100, 1], load_modification = [False, 1, False], instabil_structure_calculation : bool = True, @@ -196,22 +182,12 @@ def LargeDeformation(self, standard_precision_and_tolerance_settings (list, optional): [standard_precision_and_tolerance_settings_enabled, precision_of_convergence_criteria_for_nonlinear_calculation, tolerance_for_detection_of_instability, robustness_of_iterative_calculation] control_nonlinear_analysis (list): [max_number_of_iterations, number_of_load_increments] load_modification (list, optional): [loading_by_multiplier_factor, multiplier_factor, dividing_results] - For loading_by_multiplier_factor == False: - multiplier_factor = None - dividing_results = None - For loading_by_multiplier_factor == True: - multiplier_factor = int - dividing_results = bool instabil_structure_calculation (bool, optional): bourdon_effect (bool, optional): nonsymmetric_direct_solver (bool, optional): method_of_equation_system (enum): Static Analysis Settings Method of Equation System Enumeration plate_bending_theory (enum): Static Analysis Settings Plate Bending Theory Enumeration mass_conversion (list, optional): [mass_conversion_enabled, mass_conversion_factor_in_direction_x, mass_conversion_factor_in_direction_y, mass_conversion_factor_in_direction_z] - For mass_conversion_enabled == False: - mass_conversion_factors = [None, None, None] - For mass_conversion_enabled == True: - mass_conversion_factors = [double, double, double] comment (str, optional): params (dict, optional): """ @@ -272,7 +248,7 @@ def LargeDeformation(self, clientObject.precision_of_convergence_criteria_for_nonlinear_calculation = standard_precision_and_tolerance_settings[1] clientObject.instability_detection_tolerance = standard_precision_and_tolerance_settings[2] clientObject.iterative_calculation_robustness = standard_precision_and_tolerance_settings[3] - + # Control nonlinear Analysis if len(control_nonlinear_analysis) != 2: raise Exception('WARNING: The nonlinear analysis control parameter needs to be of length 2. Kindly check list inputs for completeness and correctness.') @@ -284,8 +260,6 @@ def LargeDeformation(self, clientObject.max_number_of_iterations = control_nonlinear_analysis[0] clientObject.number_of_load_increments = control_nonlinear_analysis[1] - - ## Load Modification if len(load_modification) != 3: raise Exception('WARNING: The load modification parameter needs to be of length 3. Kindly check list inputs for completeness and correctness.') @@ -301,7 +275,6 @@ def LargeDeformation(self, clientObject.modify_loading_by_multiplier_factor = True clientObject.loading_multiplier_factor = load_modification[1] clientObject.divide_results_by_loading_factor = load_modification[2] - dividing_results = bool # Instabil Structure clientObject.try_to_calculate_instabil_structure = instabil_structure_calculation @@ -318,7 +291,6 @@ def LargeDeformation(self, # Plate Bending Theory clientObject.plate_bending_theory = plate_bending_theory.name - # Mass Conversion # Mass Conversion if len(mass_conversion) != 4: raise Exception('WARNING: The mass conversion parameter needs to be of length 4. Kindly check list inputs for completeness and correctness.') @@ -330,13 +302,13 @@ def LargeDeformation(self, # raise Exception ('WARNING: Mass conversion factor in direction y at index 2 has to be of type "float" or "int"') # if type(mass_conversion[3]) != float or type(mass_conversion[3]) != int : # raise Exception ('WARNING: Mass conversion factor in direction z at index 3 has to be of type "float" or "int"') - + clientObject.mass_conversion_enabled = mass_conversion[0] if mass_conversion[0] != False: clientObject.mass_conversion_factor_in_direction_x = mass_conversion[1] clientObject.mass_conversion_factor_in_direction_y = mass_conversion[2] clientObject.mass_conversion_factor_in_direction_z = mass_conversion[3] - + # Comment clientObject.comment = comment @@ -347,241 +319,170 @@ def LargeDeformation(self, # Add Static Analysis Settings to client model clientModel.service.set_static_analysis_settings(clientObject) -# def SecondOrderPDelta (self, -# no: int = 1, -# name: str = None, -# iterative_method = StaticAnalysisSettingsIterativeMethodForNonlinearAnalysis.NEWTON_RAPHSON, -# standard_precision_and_tolerance_settings = [False, None, None, None], -# control_nonlinear_analysis = [100, 1], -# load_modification = [False, None, None], -# favorable_effect_due_to_tension_in_members : bool = False, -# bourdon_effect: bool = True, -# nonsymmetric_direct_solver: bool = True, -# internal_forces_to_deformed_structure = [False, None, None, None], -# method_of_equation_system = StaticAnalysisSettingsMethodOfEquationSystem.METHOD_OF_EQUATION_SYSTEM_DIRECT, -# plate_bending_theory = StaticAnalysisSettingsPlateBendingTheory.PLATE_BENDING_THEORY_MINDLIN, -# mass_conversion = [False, None, None, None], -# comment: str = '', -# params: dict = {}): -# """ -# Args: -# no (int): -# name (str, optional): Static Analysis Name -# iterative_method (enum): Static Analysis Settings Iterative Method for Non-linear Analysis Enumeration -# standard_precision_and_tolerance_settings (list, optional): [standard_precision_and_tolerance_settings_enabled, precision_of_convergence_criteria_for_nonlinear_calculation, tolerance_for_detection_of_instability, robustness_of_iterative_calculation] -# control_nonlinear_analysis (list): [max_number_of_iterations, number_of_load_increments] -# loading_by_multiplier_factor (bool, optional): -# For loading_by_multiplier_factor == False: -# multiplier_factor = None -# dividing_results = None -# For loading_by_multiplier_factor == True: -# multiplier_factor = int -# dividing_results = bool -# favorable_effect_due_to_tension_in_members (bool, optional): -# bourdon_effect (bool, optional): -# nonsymmetric_direct_solver (bool, optional): -# internal_forces_to_deformed_structure (list, optional): [refer_internal_forces_to_deformed_structure, internal_forces_to_deformed_structure_for_moments, internal_forces_to_deformed_structure_for_normal_forces, internal_forces_to_deformed_structure_for_shear_forces] -# For refer_internal_forces_to_deformed_structure == False: -# internal_forces_to_deformed_structure_for_moments = None -# internal_forces_to_deformed_structure_for_normal_forces = None -# internal_forces_to_deformed_structure_for_shear_forces = None -# For refer_internal_forces_to_deformed_structure == True: -# internal_forces_to_deformed_structure_for_moments = bool -# internal_forces_to_deformed_structure_for_normal_forces = bool -# internal_forces_to_deformed_structure_for_shear_forces = bool -# method_of_equation_system (enum): Static Analysis Settings Method of Equation System Enumeration -# plate_bending_theory (enum): Static Analysis Settings Plate Bending Theory Enumeration -# mass_conversion (list, optional): [mass_conversion_enabled, mass_conversion_factor_in_direction_x, mass_conversion_factor_in_direction_y, mass_conversion_factor_in_direction_z] -# For mass_conversion_enabled == False: -# mass_conversion_factors = [None, None, None] -# For mass_conversion_enabled == True: -# mass_conversion_factors = [double, double, double] -# comment (str, optional): -# params (dict, optional): -# """ - -# # Client model -# clientObject = clientModel.factory.create('ns0:static_analysis_settings') - -# # Clears object atributes | Sets all atributes to None -# clearAtributes(clientObject) - -# # Static Analysis Settings No. -# clientObject.no = no - -# # Name -# if name != None: -# clientObject.user_defined_name_enabled = True -# clientObject.name = name - -# # Static Analysis Type -# clientObject.analysis_type = StaticAnalysisType.SECOND_ORDER_P_DELTA.name - -# # Iterative Method -# clientObject.iterative_method_for_nonlinear_analysis = iterative_method.name - -# # Standard Precision and Tolerance - -# clientObject.standard_precision_and_tolerance_settings_enabled = standard_precision_and_tolerance_settings_enabled -# clientObject.precision_of_convergence_criteria_for_nonlinear_calculation = precision_of_convergence_criteria_for_nonlinear_calculation -# clientObject.instability_detection_tolerance = tolerance_for_detection_of_instability -# clientObject.iterative_calculation_robustness = robustness_of_iterative_calculation - -# clientObject.standard_precision_and_tolerance_settings_enabled = standard_precision_and_tolerance_settings[0] -# clientObject.precision_of_convergence_criteria_for_nonlinear_calculation = standard_precision_and_tolerance_settings[1] -# clientObject.instability_detection_tolerance = standard_precision_and_tolerance_settings[2] -# clientObject.iterative_calculation_robustness = standard_precision_and_tolerance_settings[3] - -# if standard_precision_and_tolerance_settings_enabled != False: -# clientObject.precision_of_convergence_criteria_for_nonlinear_calculation = float -# clientObject.instability_detection_tolerance = float -# clientObject.iterative_calculation_robustness = float - -# if len(mass_conversion) != 4: -# raise Exception('WARNING: The standard precision and tolerance settings parameter needs to be of length 4. Kindly check list inputs for completeness and correctness.') - -# if type(standard_precision_and_tolerance_settings[0]) != bool : -# raise Exception ('WARNING: Enabling the standard precision and tolerance settings at index 0 to be of type "bool"') -# if type(standard_precision_and_tolerance_settings[1]) != float or type(standard_precision_and_tolerance_settings[1]) != int : -# raise Exception ('WARNING: Precision of convergence criteria for nonlinear calculation factor at index 1 to be of type "float" or "int"') -# if type(standard_precision_and_tolerance_settings[2]) != float or type(standard_precision_and_tolerance_settings[2]) != int : -# raise Exception ('WARNING: Tolerance for detection of instability factor at index 2 to be of type "float" or "int"') -# if type(standard_precision_and_tolerance_settings[3]) != float or type(standard_precision_and_tolerance_settings[3]) != int : -# raise Exception ('WARNING: Robustness of iterative calculation factor at index 3 to be of type "float" or "int"') - -# while not float(precision_of_convergence_criteria_for_nonlinear_calculation) or not int(precision_of_convergence_criteria_for_nonlinear_calculation) in range(0.01,100): -# raise Exception ('WARNING: Precision of convergence criteria for nonlinear calculations at index 1 is out of range. Input has to be in the range [0.01 ... 100].') - -# while not float(tolerance_for_detection_of_instability) or not int(tolerance_for_detection_of_instability) in range(0.01,100): -# raise Exception ('WARNING: Tolerance for detection of instability at index 2 is out of range. Input has to be in the range [0.01 ... 100].') - -# while not float(robustness_of_iterative_calculation) or not int(robustness_of_iterative_calculation) in range(1.00,100): -# raise Exception ('WARNING: Robustness of iterative calculation at index 3 is out of range. Input has to be in the range [1.00 ... 100].') - -# # Control nonlinear Analysis -# clientObject.max_number_of_iterations = control_nonlinear_analysis[0] -# clientObject.number_of_load_increments = control_nonlinear_analysis[1] - -# clientObject.max_number_of_iterations = max_number_of_iterations -# clientObject.number_of_load_increments = number_of_load_increments - -# if len(control_nonlinear_analysis) != 2: -# raise Exception('WARNING: The nonlinear analysis control parameter needs to be of length 2. Kindly check list inputs for completeness and correctness.') - -# if type(control_nonlinear_analysis[0]) != int : -# raise Exception ('WARNING: Enabling the standard precision and tolerance settings at index 0 to be of type "int"') -# if type(control_nonlinear_analysis[1]) != int : -# raise Exception ('WARNING: Precision of convergence criteria for nonlinear calculation factor at index 1 to be of type "int"') - - -# # Load Modification - -# clientObject.modify_loading_by_multiplier_factor = load_modification[0] -# clientObject.number_of_iterations_for_loading_prestress = load_modification[1] -# clientObject.divide_results_by_loading_factor = load_modification[2] - -# clientObject.modify_loading_by_multiplier_factor = loading_by_multiplier_factor -# clientObject.number_of_iterations_for_loading_prestress = multiplier_factor -# clientObject.divide_results_by_loading_factor = dividing_results - -# if loading_by_multiplier_factor != False: -# loading_by_multiplier_factor = True -# multiplier_factor = int -# dividing_results = bool - -# if len(load_modification) != 3: -# raise Exception('WARNING: The load modification parameter needs to be of length 3. Kindly check list inputs for completeness and correctness.') - -# if type(load_modification[0]) != bool : -# raise Exception ('WARNING: Load multiplier factor parameter at index 0 to be of type "int"') -# if type(load_modification[1]) != int : -# raise Exception ('WARNING: Multiplier factor parameter at index 1 to be of type "int"') -# if type(load_modification[2]) != bool : -# raise Exception ('WARNING: Dividing results parameter at index 0 to be of type "int"') + def SecondOrderPDelta (self, + no: int = 1, + name: str = None, + iterative_method = StaticAnalysisSettingsIterativeMethodForNonlinearAnalysis.NEWTON_RAPHSON, + standard_precision_and_tolerance_settings = [False, 1.0, 1.0, 1.0], + control_nonlinear_analysis = [100, 1], + load_modification = [False, 0, False], + favorable_effect_due_to_tension_in_members : bool = False, + bourdon_effect: bool = True, + nonsymmetric_direct_solver: bool = True, + internal_forces_to_deformed_structure = [True, True, True, True], + method_of_equation_system = StaticAnalysisSettingsMethodOfEquationSystem.METHOD_OF_EQUATION_SYSTEM_DIRECT, + plate_bending_theory = StaticAnalysisSettingsPlateBendingTheory.PLATE_BENDING_THEORY_MINDLIN, + mass_conversion = [False, 0, 0, 1], + comment: str = '', + params: dict = {}): + """ + Args: + no (int): + name (str, optional): Static Analysis Name + iterative_method (enum): Static Analysis Settings Iterative Method for Non-linear Analysis Enumeration + standard_precision_and_tolerance_settings (list, optional): [standard_precision_and_tolerance_settings_enabled, precision_of_convergence_criteria_for_nonlinear_calculation, tolerance_for_detection_of_instability, robustness_of_iterative_calculation] + control_nonlinear_analysis (list): [max_number_of_iterations, number_of_load_increments] + favorable_effect_due_to_tension_in_members (bool, optional): + bourdon_effect (bool, optional): + nonsymmetric_direct_solver (bool, optional): + internal_forces_to_deformed_structure (list, optional): [refer_internal_forces_to_deformed_structure, internal_forces_to_deformed_structure_for_moments, internal_forces_to_deformed_structure_for_normal_forces, internal_forces_to_deformed_structure_for_shear_forces] + method_of_equation_system (enum): Static Analysis Settings Method of Equation System Enumeration + plate_bending_theory (enum): Static Analysis Settings Plate Bending Theory Enumeration + mass_conversion (list, optional): [mass_conversion_enabled, mass_conversion_factor_in_direction_x, mass_conversion_factor_in_direction_y, mass_conversion_factor_in_direction_z] + comment (str, optional): + params (dict, optional): + """ + + # Client model + clientObject = clientModel.factory.create('ns0:static_analysis_settings') + + # Clears object atributes | Sets all atributes to None + clearAtributes(clientObject) + + # Static Analysis Settings No. + clientObject.no = no + + # Name + if name != None: + clientObject.user_defined_name_enabled = True + clientObject.name = name + + # Static Analysis Type + clientObject.analysis_type = StaticAnalysisType.SECOND_ORDER_P_DELTA.name + + # Iterative Method + clientObject.iterative_method_for_nonlinear_analysis = iterative_method.name + + # Standard Precision and Tolerance + # if standard_precision_and_tolerance_settings_enabled != False: + # clientObject.precision_of_convergence_criteria_for_nonlinear_calculation = float + # clientObject.instability_detection_tolerance = float + # clientObject.iterative_calculation_robustness = float + if len(standard_precision_and_tolerance_settings) != 4: + raise Exception('WARNING: The standard precision and tolerance settings parameter needs to be of length 4. Kindly check list inputs for completeness and correctness.') + + if type(standard_precision_and_tolerance_settings[0]) != bool : + raise Exception ('WARNING: Enabling the standard precision and tolerance settings at index 0 to be of type "bool"') + # if type(standard_precision_and_tolerance_settings[1]) != float or type(standard_precision_and_tolerance_settings[1]) != int: + # raise Exception ('WARNING: Precision of convergence criteria for nonlinear calculation factor at index 1 to be of type "float" or "int"') + # if type(standard_precision_and_tolerance_settings[2]) != float or type(standard_precision_and_tolerance_settings[2]) != int: + # raise Exception ('WARNING: Tolerance for detection of instability factor at index 2 to be of type "float" or "int"') + # if type(standard_precision_and_tolerance_settings[3]) != float or type(standard_precision_and_tolerance_settings[3]) != int: + # raise Exception ('WARNING: Robustness of iterative calculation factor at index 3 to be of type "float" or "int"') + + # while not float(standard_precision_and_tolerance_settings[1]) or not int(standard_precision_and_tolerance_settings[1]) in range(0.01,100): + # raise Exception ('WARNING: Precision of convergence criteria for nonlinear calculations at index 1 is out of range. Input has to be in the range [0.01 ... 100].') + + # while not float(standard_precision_and_tolerance_settings[2]) or not int(standard_precision_and_tolerance_settings[2]) in range(0.01,100): + # raise Exception ('WARNING: Tolerance for detection of instability at index 2 is out of range. Input has to be in the range [0.01 ... 100].') + + # while not float(standard_precision_and_tolerance_settings[3]) or not int(standard_precision_and_tolerance_settings[3]) in range(1.00,100): + # raise Exception ('WARNING: Robustness of iterative calculation at index 3 is out of range. Input has to be in the range [1.00 ... 100].') + if standard_precision_and_tolerance_settings[0] == True: + clientObject.standard_precision_and_tolerance_settings_enabled = True + clientObject.precision_of_convergence_criteria_for_nonlinear_calculation = standard_precision_and_tolerance_settings[1] + clientObject.instability_detection_tolerance = standard_precision_and_tolerance_settings[2] + clientObject.iterative_calculation_robustness = standard_precision_and_tolerance_settings[3] + + # Control nonlinear Analysis + if len(control_nonlinear_analysis) != 2: + raise Exception('WARNING: The nonlinear analysis control parameter needs to be of length 2. Kindly check list inputs for completeness and correctness.') -# if loading_by_multiplier_factor != False: -# loading_by_multiplier_factor = True -# multiplier_factor = int -# dividing_results = bool - - -# # Effect due to Tension in Members -# clientObject.consider_favorable_effect_due_to_tension_in_members = favorable_effect_due_to_tension_in_members - - -# # Bourdon Effect Displacement -# clientObject.displacements_due_to_bourdon_effect = bourdon_effect - - -# # Nonsymetric Direct Solver -# clientObject.nonsymmetric_direct_solver = nonsymmetric_direct_solver - - -# # Internal Forces to Deformed Structure -# clientObject.refer_internal_forces_to_deformed_structure = refer_internal_forces_to_deformed_structure -# clientObject.refer_internal_forces_to_deformed_structure_for_moments = internal_forces_to_deformed_structure_for_moments -# clientObject.refer_internal_forces_to_deformed_structure_for_normal_forces = internal_forces_to_deformed_structure_for_normal_forces -# clientObject.refer_internal_forces_to_deformed_structure_for_shear_forces = internal_forces_to_deformed_structure_for_shear_forces - -# refer_internal_forces_to_deformed_structure = internal_forces_to_deformed_structure[0] -# internal_forces_to_deformed_structure_for_moments = internal_forces_to_deformed_structure[1] -# internal_forces_to_deformed_structure_for_normal_forces = internal_forces_to_deformed_structure[2] -# internal_forces_to_deformed_structure_for_shear_forces = internal_forces_to_deformed_structure[3] -# if refer_internal_forces_to_deformed_structure != False: -# internal_forces_to_deformed_structure_for_moments = bool -# internal_forces_to_deformed_structure_for_normal_forces = bool -# internal_forces_to_deformed_structure_for_shear_forces = bool - -# if len(internal_forces_to_deformed_structure) != 4: -# raise Exception('WARNING: The internal forces to deformed structure parameter needs to be of length 4. Kindly check list inputs for completeness and correctness.') -# if type(mass_conversion[0]) != bool : -# raise Exception ('WARNING: Refering internal forces to deformed structure at index 0 to be of type "bool"') -# if type(mass_conversion[1]) != bool : -# raise Exception ('WARNING: Internal forces to deformed structure for moments at index 1 to be of type "bool"') -# if type(mass_conversion[2]) != bool : -# raise Exception ('WARNING: Internal forces to deformed structure for normal forces at index 2 to be of type "bool"') -# if type(mass_conversion[3]) != bool : -# raise Exception ('WARNING: Internal forces to deformed structure for shear forces at index 3 to be of type "bool"') - -# # Equation System -# clientObject.method_of_equation_system = method_of_equation_system.name - -# # Plate Bending Theory -# clientObject.plate_bending_theory = plate_bending_theory.name + if type(control_nonlinear_analysis[0]) != int : + raise Exception ('WARNING: Enabling the standard precision and tolerance settings at index 0 has to be of type "int"') + if type(control_nonlinear_analysis[1]) != int : + raise Exception ('WARNING: Precision of convergence criteria for nonlinear calculation factor at index 1 has to be of type "int"') -# # Mass Conversion -# clientObject.mass_conversion_enabled = mass_conversion_enabled -# clientObject.mass_conversion_factor_in_direction_x = mass_conversion_factor_in_direction_x -# clientObject.mass_conversion_factor_in_direction_y = mass_conversion_factor_in_direction_y -# clientObject.mass_conversion_factor_in_direction_z = mass_conversion_factor_in_direction_z + clientObject.max_number_of_iterations = control_nonlinear_analysis[0] + clientObject.number_of_load_increments = control_nonlinear_analysis[1] + + ## Load Modification + if len(load_modification) != 3: + raise Exception('WARNING: The load modification parameter needs to be of length 3. Kindly check list inputs for completeness and correctness.') + + # if type(load_modification[0]) != bool : + # raise Exception ('WARNING: Load multiplier factor parameter at index 0 to be of type "int"') + # if type(load_modification[1]) != int : + # raise Exception ('WARNING: Multiplier factor parameter at index 1 to be of type "int"') + # if type(load_modification[2]) != bool : + # raise Exception ('WARNING: Dividing results parameter at index 2 to be of type "bool"') -# mass_conversion_enabled = mass_conversion[0] -# mass_conversion_factor_in_direction_x = mass_conversion[1] -# mass_conversion_factor_in_direction_y = mass_conversion[2] -# mass_conversion_factor_in_direction_z = mass_conversion[3] -# if mass_conversion_enabled != False: -# mass_conversion_factor_in_direction_x = float -# mass_conversion_acceleration_in_direction_y = float -# mass_conversion_acceleration_in_direction_z = float - -# if len(mass_conversion) != 4: -# raise Exception('WARNING: The mass conversion parameter needs to be of length 4. Kindly check list inputs for completeness and correctness.') - -# if type(mass_conversion[0]) != bool : -# raise Exception ('WARNING: Enabling the mass conversion at index 0 to be of type "bool"') -# if type(mass_conversion[1]) != float or type(mass_conversion[1]) != int : -# raise Exception ('WARNING: Mass conversion factor in direction x at index 1 to be of type "float" or "int"') -# if type(mass_conversion[2]) != float or type(mass_conversion[2]) != int : -# raise Exception ('WARNING: Mass conversion factor in direction y at index 2 to be of type "float" or "int"') -# if type(mass_conversion[3]) != float or type(mass_conversion[3]) != int : -# raise Exception ('WARNING: Mass conversion factor in direction z at index 3 to be of type "float" or "int"') - -# # Comment -# clientObject.comment = comment - -# # Adding optional parameters via dictionary -# for key in params: -# clientObject[key] = params[key] - -# # Add Static Analysis Settings to client model -# clientModel.service.set_static_analysis_settings(clientObject) + if load_modification[0] == True: + clientObject.modify_loading_by_multiplier_factor = True + clientObject.loading_multiplier_factor = load_modification[1] + clientObject.divide_results_by_loading_factor = load_modification[2] + # Effect due to Tension in Members + clientObject.consider_favorable_effect_due_to_tension_in_members = favorable_effect_due_to_tension_in_members + # Bourdon Effect Displacement + clientObject.displacements_due_to_bourdon_effect = bourdon_effect + # Nonsymetric Direct Solver + clientObject.nonsymmetric_direct_solver = nonsymmetric_direct_solver + if len(internal_forces_to_deformed_structure) != 4: + raise Exception('WARNING: The internal forces to deformed structure parameter needs to be of length 4. Kindly check list inputs for completeness and correctness.') + # if type(mass_conversion[0]) != bool : + # raise Exception ('WARNING: Refering internal forces to deformed structure at index 0 to be of type "bool"') + # if type(mass_conversion[1]) != bool : + # raise Exception ('WARNING: Internal forces to deformed structure for moments at index 1 to be of type "bool"') + # if type(mass_conversion[2]) != bool : + # raise Exception ('WARNING: Internal forces to deformed structure for normal forces at index 2 to be of type "bool"') + # if type(mass_conversion[3]) != bool : + # raise Exception ('WARNING: Internal forces to deformed structure for shear forces at index 3 to be of type "bool"') + # Internal Forces to Deformed Structure + if internal_forces_to_deformed_structure[0] == True: + clientObject.refer_internal_forces_to_deformed_structure = internal_forces_to_deformed_structure[0] + clientObject.refer_internal_forces_to_deformed_structure_for_moments = internal_forces_to_deformed_structure[1] + clientObject.refer_internal_forces_to_deformed_structure_for_normal_forces = internal_forces_to_deformed_structure[2] + clientObject.refer_internal_forces_to_deformed_structure_for_shear_forces = internal_forces_to_deformed_structure[3] + + # Equation System + clientObject.method_of_equation_system = method_of_equation_system.name + + # Plate Bending Theory + clientObject.plate_bending_theory = plate_bending_theory.name + + # Mass Conversion + if len(mass_conversion) != 4: + raise Exception('WARNING: The mass conversion parameter needs to be of length 4. Kindly check list inputs for completeness and correctness.') + # if type(mass_conversion[0]) != bool : + # raise Exception ('WARNING: Enabling the mass conversion at index 0 has to be of type "bool"') + # if type(mass_conversion[1]) != float or type(mass_conversion[1]) != int: + # raise Exception ('WARNING: Mass conversion factor in direction x at index 1 has to be of type "float" or "int"') + # if type(mass_conversion[2]) != float or type(mass_conversion[2]) != int: + # raise Exception ('WARNING: Mass conversion factor in direction y at index 2 has to be of type "float" or "int"') + # if type(mass_conversion[3]) != float or type(mass_conversion[3]) != int : + # raise Exception ('WARNING: Mass conversion factor in direction z at index 3 has to be of type "float" or "int"') + + clientObject.mass_conversion_enabled = mass_conversion[0] + if mass_conversion[0] != False: + clientObject.mass_conversion_factor_in_direction_x = mass_conversion[1] + clientObject.mass_conversion_factor_in_direction_y = mass_conversion[2] + clientObject.mass_conversion_factor_in_direction_z = mass_conversion[3] + # Comment + clientObject.comment = comment + + # Adding optional parameters via dictionary + for key in params: + clientObject[key] = params[key] + + # Add Static Analysis Settings to client model + clientModel.service.set_static_analysis_settings(clientObject) diff --git a/UnitTests/report.html b/UnitTests/report.html index b9234e50..47eedc26 100644 --- a/UnitTests/report.html +++ b/UnitTests/report.html @@ -429,7 +429,7 @@ }

report.html

-

Report generated on 08-Nov-2021 at 08:25:23 by pytest-html v3.1.1

+

Report generated on 12-Nov-2021 at 13:25:30 by pytest-html v3.1.1

Environment

@@ -446,10 +446,10 @@

Environment

-
{"codecov": "0.3.0", "cov": "2.12.1", "html": "3.1.1", "metadata": "1.11.0", "reportlog": "0.1.2"}
Python3.9.7
+ 3.9.8

Summary

-

0 tests ran in 115.14 seconds.

- 0 passed, 0 skipped, 0 failed, 25 errors, 0 expected failures, 0 unexpected passes +

0 tests ran in 1.50 seconds.

+ 0 passed, 0 skipped, 0 failed, 0 errors, 0 expected failures, 0 unexpected passes

Results

@@ -459,229 +459,4 @@

Results

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Duration Links
ErrorUnitTests/MeshGenerationStatistics_test.py::collect
-
No log output captured.
ErrorUnitTests/test_DesignSituations.py::collect
-
No log output captured.
ErrorUnitTests/test_Free_Load_Test.py::collect
-
No log output captured.
ErrorUnitTests/test_GlobalParameters_Test.py::collect
-
No log output captured.
ErrorUnitTests/test_LineLoads_Test.py::collect
-
No log output captured.
ErrorUnitTests/test_LoadCases_Test.py::collect
-
No log output captured.
ErrorUnitTests/test_LoadDistributionSurface_Test.py::collect
-
No log output captured.
ErrorUnitTests/test_MemberLoad_test.py::collect
-
No log output captured.
ErrorUnitTests/test_MemberSetLoad_test.py::collect
-
No log output captured.
ErrorUnitTests/test_MembraneSurface_Test.py::collect
-
No log output captured.
ErrorUnitTests/test_MembraneWithoutTensionSurface_Test.py::collect
-
No log output captured.
ErrorUnitTests/test_NodalLoad_test.py::collect
-
No log output captured.
ErrorUnitTests/test_RigidSurface_Test.py::collect
-
No log output captured.
ErrorUnitTests/test_SolidLoads.py::collect
-
No log output captured.
ErrorUnitTests/test_SpectralSettings_test.py::collect
-
No log output captured.
ErrorUnitTests/test_StandardSurface_Test.py::collect
-
No log output captured.
ErrorUnitTests/test_SurfaceLoad_test.py::collect
-
No log output captured.
ErrorUnitTests/test_SurfaceSetLoad_test.py::collect
-
No log output captured.
ErrorUnitTests/test_Thickness_Test.py::collect
-
No log output captured.
ErrorUnitTests/test_WithoutThicknessSurface_Test.py::collect
-
No log output captured.
ErrorUnitTests/test_basic_objects.py::collect
-
No log output captured.
ErrorUnitTests/test_loads.py::collect
-
No log output captured.
ErrorUnitTests/test_modalAnalysis_test.py::collect
-
No log output captured.
ErrorUnitTests/test_newFunctionalityTesting.py::collect
-
No log output captured.
ErrorUnitTests/test_stabilitysettings.py::collect
-
No log output captured.
\ No newline at end of file + No results found. Try to check the filters \ No newline at end of file diff --git a/UnitTests/test_staticAnalysisSetting.py b/UnitTests/test_staticAnalysisSetting.py index b1e857fc..b27cad29 100644 --- a/UnitTests/test_staticAnalysisSetting.py +++ b/UnitTests/test_staticAnalysisSetting.py @@ -31,4 +31,12 @@ def test_LargeDeformation(): clientModel.service.finish_modification() -test_LargeDeformation() \ No newline at end of file +def test_SecondOrderPDelta(): + + clientModel.service.begin_modification() + + # Set Base Settings + StaticAnalysisSettings.SecondOrderPDelta(1) + + clientModel.service.finish_modification() +