diff --git a/OpenSees.bas b/OpenSees.bas index 0fa9fab..38bb364 100644 --- a/OpenSees.bas +++ b/OpenSees.bas @@ -1,11 +1,9 @@ # -# _____ _______ _____ _____ _____ _ __ -# | __ (_) _ \ _ | _ | / ___| |_ _| | | / _| -# | | \/_| | | |_| |_| | | |_ __ ___ _ __ \ `--. ___ ___ ___ | | _ __ | |_ ___ _ __| |_ __ _ ___ ___ -# | | __| | | | |_ _| | | | '_ \ / _ \ '_ \ `--. \/ _ \/ _ \/ __| | || '_ \| __/ _ \ '__| _/ _` |/ __/ _ \ -# | |_\ \ | |/ / |_| \ \_/ / |_) | __/ | | /\__/ / __/ __/\__ \ _| || | | | || __/ | | || (_| | (_| __/ -# \____/_|___/ \___/| .__/ \___|_| |_\____/ \___|\___||___/ \___/_| |_|\__\___|_| |_| \__,_|\___\___| -# | | +# ____ _ ____ ___ ____ ___ _ __ +# / ___(_) _ \ _ / _ \ _ __ ___ _ __ / ___| ___ ___ ___ |_ _|_ __ | |_ ___ _ __ / _| __ _ ___ ___ +# | | _| | | | |_| |_| | | | '_ \ / _ \ '_ \\___ \ / _ \/ _ \/ __| | || '_ \| __/ _ \ '__| |_ / _` |/ __/ _ \ +# | |_| | | |_| |_ _| |_| | |_) | __/ | | |___) | __/ __/\__ \ | || | | | || __/ | | _| (_| | (_| __/ +# \____|_|____/ |_| \___/| .__/ \___|_| |_|____/ \___|\___||___/ |___|_| |_|\__\___|_| |_| \__,_|\___\___| # |_| # # GiD + OpenSees Interface - An Integrated FEA Platform @@ -310,9 +308,14 @@ model BasicBuilder -ndm *ndime -ndf *currentDOF *tcl(LogFile) -puts "\n--------------------------------------------------------------------------------------------------------" -puts "\nGiD+OpenSees Interface *tcl(OpenSees::GetVersion)" -puts "\nAnalysis summary\n" +puts "" +puts " __ __ __ __ _ " +puts "/ _ .| \\ _|_ / \\ _ _ _ (_ _ _ _ | _ |_ _ _(_ _ _ _" +puts "\\__)||__/ | \\__/|_)(-| )__)(-(-_) || )|_(-| | (_|(_(-" +puts " | " +puts " *tcl(OpenSees::GetVersion)" +puts "Analysis summary" +puts "" *set var IntvNum=0 *loop intervals *set var IntvNum=operation(IntvNum+1) @@ -335,6 +338,8 @@ puts "Interval *IntvNum : *IntvData(Analysis_type) - *\ *endif *end intervals puts "" +puts "----------------" +puts "" set time_start [clock seconds] puts "Starting analysis at [clock format $time_start -format %H:%M:%S]\n" *set var IntvNum=0 @@ -348,14 +353,14 @@ puts "Starting analysis at [clock format $time_start -format %H:%M:%S]\n" # # -------------------------------------------------------------------------------------------------------------- -puts "Running interval *IntvNum ...\n" +puts "Running interval *IntvNum\n" *include bas\Actions\Loads.bas *include bas\Analysis\UpdateMaterialStage.bas *include bas\Analysis\UpdateParameters.bas # recording the initial status -record; +record *include bas\Analysis\Analyze.bas *if(IntvData(Keep_this_loading_active_until_the_end_of_analysis,int)==1) @@ -381,11 +386,68 @@ setTime *IntvData(Time_to_be_set,real) # -------------------------------------------------------------------------------------------------------------- +set hour 0.0 +set minute 0.0 +set second 0.0 set time_end [clock seconds] set analysisTime [expr $time_end-$time_start] + puts "Analysis finished at [clock format $time_end -format %H:%M:%S]\n" -puts "Analysis time : $analysisTime seconds" + +if {$analysisTime<60} { + if {$analysisTime==0} { + puts "Analysis time : less than one second" + } elseif {$analysisTime==1} { + puts "Analysis time : 1 second" + } else { + puts "Analysis time : $analysisTime seconds" + } + +} elseif {$analysisTime<3600} { + set minutes [expr $analysisTime/60] + set seconds [expr $analysisTime%60] + + if {$minutes==1} { + puts -nonewline "Analysis time : 1 minute" + } else { + puts -nonewline "Analysis time : $minutes minutes" + } + + if {$seconds==0} { + puts "" + } elseif {$seconds==1} { + puts " and 1 second" + } else { + puts " and $seconds seconds" + } + +} else { + set hours [expr $analysisTime/3600] + set minutes [expr ($analysisTime%3600)/60] + set seconds [expr ($analysisTime%3600)%60] + + if {$hours==1} { + puts -nonewline "Analysis time : 1 hour" + } else { + puts -nonewline "Analysis time : $hours hours" + } + + if {$minutes==0} { + } elseif {$minute==1} { + puts -nonewline ", 1 minute" + } else { + puts -nonewline ", $minutes minutes" + } + + if {$seconds==0} { + puts "" + } elseif {$second==1} { + puts " and 1 second" + } else { + puts " and $seconds seconds" + } +} *# *# Metadata *# -*include bas\Model\Meta.bas \ No newline at end of file +*include bas\Model\Meta.bas diff --git a/OpenSees.cnd b/OpenSees.cnd index 8de129e..39ff84b 100644 --- a/OpenSees.cnd +++ b/OpenSees.cnd @@ -223,10 +223,10 @@ QUESTION: Uniform_load_acting_in_local_y_direction#UNITS# VALUE: 0.0 kN/m QUESTION: Uniform_load_acting_in_local_z_direction#UNITS# VALUE: 0.0 kN/m -QUESTION: _#CB#(Hover_mouse_for_local_axes_info) -VALUE: Hover for local axes info -STATE: DISABLED -HELP: LOCAL AXES INFO\n\nThe local-x longitudinal axis is always specified by the positive element direction (View -> Normals -> Lines)\n\nIN A 2D PROBLEM :\n\nLocal-x axis coincides with the element positive direction\nLocal-z axis coincides with the global Z axis direction\nLocal-y axis is found by the right hand rule\n\nIN A 3D PROBLEM :\n\nVERTICAL axis is user-specified (Y or Z) in Modeling Options\n\nFor a horizontal element :\nLocal-x axis coincides with the element positive direction\nLocal-z coincides with the direction of the defined VERTICAL axis (global Y or Z)\nLocal-y axis is found by the right hand rule\n\nFor a vertical element :\nLocal-x axis coincides with the element positive direction\nLocal-z positive direction coincides with the global X axis negative direction\nLocal-y axis is found by the right hand rule\n\nFor an oblique element :\nVector Vecxz has the direction of the defined VERTICAL axis (global Y or Z)\nLocal-x axis direction (Vx) coincides with the element positive direction\nLocal-y axis direction (Vy) is found by the cross product Vy = Vecxz x Vx\nLocal-z axis direction (Vz) is found by the cross product Vz = Vx x Vy +QUESTION: _#CB#(_) +VALUE: +STATE: HIDDEN +TKWIDGET: TK_LocalAxesInfo QUESTION: __#CB#(_) VALUE: STATE: HIDDEN @@ -310,7 +310,6 @@ END CONDITION BOOK: Constraints - CONDITION: Point_Equal_constraint_master_node CONDTYPE: over points CONDMESHTYPE: over nodes diff --git a/OpenSees.mat b/OpenSees.mat index eb1bcd2..7559cf5 100644 --- a/OpenSees.mat +++ b/OpenSees.mat @@ -298,6 +298,7 @@ QUESTION: Initial_hardening VALUE: 0.4 QUESTION: Pinching_factor_for_the_cyclic_slip_vs_bar_response VALUE: 0.5 +TKWIDGET: TK_MaterialWikiInfo END MATERIAL @@ -1197,10 +1198,10 @@ STATE: HIDDEN QUESTION: Shear_modulus_G#UNITS# VALUE: 11.66666667 GPa TITLE: Section_properties -QUESTION: _#CB#(Hover_for_local_axes_info) -VALUE: Hover for local axes info -STATE: DISABLED -HELP: LOCAL AXES INFO\n\nThe local-x longitudinal axis is always specified by the positive element direction (View -> Normals -> Lines)\nShown in figure are the element transverse local-y and local-z axes\n\nIN A 2D PROBLEM :\n\nHeight refers to the local-y axis\nWidth refers to the local-z axis\n\nLocal-x axis coincides with the element positive direction\nLocal-z axis coincides with the global Z axis direction\nLocal-y axis is found by the right hand rule\n\nIN A 3D PROBLEM :\n\nVERTICAL axis is user-specified (Y or Z) in Modeling Options\n\nHeight refers to the local-z axis\nWidth refers to the local-y axis\n\nFor a horizontal element :\nLocal-x axis coincides with the element positive direction\nLocal-z coincides with the direction of the defined VERTICAL axis (global Y or Z)\nLocal-y axis is found by the right hand rule\n\nFor a vertical element :\nLocal-x axis coincides with the element positive direction\nLocal-z positive direction coincides with the global X axis negative direction\nLocal-y axis is found by the right hand rule\n\nFor an oblique element :\nVector Vecxz has the direction of the defined VERTICAL axis (global Y or Z)\nLocal-x axis direction (Vx) coincides with the element positive direction\nLocal-y axis direction (Vy) is found by the cross product Vy = Vecxz x Vx\nLocal-z axis direction (Vz) is found by the cross product Vz = Vx x Vy +QUESTION: _#CB#(_) +VALUE: +STATE: HIDDEN +TKWIDGET: TK_LocalAxesInfo QUESTION: Cross_section#CB#(Rectangular,Tee,Circular,General) VALUE: Rectangular DEPENDENCIES: (Rectangular,RESTORE,Height_h,#CURRENT#,RESTORE,Width_B,#CURRENT#,HIDE,Diameter_d,#CURRENT#,HIDE,Height_hf,#CURRENT#,HIDE,Width_bf,#CURRENT#,HIDE,Width_bw,#CURRENT#,HIDE,Area_A,#CURRENT#,HIDE,Moment_of_inertia_about_local-y_Iyy,#CURRENT#,HIDE,Moment_of_inertia_about_local-z_Izz,#CURRENT#,HIDE,Torsional_moment_of_inertia_Iyz,#CURRENT#) @@ -1263,10 +1264,10 @@ QUESTION: Compatible_materials:#CB#(_) VALUE: Concrete uniaxial materials/InitStrain/InitStress/Steel uniaxial materials TKWIDGET: TK_SectionWikiInfo TITLE: Section_properties -QUESTION: _#CB#(Hover_for_local_axes_info) -VALUE: Hover for local axes info -STATE: DISABLED -HELP: LOCAL AXES INFO\n\nThe local-x longitudinal axis is always specified by the positive element direction (View -> Normals -> Lines)\nShown in figure are the element transverse local-y and local-z axes\n\nIN A 2D PROBLEM :\n\nHeight refers to the local-y axis\nWidth refers to the local-z axis\n\nLocal-x axis coincides with the element positive direction\nLocal-z axis coincides with the global Z axis direction\nLocal-y axis is found by the right hand rule\n\nIN A 3D PROBLEM :\n\nVERTICAL axis is user-specified (Y or Z) in Modeling Options\n\nHeight refers to the local-z axis\nWidth refers to the local-y axis\n\nFor a horizontal element :\nLocal-x axis coincides with the element positive direction\nLocal-z coincides with the direction of the defined VERTICAL axis (global Y or Z)\nLocal-y axis is found by the right hand rule\n\nFor a vertical element :\nLocal-x axis coincides with the element positive direction\nLocal-z positive direction coincides with the global X axis negative direction\nLocal-y axis is found by the right hand rule\n\nFor an oblique element :\nVector Vecxz has the direction of the defined VERTICAL axis (global Y or Z)\nLocal-x axis direction (Vx) coincides with the element positive direction\nLocal-y axis direction (Vy) is found by the cross product Vy = Vecxz x Vx\nLocal-z axis direction (Vz) is found by the cross product Vz = Vx x Vy +QUESTION: _#CB#(_) +VALUE: +STATE: HIDDEN +TKWIDGET: TK_LocalAxesInfo QUESTION: Cross_section#CB#(Rectangular_Column,Rectangular_Beam,Tee_Beam,Circular_Column,Bridge_Deck) VALUE: Rectangular_Column DEPENDENCIES: (Rectangular_Column,RESTORE,Core_material,#CURRENT#,RESTORE,Cover_material,#CURRENT#,RESTORE,Reinforcing_bar_material,#CURRENT#,HIDE,Width_bf,#CURRENT#,HIDE,Bottom_beam_bar_area,#CURRENT#,HIDE,Bottom_beam_bar_size,#CURRENT#,HIDE,Bottom_beam_bars,#CURRENT#,HIDE,Slab_bar_area,#CURRENT#,HIDE,Top_beam_bar_area,#CURRENT#,HIDE,Web_width_bw,#CURRENT#,HIDE,Slab_thickness_hf,#CURRENT#,HIDE,Top_beam_bars,#CURRENT#,HIDE,Slab_bars,#CURRENT#,HIDE,Slab_bar_size,#CURRENT#,HIDE,Top_beam_bar_size,#CURRENT#,HIDE,Top_bars,#CURRENT#,HIDE,Bottom_bars,#CURRENT#,HIDE,Top_bar_size,#CURRENT#,HIDE,Bottom_bar_size,#CURRENT#,HIDE,Top_bar_area,#CURRENT#,HIDE,Bottom_bar_area,#CURRENT#,HIDE,Bar_area,#CURRENT#,RESTORE,Height_h,#CURRENT#,RESTORE,Width_b,#CURRENT#,HIDE,Diameter_d,#CURRENT#,HIDE,Bars_along_arc,#CURRENT#,HIDE,Bar_size,#CURRENT#,HIDE,Fibers_in_the_circumferential_direction,#CURRENT#,HIDE,Fibers_in_the_radial_direction,#CURRENT#,RESTORE,Bars_along_z_axis_face,#CURRENT#,RESTORE,Bars_along_y_axis_face,#CURRENT#,RESTORE,Corner_bar_size,#CURRENT#,RESTORE,Middle_bar_size,#CURRENT#,RESTORE,Corner_bar_area,#CURRENT#,RESTORE,Middle_bar_area,#CURRENT#,RESTORE,Fibers_in_local_z_direction,#CURRENT#,RESTORE,Fibers_in_local_y_direction,#CURRENT#,HIDE,Top_slab_width_wt,#CURRENT#,HIDE,Bottom_slab_width_wb,#CURRENT#,HIDE,Top_slab_thickness_ts1,#CURRENT#,HIDE,Bottom_slab_thickness_ts2,#CURRENT#,HIDE,Height_hv,#CURRENT#,HIDE,External_web_thickness_tw,#CURRENT#,HIDE,Include_additional_part,#CURRENT#,HIDE,Solid_Section,#CURRENT#,HIDE,Bars_on_top_layer_of_top_slab,#CURRENT#,HIDE,Bars_on_bottom_layer_of_top_slab,#CURRENT#,HIDE,Bars_on_top_layer_of_bottom_slab,#CURRENT#,HIDE,Bars_on_bottom_layer_of_bottom_slab,#CURRENT#,HIDE,Bars_along_beam_height,#CURRENT#,HIDE,Bars_along_beam_width,#CURRENT#,HIDE,Top_slab_bar_size,#CURRENT#,HIDE,Bottom_slab_bar_size,#CURRENT#,HIDE,Top_slab_bar_area,#CURRENT#,HIDE,Bottom_slab_bar_area,#CURRENT#,HIDE,Fibers_along_top_slab_width,#CURRENT#,HIDE,Fibers_along_top_slab_thickness,#CURRENT#,HIDE,Fibers_along_bottom_slab_width,#CURRENT#,HIDE,Fibers_along_bottom_slab_thickness,#CURRENT#,HIDE,Fibers_along_external_web_thickness,#CURRENT#,HIDE,Fibers_along_internal_web_thickness,#CURRENT#,HIDE,Fibers_along_web_height,#CURRENT#,HIDE,Main_section_material,#CURRENT#,HIDE,Top_slab_reinforcing_bar_material,#CURRENT#,HIDE,Bottom_slab_reinforcing_bar_material,#CURRENT#) @@ -1572,10 +1573,10 @@ QUESTION: Compatible_materials:#CB#(_) VALUE: Concrete uniaxial materials/InitStrain/InitStress/Steel uniaxial materials TKWIDGET: TK_SectionWikiInfo TITLE: Section_properties -QUESTION: _#CB#(Hover_for_local_axes_info) -VALUE: Hover for local axes info -STATE: DISABLED -HELP: LOCAL AXES INFO\n\nThe local-x longitudinal axis is always specified by the positive element direction (View -> Normals -> Lines)\nShown in figure are the element transverse local-y and local-z axes\n\nIN A 2D PROBLEM :\n\nHeight refers to the local-y axis\nWidth refers to the local-z axis\n\nLocal-x axis coincides with the element positive direction\nLocal-z axis coincides with the global Z axis direction\nLocal-y axis is found by the right hand rule\n\nIN A 3D PROBLEM :\n\nVERTICAL axis is user-specified (Y or Z) in Modeling Options\n\nHeight refers to the local-z axis\nWidth refers to the local-y axis\n\nFor a horizontal element :\nLocal-x axis coincides with the element positive direction\nLocal-z coincides with the direction of the defined VERTICAL axis (global Y or Z)\nLocal-y axis is found by the right hand rule\n\nFor a vertical element :\nLocal-x axis coincides with the element positive direction\nLocal-z positive direction coincides with the global X axis negative direction\nLocal-y axis is found by the right hand rule\n\nFor an oblique element :\nVector Vecxz has the direction of the defined VERTICAL axis (global Y or Z)\nLocal-x axis direction (Vx) coincides with the element positive direction\nLocal-y axis direction (Vy) is found by the cross product Vy = Vecxz x Vx\nLocal-z axis direction (Vz) is found by the cross product Vz = Vx x Vy +QUESTION: _#CB#(_) +VALUE: +STATE: HIDDEN +TKWIDGET: TK_LocalAxesInfo QUESTION: Left_subsection(-y_direction):#CB#(_) VALUE: TKWIDGET: FiberInt::CheckFieldValues @@ -1774,10 +1775,10 @@ QUESTION: Material#MAT#(Multidimensional_(nD)_Materials) VALUE: Elastic_Isotropic TKWIDGET: EBC::CheckMaterial TITLE: Section_properties -QUESTION: _#CB#(Hover_for_local_axes_info) -VALUE: Hover for local axes info -STATE: DISABLED -HELP: LOCAL AXES INFO\n\nThe local-x longitudinal axis is always specified by the positive element direction (View -> Normals -> Lines)\nShown in figure are the element transverse local-y and local-z axes\n\nIN A 2D PROBLEM :\n\nHeight refers to the local-y axis\nWidth refers to the local-z axis\n\nLocal-x axis coincides with the element positive direction\nLocal-z axis coincides with the global Z axis direction\nLocal-y axis is found by the right hand rule\n\nIN A 3D PROBLEM :\n\nVERTICAL axis is user-specified (Y or Z) in Modeling Options\n\nHeight refers to the local-z axis\nWidth refers to the local-y axis\n\nFor a horizontal element :\nLocal-x axis coincides with the element positive direction\nLocal-z coincides with the direction of the defined VERTICAL axis (global Y or Z)\nLocal-y axis is found by the right hand rule\n\nFor a vertical element :\nLocal-x axis coincides with the element positive direction\nLocal-z positive direction coincides with the global X axis negative direction\nLocal-y axis is found by the right hand rule\n\nFor an oblique element :\nVector Vecxz has the direction of the defined VERTICAL axis (global Y or Z)\nLocal-x axis direction (Vx) coincides with the element positive direction\nLocal-y axis direction (Vy) is found by the cross product Vy = Vecxz x Vx\nLocal-z axis direction (Vz) is found by the cross product Vz = Vx x Vy +QUESTION: _#CB#(_) +VALUE: +STATE: HIDDEN +TKWIDGET: TK_LocalAxesInfo QUESTION: Cross_section#CB#(Rectangular,Tee,Circular,General) VALUE: Rectangular DEPENDENCIES: (Rectangular,RESTORE,Height_h,#CURRENT#,RESTORE,Width_B,#CURRENT#,HIDE,Diameter_d,#CURRENT#,HIDE,Height_hf,#CURRENT#,HIDE,Width_bf,#CURRENT#,HIDE,Width_bw,#CURRENT#,HIDE,Area_A,#CURRENT#,HIDE,Moment_of_inertia_about_local-y_Iyy,#CURRENT#,HIDE,Moment_of_inertia_about_local-z_Izz,#CURRENT#,HIDE,Torsional_moment_of_inertia_Iyz,#CURRENT#) @@ -1843,10 +1844,10 @@ QUESTION: Material#MAT#(Multidimensional_(nD)_Materials) VALUE: Elastic_Isotropic TKWIDGET: EBC::CheckMaterial TITLE: Section_properties -QUESTION: _#CB#(Hover_for_local_axes_info) -VALUE: Hover for local axes info -STATE: DISABLED -HELP: LOCAL AXES INFO\n\nThe local-x longitudinal axis is always specified by the positive element direction (View -> Normals -> Lines)\nShown in figure are the element transverse local-y and local-z axes\n\nIN A 2D PROBLEM :\n\nHeight refers to the local-y axis\nWidth refers to the local-z axis\n\nLocal-x axis coincides with the element positive direction\nLocal-z axis coincides with the global Z axis direction\nLocal-y axis is found by the right hand rule\n\nIN A 3D PROBLEM :\n\nVERTICAL axis is user-specified (Y or Z) in Modeling Options\n\nHeight refers to the local-z axis\nWidth refers to the local-y axis\n\nFor a horizontal element :\nLocal-x axis coincides with the element positive direction\nLocal-z coincides with the direction of the defined VERTICAL axis (global Y or Z)\nLocal-y axis is found by the right hand rule\n\nFor a vertical element :\nLocal-x axis coincides with the element positive direction\nLocal-z positive direction coincides with the global X axis negative direction\nLocal-y axis is found by the right hand rule\n\nFor an oblique element :\nVector Vecxz has the direction of the defined VERTICAL axis (global Y or Z)\nLocal-x axis direction (Vx) coincides with the element positive direction\nLocal-y axis direction (Vy) is found by the cross product Vy = Vecxz x Vx\nLocal-z axis direction (Vz) is found by the cross product Vz = Vx x Vy +QUESTION: _#CB#(_) +VALUE: +STATE: HIDDEN +TKWIDGET: TK_LocalAxesInfo QUESTION: Cross_section#CB#(Rectangular,Tee,Circular,General) VALUE: Rectangular DEPENDENCIES: (Rectangular,RESTORE,Height_h,#CURRENT#,RESTORE,Width_B,#CURRENT#,HIDE,Diameter_d,#CURRENT#,HIDE,Height_hf,#CURRENT#,HIDE,Width_bf,#CURRENT#,HIDE,Width_bw,#CURRENT#,HIDE,Area_A,#CURRENT#,HIDE,Moment_of_inertia_about_local-y_Iyy,#CURRENT#,HIDE,Moment_of_inertia_about_local-z_Izz,#CURRENT#,HIDE,Torsional_moment_of_inertia_Iyz,#CURRENT#) diff --git a/OpenSees.prb b/OpenSees.prb index 634355a..ccea2f8 100644 --- a/OpenSees.prb +++ b/OpenSees.prb @@ -43,14 +43,12 @@ VALUE: QUESTION: Model_dimensions#CB#(2,3) VALUE: 2 STATE: DISABLED +HELP: If a 3D model is detected, this value will automatically switch to 3. DEPENDENCIES: (2,SET,Vertical_axis,Y) TKWIDGET: TK_EditModelDim -QUESTION: ___#CB#(_) -VALUE: If a 3D model is detected, this value will automatically switch to 3. QUESTION: Vertical_axis#CB#(Y,Z) VALUE: Y -QUESTION: ____#CB#(_) -VALUE: Default vertical axis is global Y. For 3D models, selecting global Z is recommended. +HELP: Default vertical axis is global Y. For 3D models, selecting global Z is recommended. TITLE: Eigenvalue_Analysis QUESTION: _____#CB#(_) VALUE: @@ -104,7 +102,7 @@ BOOK: Output_Options TITLE: General QUESTION: ________#CB#(_) VALUE: -QUESTION: Use_binary_format#CB#(1,0) +QUESTION: Use_HDF5_binary_output_format#CB#(1,0) VALUE: 0 QUESTION: _________#CB#(_) VALUE: @@ -170,7 +168,6 @@ QUESTION: Enabled#CB#(1,0) VALUE: 1 QUESTION: Description VALUE: -#TKWIDGET: GidUtils::TkwidgetEntryConfigure {-width 50} QUESTION: System_of_equations#CB#(BandGeneral,BandSPD,ProfileSPD,SparseGEN,UmfPack,FullGeneral,SparseSYM) VALUE: BandGeneral TKWIDGET: TK_EditInterval @@ -272,13 +269,13 @@ DEPENDENCIES: (2,HIDE,Ground_motion_direction,#CURRENT#,HIDE,Record_file,#CURREN DEPENDENCIES: (3,HIDE,Ground_motion_direction,#CURRENT#,HIDE,Record_file,#CURRENT#,RESTORE,First_record_file,#CURRENT#,RESTORE,Second_record_file,#CURRENT#,RESTORE,Third_record_file,#CURRENT#,RESTORE,First_ground_motion_direction,#CURRENT#,RESTORE,Second_ground_motion_direction,#CURRENT#,RESTORE,Third_ground_motion_direction,#CURRENT#) TKWIDGET: IntvData::MotionDirections QUESTION: First_record_file#MAT#(Records) -VALUE: Ground_motion_record +VALUE: Ground_Motion_Record QUESTION: Second_record_file#MAT#(Records) -VALUE: Ground_motion_record +VALUE: Ground_Motion_Record QUESTION: Third_record_file#MAT#(Records) -VALUE: Ground_motion_record +VALUE: Ground_Motion_Record QUESTION: Record_file#MAT#(Records) -VALUE: Ground_motion_record +VALUE: Ground_Motion_Record QUESTION: Ground_motion_direction#CB#(Ux,Uy,Uz,Rx,Ry,Rz) VALUE: Ux QUESTION: First_ground_motion_direction#CB#(Ux,Uy,Uz,Rx,Ry,Rz) @@ -289,11 +286,11 @@ QUESTION: Third_ground_motion_direction#CB#(Ux,Uy,Uz,Rx,Ry,Rz) VALUE: Uy QUESTION: Loading_path#CB#(Monotonic,Cyclic) VALUE: Monotonic -DEPENDENCIES: (Cyclic,RESTORE,Displacement_peaks-cycles,#CURRENT#,RESTORE,Displacement_peaks,#CURRENT#) -DEPENDENCIES: (Monotonic,HIDE,Displacement_peaks-cycles,#CURRENT#,HIDE,Displacement_peaks,#CURRENT#) +DEPENDENCIES: (Cyclic,RESTORE,Adjust_number_of_steps_according_to_displacement_ratio,#CURRENT#,RESTORE,Displacement_peaks-cycles,#CURRENT#,RESTORE,Displacement_peaks,#CURRENT#) +DEPENDENCIES: (Monotonic,HIDE,Adjust_number_of_steps_according_to_displacement_ratio,#CURRENT#,HIDE,Displacement_peaks-cycles,#CURRENT#,HIDE,Displacement_peaks,#CURRENT#) TKWIDGET: IntvData::LoadingPath QUESTION: Displacement_peaks-cycles(Displacement_ratio,Number_of_cycles) -VALUE: #N# 2 1 5 +VALUE: #N# 2 1.0 5 QUESTION: Convergence_criterion#CB#(Norm_Unbalance,Norm_Displacement_Increment,Energy_Increment,Relative_Norm_Unbalance,Relative_Norm_Displacement_Increment,Total_Relative_Norm_Displacement_Increment,Relative_Energy_Increment,Fixed_Number_of_Iterations) VALUE: Relative_Energy_Increment DEPENDENCIES: (Norm_Unbalance,RESTORE,Tolerance,#CURRENT#,RESTORE,Tolerance_relaxation,#CURRENT#) @@ -310,6 +307,9 @@ HELP: Tolerance criteria for checking convergence QUESTION: Max_iterations_per_step VALUE: 50 HELP: Maximum number of iterations per step +QUESTION: Adjust_number_of_steps_according_to_displacement_ratio#CB#(0,1) +VALUE: 0 +HELP: Multiply number of steps by displacement ratio in each cycle to maintain a constant load step magnitude QUESTION: Tolerance_relaxation#CB#(0,1) VALUE: 0 DEPENDENCIES: (1,RESTORE,Tolerance_relaxation_after_failed_substepping_of,#CURRENT#,RESTORE,Relaxation_factor,#CURRENT#) @@ -317,6 +317,7 @@ DEPENDENCIES: (0,HIDE,Tolerance_relaxation_after_failed_substepping_of,#CURRENT# TKWIDGET: IntvData::ToleranceRelaxation QUESTION: Tolerance_relaxation_after_failed_substepping_of#CB#(/2,/4,/8,/16) VALUE: /8 +HELP: If solution diverges after selected substepping divisor, repeat with tolerance multiplied by relaxation factor QUESTION: Relaxation_factor VALUE: 10 QUESTION: Activate_dead_load#CB#(1,0) @@ -338,8 +339,8 @@ HELP: Reset to the original state QUESTION: Remove_load_pattern_at_the_end_of_the_interval_analysis#CB#(0,1) VALUE: 0 QUESTION: Logging_level#CB#(Low,Medium,High) -VALUE: Low -HELP: Low : print nothing\nMedium : print information on norms and number of iterations at end of successful test\nHigh : print information on norms each time test is invoked +VALUE: Medium +HELP: Low : print nothing\nMedium : print information for each step\nHigh : print information for each step and iteration TKWIDGET: TK_AnalWikiInfo TITLE: Sine_Excitation_Parameters QUESTION: Duration#UNITS# diff --git a/OpenSees.tcl b/OpenSees.tcl index 00f33ec..a5486dd 100644 --- a/OpenSees.tcl +++ b/OpenSees.tcl @@ -19,11 +19,11 @@ # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # # TCL macros @@ -31,8 +31,8 @@ namespace eval OpenSees { - variable VersionNumber "v2.5.5" - variable InterfaceName [_ "GiD+OpenSees Interface v2.5.5"] + variable VersionNumber "v2.6.0" + variable InterfaceName [_ "GiD+OpenSees Interface v2.6.0"] variable OpenSeesProblemTypePath variable OpenSeesPath variable GiDPath @@ -97,7 +97,7 @@ proc OpenSees::InitGIDProject { dir } { proc OpenSees::ChangeData {} { global GidPriv - variable InterfaceName; + variable InterfaceName set GidPriv(ProgName) $InterfaceName GidChangeDataLabel "Conditions" "" @@ -131,7 +131,7 @@ proc OpenSees::ChangeData {} { proc OpenSees::GetProblemTypePath {} { - variable OpenSeesProblemTypePath; + variable OpenSeesProblemTypePath return $OpenSeesProblemTypePath } @@ -143,8 +143,8 @@ proc OpenSees::SetProjectNameAndPath {} { set ProblemType [lindex $lines 0] set ProjectName [lindex $lines 1] - variable GiDProjectDir; - variable GiDProjectName; + variable GiDProjectDir + variable GiDProjectName # GiD_Info Project returns a list with project information { ProblemType ModelName .. .. .. } @@ -188,7 +188,7 @@ proc OpenSees::GetProjectName {} { proc OpenSees::SetOpenSeesPath {} { - variable OpenSeesPath; + variable OpenSeesPath variable OpenSeesProblemTypePath global GidProcWin @@ -205,6 +205,7 @@ proc OpenSees::SetOpenSeesPath {} { regsub -all {\\} $OpenSeesPath {/} OpenSeesPath } else { + if { ![info exists GidProcWin(w)] || \ ![winfo exists $GidProcWin(w).listbox#1] } { set wbase .gid @@ -213,20 +214,21 @@ proc OpenSees::SetOpenSeesPath {} { set wbase $GidProcWin(w) set w $GidProcWin(w).listbox#1 } - tk_dialogRAM $wbase.tmpwin [_ "Error"] [_ "OpenSees path was not found" ] error 0 [_ "Close"] + + tk_dialogRAM $wbase.tmpwin [_ "Error"] [_ "OpenSees.path file was not found. Please re-install interface." ] error 0 [_ "Close"] } } proc OpenSees::GetOpenSeesPath {} { - variable OpenSeesPath; + variable OpenSeesPath return $OpenSeesPath } # Get OpenSees version proc OpenSees::GetVersion {} { - variable VersionNumber; + variable VersionNumber return $VersionNumber } @@ -243,68 +245,68 @@ proc OpenSees::Toolbar1 {{type "DEFAULT INSIDELEFT"}} { proc Opt1_1 { } { GidOpenMaterials Standard_Uniaxial_Materials - HideInforBar + HideInfoBar } proc Opt1_2 { } { GidOpenMaterials Uniaxial_Concrete_Materials - HideInforBar + HideInfoBar } proc Opt1_3 { } { GidOpenMaterials Uniaxial_Steel_Materials - HideInforBar + HideInfoBar } proc Opt1_4 {} { GidOpenMaterials "Multidimensional_(nD)_Materials" - HideInforBar + HideInfoBar } proc Opt1_5 { } { GidOpenMaterials "Section_Force-Deformation" - HideInforBar + HideInfoBar } proc Opt1_6 { } { GidOpenMaterials "Combined_Materials" - HideInforBar + HideInfoBar } proc Opt1_7 { } { GidOpenMaterials "Records" - HideInforBar + HideInfoBar } - + proc Opt1_8 { } { GidOpenConditions Restraints - HideInforBar + HideInfoBar } proc Opt1_9 { } { GidOpenConditions Constraints - HideInforBar + HideInfoBar } proc Opt1_10 { } { GidOpenConditions Mass/Damping - HideInforBar + HideInfoBar } proc Opt1_11 { } { GidOpenConditions Loads - HideInforBar + HideInfoBar } set ToolbarBitmaps1(0) " \ @@ -380,55 +382,55 @@ proc OpenSees::Toolbar2 {{type "DEFAULT INSIDELEFT"}} { proc Opt2_1 { } { GidOpenConditions ZeroLength_Elements - HideInforBar + HideInfoBar } proc Opt2_2 { } { GidOpenMaterials Truss_Elements - HideInforBar + HideInfoBar } proc Opt2_3 { } { GidOpenMaterials "Beam-Column_Elements" - HideInforBar + HideInfoBar } proc Opt2_4 { } { GidOpenMaterials Surface_Elements - HideInforBar + HideInfoBar } proc Opt2_5 { } { GidOpenMaterials Solid_Elements - HideInforBar + HideInfoBar } proc Opt2_6 { } { GidOpenProblemData "General_Data" - HideInforBar + HideInfoBar } proc Opt2_7 { } { GidOpenProblemData "Output_Options" - HideInforBar + HideInfoBar } proc Opt2_8 { } { GiD_Process Mescape Data IDataWindow - HideInforBar + HideInfoBar } proc Opt2_9 { } { GiD_Process Mescape Meshing generate - HideInforBar + HideInfoBar } proc Opt2_10 { } { @@ -462,7 +464,7 @@ proc OpenSees::Toolbar2 {{type "DEFAULT INSIDELEFT"}} { variable ElemDrawStatus 0 - proc Opt2_12 { } { # Switch draw elements + proc Opt2_12 { } {; # Switch draw elements variable ElemDrawStatus variable NormalsDrawStatus @@ -487,7 +489,7 @@ proc OpenSees::Toolbar2 {{type "DEFAULT INSIDELEFT"}} { variable ConditionsDrawStatus 0 - proc Opt2_13 { } { # Switch draw conditions + proc Opt2_13 { } {; # Switch draw conditions variable ElemDrawStatus variable NormalsDrawStatus @@ -529,6 +531,8 @@ proc OpenSees::Toolbar2 {{type "DEFAULT INSIDELEFT"}} { img/Toolbar/$GiDtheme/btn_Mesh.png \ img/Toolbar/$GiDtheme/btn_Calc.png \ img/Toolbar/$GiDtheme/btn_Separator.png \ + img/Toolbar/$GiDtheme/btn_tcl.png \ + img/Toolbar/$GiDtheme/btn_Separator.png \ img/Toolbar/$GiDtheme/btn_LocalAxes.png \ img/Toolbar/$GiDtheme/btn_ViewElem.png \ img/Toolbar/$GiDtheme/btn_ViewCond.png \ @@ -547,10 +551,12 @@ proc OpenSees::Toolbar2 {{type "DEFAULT INSIDELEFT"}} { [list -np- OpenSees::Opt2_9] \ [list -np- OpenSees::Opt2_10] \ "" \ + [list -np- btn_Open_tcl] \ + "" \ [list -np- OpenSees::Opt2_11] \ [list -np- OpenSees::Opt2_12] \ [list -np- OpenSees::Opt2_13] \ - [list -np- OpenSees::Opt2_14] + [list -np- OpenSees::Opt2_14] \ ] set ToolbarHelp2(0) { \ @@ -566,6 +572,8 @@ proc OpenSees::Toolbar2 {{type "DEFAULT INSIDELEFT"}} { "Generate Mesh" \ "Create .tcl, run analysis and postprocess" \ "" \ + "Open .tcl file" \ + "" \ "Show/Hide Line Local Axes" \ "Show/Hide Elements" \ "Show/Hide All Conditions for Active Interval" \ @@ -788,15 +796,20 @@ proc LoadGIDProject { filespd } { if { $cmp != 0 } { + if { [winfo exist .splash]} { + destroy .splash + update + } + InitWindow $InfoWin [= "Version mismatch"] ErrorInfo "" "" 1 - if { ![winfo exists $InfoWin] } return ; + if { ![winfo exists $InfoWin] } return ttk::frame $InfoWin.top ttk::label $InfoWin.top.title_text -text [= ""] ttk::frame $InfoWin.information -relief raised ttk::label $InfoWin.information.errormessage -text [= "Current problemtype version ($VersionNumber) is different than saved model version ($spd_data). Please transform your model first."] ttk::frame $InfoWin.bottom ttk::button $InfoWin.bottom.continue -text [= "Transform"] -command "OpenSees::TransformAndClose" - ttk::button $InfoWin.bottom.readlog -text [= "Ignore"] -command "destroy $InfoWin" + ttk::button $InfoWin.bottom.readlog -text [= "Keep old version"] -command "destroy $InfoWin" grid $InfoWin.top.title_text -sticky ew grid $InfoWin.top -sticky new grid $InfoWin.information.errormessage -sticky w -padx 10 -pady 10 @@ -843,7 +856,7 @@ proc SaveGIDProject { filespd } { OpenSees::SetProjectNameAndPath; # Change old project dir to the new one - if { $OldGiDProjectDir != $NewGiDProjectDir} { # If project names are different + if { $OldGiDProjectDir != $NewGiDProjectDir} {; # If project names are different set fexists [file exists "$OldGiDProjectDir/Records"] if {$fexists} { @@ -887,7 +900,7 @@ proc BeforeInitGIDPostProcess {} { proc AfterTransformProblemType { file oldproblemtype newproblemtype messages } { - # if version earlier than v2.5.0, change some conditions of compatibillity + # if version earlier than v2.5.0, change some conditions of compatibility # Body Constraint -> Equal Constraint set cond_points [GiD_Info conditions ovpnt] @@ -1012,13 +1025,13 @@ proc AfterTransformProblemType { file oldproblemtype newproblemtype messages } { lappend Idnew [lindex $data 3] } - GiD_UnAssignData condition $old_cond_name points "all" + #GiD_UnAssignData condition $old_cond_name points "all" foreach point $points IDold $Idold IDnew $Idnew { if { $IDold == "-" } { - break; + break } else { @@ -1053,14 +1066,14 @@ proc AfterTransformProblemType { file oldproblemtype newproblemtype messages } { lappend Planes [lindex $data 5] } - GiD_UnAssignData condition $old_cond_name points "all" + #GiD_UnAssignData condition $old_cond_name points "all" foreach point $points IDold $Idold IDnew $Idnew plane $Planes { # - means new user v2.5.0 and later if {$IDold == "-"} { - break; + break } else { @@ -1095,14 +1108,14 @@ proc AfterTransformProblemType { file oldproblemtype newproblemtype messages } { lappend Planes [lindex $data 5] } - GiD_UnAssignData condition $old_cond_name lines "all" + #GiD_UnAssignData condition $old_cond_name lines "all" foreach line $lines IDold $Idold IDnew $Idnew plane $Planes { # - means new user v2.5.0 and later if {$IDold == "-"} { - break; + break } else { @@ -1348,6 +1361,27 @@ proc UpdateInfoBar { } { .ibar.c create text 80 12 -text $dim -font "calibri 12" -fill $ibarTextColor -anchor center .ibar.c create text 170 12 -text $act -font "calibri 12" -fill $ibarTextColor -anchor center + set GiDProjectDir [OpenSees::GetProjectPath] + set GiDProjectName [OpenSees::GetProjectName] + + if {[file exists "$GiDProjectDir/$GiDProjectName.post.res"]} { + + .ibar.c create text 252 12 -text "Ready to postprocess" -font "calibri 12" -fill $ibarTextColor -anchor w + + } elseif {[file exists "$GiDProjectDir/OpenSees/$GiDProjectName.log"]} { + + .ibar.c create text 252 12 -text "Solved" -font "calibri 12" -fill $ibarTextColor -anchor w + + } elseif {[file exists "$GiDProjectDir/OpenSees/$GiDProjectName.tcl"]} { + + .ibar.c create text 252 12 -text "Created" -font "calibri 12" -fill $ibarTextColor -anchor w + + } else { + + .ibar.c create text 252 12 -text "Not created" -font "calibri 12" -fill $ibarTextColor -anchor w + + } + set off 10 .ibar.c create text [expr $w-$off] 12 -text "Lab of R/C and Masonry Structures, AUTh" -font "calibri 10" -fill $ibarLineColor -anchor e @@ -1358,7 +1392,7 @@ proc UpdateInfoBar { } { bind .gid {RefreshInfoBar} bind .gid {RefreshInfoBar} - bind .gid {HideInforBar} + bind .gid {HideInfoBar} bind .gid {RefreshInfoBar} focus .gid.central.s @@ -1381,7 +1415,7 @@ proc RefreshInfoBar { } { } } -proc HideInforBar { } { +proc HideInfoBar { } { lower .ibar update diff --git a/README.md b/README.md index fbefb0f..0138848 100644 --- a/README.md +++ b/README.md @@ -32,9 +32,19 @@ V.K. Papanikolaou, Assistant Professor AUTh --- +**Version 2.6.0 (03/07/2018)** + +- Improved : Nonlinear static analysis solution scheme (load control, displacement control, cyclic displacement control) +- Improved : Information bar displays model state (not created, created, solved, ready to postprocess) +- Supporting the new HDF5 binary format for postprocess +- Added : Open .tcl model file toolbar button +- Minor improvements and bug fixes + +--- + **Version 2.5.5 (21/05/2018)** -- **New feature (beta) : Import geometry from existing .tcl file** +- New feature (beta) : Import geometry from existing .tcl file - Fixed bug in GiD local axes display when global Y is selected as vertical axis (thanks to tejeswar91 for feedback) --- diff --git a/bas/Actions/PlainPatternTimeseriesPath.bas b/bas/Actions/PlainPatternTimeseriesPath.bas index 2256582..9dd1678 100644 --- a/bas/Actions/PlainPatternTimeseriesPath.bas +++ b/bas/Actions/PlainPatternTimeseriesPath.bas @@ -54,7 +54,7 @@ proc ReadPEERfile {inFilename recordValues dt} { # Close the input file close $inFileID } -}; +} *set var procReadPeerFilePrinted=1 *endif *elseif(strcmp(MatProp(Record_file_format),"Single_value_per_line")==0) diff --git a/bas/Analysis/Analyze.bas b/bas/Analysis/Analyze.bas index b93e3be..67b12a1 100644 --- a/bas/Analysis/Analyze.bas +++ b/bas/Analysis/Analyze.bas @@ -4,7 +4,7 @@ *if(IntvNum==1 && GenData(Activate_eigenvalue_analysis,int)==1) # Perform eigenvalue analysis -puts "Running eigenvalue analysis ...\n" +puts "Running eigenvalue analysis\n" set numModes *GenData(Number_of_eigenvalues,int) @@ -208,12 +208,12 @@ analysis *IntvData(Analysis_type) *# *# Pushover analysis (Displacement Control) *# -*include PushoverAnalysis.bas +*include StaticDisplacementControl.bas *elseif(strcmp(IntvData(Solution_algorithm),"Linear")!=0 && strcmp(IntvData(Integrator_type),"Load_control")==0) *# *# Pushover analysis analysis (Load Control) *# -*include PushoverLoadAnalysis.bas +*include StaticLoadControl.bas *else *# *# Linear analysis @@ -230,9 +230,10 @@ for {set i 1} { $i <= *steps } {incr i 1} { } if {$AnalOk == 0} { puts "\nAnalysis completed SUCCESSFULLY" - puts "Committed steps : *steps\n" + puts "Committed steps : $committedSteps\n" } else { - puts "\nAnalysis FAILED\n" + puts "\nAnalysis FAILED" + puts "Committed steps : $committedSteps\n" } *endif *# diff --git a/bas/Analysis/PushoverAnalysis.bas b/bas/Analysis/PushoverAnalysis.bas deleted file mode 100644 index f5d168f..0000000 --- a/bas/Analysis/PushoverAnalysis.bas +++ /dev/null @@ -1,470 +0,0 @@ - -*format "%g" -*if(strcmp(IntvData(Control_node_direction),"UX")==0 || strcmp(IntvData(Control_node_direction),"UY")==0 || strcmp(IntvData(Control_node_direction),"UZ")==0) -set Dmax *IntvData(Total_displacement,real) -*# Rotation control direction -*else -set Dmax *IntvData(Total_rotation,real) -*endif -*format "%f" -set Dincr *DispIncr -*format "%d" -set Nsteps *steps -set committedSteps 1 -set IDctrlNode *IntvData(Control_node,int) -set IDctrlDOF *NodeCtrlDOF - -*if(strcmp(IntvData(Convergence_criterion),"Norm_Unbalance")==0) -variable testTypeStatic NormUnbalance -*elseif(strcmp(IntvData(Convergence_criterion),"Norm_Displacement_Increment")==0) -variable testTypeStatic NormDispIncr -*elseif(strcmp(IntvData(Convergence_criterion),"Energy_Increment")==0) -variable testTypeStatic EnergyIncr -*elseif(strcmp(IntvData(Convergence_criterion),"Relative_Norm_Unbalance")==0) -variable testTypeStatic RelativeNormUnbalance -*elseif(strcmp(IntvData(Convergence_criterion),"Relative_Norm_Displacement_Increment")==0) -variable testTypeStatic RelativeNormDispIncr -*elseif(strcmp(IntvData(Convergence_criterion),"Total_Relative_Norm_Displacement_Increment")==0) -variable testTypeStatic RelativeTotalNormDispIncr -*elseif(strcmp(IntvData(Convergence_criterion),"Relative_Energy_Increment")==0) -variable testTypeStatic RelativeEnergyIncr -*elseif(strcmp(IntvData(Convergence_criterion),"Fixed_Number_of_Iterations")==0) -variable testTypeStatic FixedNumIter -*endif -*format "%g" -variable TolStatic *IntvData(Tolerance,real) -variable maxNumIterStatic *IntvData(Max_Iterations_per_Step,int) -*if(strcmp(IntvData(Solution_algorithm),"Full_Newton-Raphson")==0) -variable algorithmTypeStatic Newton -*elseif(strcmp(IntvData(Solution_algorithm),"Modified_Newton-Raphson")==0) -variable algorithmTypeStatic ModifiedNewton -*elseif(strcmp(IntvData(Solution_algorithm),"Newton-Raphson_with_line_search")==0) -variable algorithmTypeStatic NewtonLineSearch -*elseif(strcmp(IntvData(Solution_algorithm),"Broyden")==0) -variable algorithmTypeStatic Broyden -*elseif(strcmp(IntvData(Solution_algorithm),"BFGS")==0) -variable algorithmTypeStatic BFGS -*elseif(strcmp(IntvData(Solution_algorithm),"KrylovNewton")==0) -variable algorithmTypeStatic KrylovNewton -*endif -for {set i 1} { $i <= $Nsteps } {incr i 1} { - set t [getTime] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - if {$AnalOk !=0} { - break - } else { - set committedSteps [expr $committedSteps+1] - } -} - -if {$AnalOk != 0} { - # if analysis fails, different algorithms are applied - set Dstep 0.0 - set AnalOk 0 - set Nk 1 - while {$Dstep <= 1.0 && $AnalOk == 0} { - set controlDisp [nodeDisp $IDctrlNode $IDctrlDOF] - set Dstep [expr $controlDisp/$Dmax] - if {($Nk==2 && $AnalOk==0) || ($Nk==1 && $AnalOk==0)} { - set Nk 1 - puts "\nApplying initial step\n" - integrator DisplacementControl $IDctrlNode $IDctrlDOF $Dincr; # bring back to original increment - set t [getTime] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1]; # this will return zero if no convergence problems were encountered -*if(IntvData(Use_initial_stiffness_iterations,int)==0) - if {$AnalOk != 0} { - puts "\nTrying Newton-Raphson with Initial Stiffness\n" - test NormDispIncr $TolStatic 1000 0 - algorithm Newton -initial - set t [getTime] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag - algorithm $algorithmTypeStatic - } - if {$AnalOk !=0} { - puts "\nTrying Modified Newton-Raphson with Initial Stiffness\n" - test NormDispIncr $TolStatic 1000 0 - algorithm ModifiedNewton -initial - set t [getTime] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag - algorithm $algorithmTypeStatic - } -*else - if {$AnalOk != 0} { - puts "\nTrying Newton-Raphson\n" - test NormDispIncr $TolStatic 1000 0 - algorithm Newton - set t [getTime] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag - algorithm $algorithmTypeStatic - } - if {$AnalOk !=0} { - puts "\nTrying Modified Newton-Raphson\n" - test NormDispIncr $TolStatic 1000 0 - algorithm ModifiedNewton - set t [getTime] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag - algorithm $algorithmTypeStatic - } -*endif - if {$AnalOk != 0} { - puts "\nTrying Broyden\n" - algorithm Broyden 8 - set t [getTime] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - algorithm $algorithmTypeStatic - } - if {$AnalOk != 0} { - puts "\nTrying Newton-Raphson with Line Search\n" - algorithm NewtonLineSearch - set t [getTime] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - algorithm $algorithmTypeStatic - } - if {$AnalOk !=0} { - puts "\nTrying BFGS\n" - algorithm BFGS - set t [getTime] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - algorithm $algorithmTypeStatic - } - - if {$AnalOk == 0} { - set committedSteps [expr $committedSteps+1] - } - } - - if {($AnalOk !=0 && $Nk==1) || ($AnalOk==0 && $Nk==4)} {; # reduce step size if still fails to converge - set Nk 2; # reduce step size - puts "\nApplying substepping / 2\n" - set DincrReduced [expr $Dincr/$Nk] - integrator DisplacementControl $IDctrlNode $IDctrlDOF $DincrReduced - for {set ik 1} {$ik <=$Nk} {incr ik 1} { - set t [getTime] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1]; # this will return zero if no convergence problems were encountered -*if(IntvData(Use_initial_stiffness_iterations,int)==0) - if {$AnalOk != 0} { - puts "\nTrying Newton-Raphson with Initial Stiffness\n" - test NormDispIncr $TolStatic 1000 0 - algorithm Newton -initial - set t [getTime] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag - algorithm $algorithmTypeStatic - } - if {$AnalOk !=0} { - puts "\nTrying Modified Newton-Raphson with Initial Stiffness\n" - test NormDispIncr $TolStatic 1000 0 - algorithm ModifiedNewton -initial - set t [getTime] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag - algorithm $algorithmTypeStatic - } -*else - if {$AnalOk != 0} { - puts "\nTrying Newton-Raphson\n" - test NormDispIncr $TolStatic 1000 0 - algorithm Newton - set t [getTime] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag - algorithm $algorithmTypeStatic - } - if {$AnalOk !=0} { - puts "\nTrying Modified Newton-Raphson\n" - test NormDispIncr $TolStatic 1000 0 - algorithm ModifiedNewton - set t [getTime] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag - algorithm $algorithmTypeStatic - } -*endif - if {$AnalOk != 0} { - puts "\nTrying Broyden\n" - algorithm Broyden 8 - set t [getTime] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - algorithm $algorithmTypeStatic - } - if {$AnalOk != 0} { - puts "\nTrying Newton-Raphson with Line Search\n" - algorithm NewtonLineSearch - set t [getTime] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - algorithm $algorithmTypeStatic - } - if {$AnalOk !=0} { - puts "\nTrying BFGS\n" - algorithm BFGS - set t [getTime] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - algorithm $algorithmTypeStatic - } - if {$AnalOk == 0} { - set committedSteps [expr $committedSteps+1] - } - } - } - - # if step size bisection is not enough, it is bisected again - if {($AnalOk !=0 && $Nk==2) || ($AnalOk==0 && $Nk==8)} { - set Nk 4; # reduce step size - puts "\nApplying substepping / 4\n" - set DincrReduced [expr $Dincr/$Nk] - integrator DisplacementControl $IDctrlNode $IDctrlDOF $DincrReduced - for {set ik 1} {$ik <=$Nk} {incr ik 1} { - set t [getTime] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1]; # this will return zero if no convergence problems were encountered -*if(IntvData(Use_initial_stiffness_iterations,int)==1) - if {$AnalOk != 0} { - puts "\nTrying Newton-Raphson with Initial Stiffness\n" - test NormDispIncr $TolStatic 1000 0 - algorithm Newton -initial - set t [getTime] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag - algorithm $algorithmTypeStatic - } - if {$AnalOk !=0} { - puts "\nTrying Modified Newton-Raphson with Initial Stiffness\n" - test NormDispIncr $TolStatic 1000 0 - algorithm ModifiedNewton -initial - set t [getTime] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag - algorithm $algorithmTypeStatic - } -*else - if {$AnalOk != 0} { - puts "\nTrying Newton-Raphson\n" - test NormDispIncr $TolStatic 1000 0 - algorithm Newton - set t [getTime] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag - algorithm $algorithmTypeStatic - } - if {$AnalOk !=0} { - puts "\nTrying Modified Newton-Raphson\n" - test NormDispIncr $TolStatic 1000 0 - algorithm ModifiedNewton - set t [getTime] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag - algorithm $algorithmTypeStatic - } -*endif - if {$AnalOk != 0} { - puts "\nTrying Broyden\n" - algorithm Broyden 8 - set t [getTime] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1 ] - algorithm $algorithmTypeStatic - } - if {$AnalOk != 0} { - puts "\nTrying Newton-Raphson with Line Search\n" - algorithm NewtonLineSearch - set t [getTime] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - algorithm $algorithmTypeStatic - } - if {$AnalOk !=0} { - puts "\nTrying BFGS\n" - algorithm BFGS - set t [getTime] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - algorithm $algorithmTypeStatic - } - if {$AnalOk == 0} { - set committedSteps [expr $committedSteps+1] - } - } - } - - # if step size double bisection is not enough, it is bisected again - if {$AnalOk !=0 && $Nk==4} { - set Nk 8; # reduce step size - puts "\nApplying substepping / 8\n" - set DincrReduced [expr $Dincr/$Nk] - integrator DisplacementControl $IDctrlNode $IDctrlDOF $DincrReduced - for {set ik 1} {$ik <=$Nk} {incr ik 1} { - set t [getTime] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1]; # this will return zero if no convergence problems were encountered -*if(IntvData(Use_initial_stiffness_iterations,int)==1) - if {$AnalOk != 0} { - puts "\nTrying Newton-Raphson with Initial Stiffness\n" - test NormDispIncr $TolStatic 1000 0 - algorithm Newton -initial - set t [getTime] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag - algorithm $algorithmTypeStatic - } - if {$AnalOk !=0} { - puts "\nTrying Modified Newton-Raphson with Initial Stiffness\n" - test NormDispIncr $TolStatic 1000 0 - algorithm ModifiedNewton -initial - set t [getTime] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag - algorithm $algorithmTypeStatic - } -*else - if {$AnalOk != 0} { - puts "\nTrying Newton-Raphson\n" - test NormDispIncr $TolStatic 1000 0 - algorithm Newton - set t [getTime] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag - algorithm $algorithmTypeStatic - } - if {$AnalOk !=0} { - puts "\nTrying Modified Newton-Raphson\n" - test NormDispIncr $TolStatic 1000 0 - algorithm ModifiedNewton - set t [getTime] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag - algorithm $algorithmTypeStatic - } -*endif - if {$AnalOk != 0} { - puts "\nTrying Broyden\n" - algorithm Broyden 8 - set t [getTime] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - algorithm $algorithmTypeStatic - } - if {$AnalOk != 0} { - puts "\nTrying Newton-Raphson with LineSearch\n" - algorithm NewtonLineSearch - set t [getTime] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - algorithm $algorithmTypeStatic - } - if {$AnalOk !=0} { - puts "\nTrying BFGS\n" - algorithm BFGS - set t [getTime] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - algorithm $algorithmTypeStatic - } - if {$AnalOk == 0} { - set committedSteps [expr $committedSteps+1] - } - } - }; # end if Nk=8 - }; # end while loop -}; # end if AnalOk - -if {$AnalOk != 0 } { - puts "\nAnalysis FAILED\n" -} else { - puts "\nAnalysis completed SUCCESSFULLY" - puts "Committed steps : $committedSteps\n" -} \ No newline at end of file diff --git a/bas/Analysis/PushoverLoadAnalysis.bas b/bas/Analysis/PushoverLoadAnalysis.bas deleted file mode 100644 index 1911e12..0000000 --- a/bas/Analysis/PushoverLoadAnalysis.bas +++ /dev/null @@ -1,385 +0,0 @@ - -*# LoadIncr must be floating! -*format "%f" -set Lincr *LoadIncr -*format "%d" -set Nsteps *steps -set committedSteps 1 - -*if(strcmp(IntvData(Convergence_criterion),"Norm_Unbalance")==0) -variable testTypeStatic NormUnbalance -*elseif(strcmp(IntvData(Convergence_criterion),"Norm_Displacement_Increment")==0) -variable testTypeStatic NormDispIncr -*elseif(strcmp(IntvData(Convergence_criterion),"Energy_Increment")==0) -variable testTypeStatic EnergyIncr -*elseif(strcmp(IntvData(Convergence_criterion),"Relative_Norm_Unbalance")==0) -variable testTypeStatic RelativeNormUnbalance -*elseif(strcmp(IntvData(Convergence_criterion),"Relative_Norm_Displacement_Increment")==0) -variable testTypeStatic RelativeNormDispIncr -*elseif(strcmp(IntvData(Convergence_criterion),"Total_Relative_Norm_Displacement_Increment")==0) -variable testTypeStatic RelativeTotalNormDispIncr -*elseif(strcmp(IntvData(Convergence_criterion),"Relative_Energy_Increment")==0) -variable testTypeStatic RelativeEnergyIncr -*elseif(strcmp(IntvData(Convergence_criterion),"Fixed_Number_of_Iterations")==0) -variable testTypeStatic FixedNumIter -*endif -*format "%g" -variable TolStatic *IntvData(Tolerance,real) -variable maxNumIterStatic *IntvData(Max_Iterations_per_Step,int) -*if(strcmp(IntvData(Solution_algorithm),"Full_Newton-Raphson")==0) -variable algorithmTypeStatic Newton -*elseif(strcmp(IntvData(Solution_algorithm),"Modified_Newton-Raphson")==0) -variable algorithmTypeStatic ModifiedNewton -*elseif(strcmp(IntvData(Solution_algorithm),"Newton-Raphson_with_line_search")==0) -variable algorithmTypeStatic NewtonLineSearch -*elseif(strcmp(IntvData(Solution_algorithm),"Broyden")==0) -variable algorithmTypeStatic Broyden -*elseif(strcmp(IntvData(Solution_algorithm),"BFGS")==0) -variable algorithmTypeStatic BFGS -*elseif(strcmp(IntvData(Solution_algorithm),"KrylovNewton")==0) -variable algorithmTypeStatic KrylovNewton -*endif -set LoadCounter 0 -for {set i 1} { $i <= $Nsteps } {incr i 1} { - set t [format "%7.5f" [expr [getTime] + $Lincr]] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - if {$AnalOk !=0} { - break - } else { - set LoadCounter [expr $LoadCounter+1.0] - set committedSteps [expr $committedSteps+1] - } -} - -if {$AnalOk != 0} { - # if analysis fails, different stepping and algorithms are applied - set AnalOk 0 - set Nk 1 - while {$LoadCounter < $Nsteps && $AnalOk == 0} { - - if {($Nk==2 && $AnalOk==0) || ($Nk==1 && $AnalOk==0)} { - set Nk 1 - puts "\nApplying initial step\n" - integrator LoadControl $Lincr; # bring back to original increment - set t [format "%7.5f" [expr [getTime] + $Lincr]] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1]; # this will return zero if no convergence problems were encountered - if {$AnalOk == 0} { - set LoadCounter [expr $LoadCounter+1.0/$Nk] - set committedSteps [expr $committedSteps+1] - } - } - - if {($AnalOk !=0 && $Nk==1) || ($AnalOk==0 && $Nk==4)} {; # reduce step size if still fails to converge - set Nk 2; # reduce step size - puts "\nApplying substepping / 2\n" - set LincrReduced [expr $Lincr/$Nk] - integrator LoadControl $LincrReduced - for {set ik 1} {$ik <=$Nk} {incr ik 1} { - set t [format "%7.5f" [expr [getTime] + $LincrReduced]] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1]; # this will return zero if no convergence problems were encountered -*if(IntvData(Use_initial_stiffness_iterations,int)==0) - if {$AnalOk != 0} { - puts "\nTrying Newton-Raphson with Initial Stiffness\n" - test NormDispIncr $TolStatic 2000 0 - algorithm Newton -initial - set t [format "%7.5f" [expr [getTime] + $LincrReduced]] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag - algorithm $algorithmTypeStatic - } - if {$AnalOk !=0} { - puts "\nTrying Modified Newton-Raphson with Initial Stiffness\n" - test NormDispIncr $TolStatic 2000 0 - algorithm ModifiedNewton -initial - set t [format "%7.5f" [expr [getTime] + $LincrReduced]] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag - algorithm $algorithmTypeStatic - } -*else - if {$AnalOk != 0} { - puts "\nTrying Newton-Raphson\n" - test NormDispIncr $TolStatic 2000 0 - algorithm Newton - set t [format "%7.5f" [expr [getTime] + $LincrReduced]] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag - algorithm $algorithmTypeStatic - } - if {$AnalOk !=0} { - puts "\nTrying Modified Newton-Raphson\n" - test NormDispIncr $TolStatic 2000 0 - algorithm ModifiedNewton - set t [format "%7.5f" [expr [getTime] + $LincrReduced]] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag - algorithm $algorithmTypeStatic - } -*endif - if {$AnalOk != 0} { - puts "\nTrying Broyden\n" - algorithm Broyden 8 - set t [format "%7.5f" [expr [getTime] + $LincrReduced]] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - algorithm $algorithmTypeStatic - } - if {$AnalOk != 0} { - puts "\nTrying Newton-Raphson with Line Search\n" - algorithm NewtonLineSearch - set t [format "%7.5f" [expr [getTime] + $LincrReduced]] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - algorithm $algorithmTypeStatic - } - if {$AnalOk !=0} { - puts "\nTrying BFGS\n" - algorithm BFGS - set t [format "%7.5f" [expr [getTime] + $LincrReduced]] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - algorithm $algorithmTypeStatic - } - - if {$AnalOk == 0} { - set LoadCounter [expr $LoadCounter+1.0/$Nk] - set committedSteps [expr $committedSteps+1] - } - } - } - - # if step size bisection is not enough, it is bisected again - if {($AnalOk !=0 && $Nk==2) || ($AnalOk==0 && $Nk==8)} { - set Nk 4; # reduce step size - puts "\nApplying substepping / 4\n" - set LincrReduced [expr $Lincr/$Nk] - integrator LoadControl $LincrReduced - for {set ik 1} {$ik <=$Nk} {incr ik 1} { - set t [format "%7.5f" [expr [getTime] + $LincrReduced]] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1]; # this will return zero if no convergence problems were encountered -*if(IntvData(Use_initial_stiffness_iterations,int)==1) - if {$AnalOk != 0} { - puts "\nTrying Newton-Raphson with Initial Stiffness\n" - test NormDispIncr $TolStatic 2000 0 - algorithm Newton -initial - set t [format "%7.5f" [expr [getTime] + $LincrReduced]] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag - algorithm $algorithmTypeStatic - } - if {$AnalOk !=0} { - puts "\nTrying Modified Newton-Raphson with Initial Stiffness\n" - test NormDispIncr $TolStatic 2000 0 - algorithm ModifiedNewton -initial - set t [format "%7.5f" [expr [getTime] + $LincrReduced]] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag - algorithm $algorithmTypeStatic - } -*else - if {$AnalOk != 0} { - puts "\nTrying Newton-Raphson\n" - test NormDispIncr $TolStatic 2000 0 - algorithm Newton - set t [format "%7.5f" [expr [getTime] + $LincrReduced]] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag - algorithm $algorithmTypeStatic - } - if {$AnalOk !=0} { - puts "\nTrying Modified Newton-Raphson\n" - test NormDispIncr $TolStatic 2000 0 - algorithm ModifiedNewton - set t [format "%7.5f" [expr [getTime] + $LincrReduced]] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag - algorithm $algorithmTypeStatic - } -*endif - if {$AnalOk != 0} { - puts "\nTrying Broyden\n" - algorithm Broyden 8 - set t [format "%7.5f" [expr [getTime] + $LincrReduced]] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - algorithm $algorithmTypeStatic - } - if {$AnalOk != 0} { - puts "\nTrying Newton-Raphson with Line Search\n" - algorithm NewtonLineSearch - set t [format "%7.5f" [expr [getTime] + $LincrReduced]] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - algorithm $algorithmTypeStatic - } - if {$AnalOk !=0} { - puts "\nTrying BFGS\n" - algorithm BFGS - set t [format "%7.5f" [expr [getTime] + $LincrReduced]] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - algorithm $algorithmTypeStatic - } - if {$AnalOk == 0} { - set LoadCounter [expr $LoadCounter+1.0/$Nk] - set committedSteps [expr $committedSteps+1] - } - } - } - - # if step size double bisection is not enough, it is bisected again - if {$AnalOk !=0 && $Nk==4} { - set Nk 8; # reduce step size - puts "\nApplying substepping / 8\n" - set LincrReduced [expr $Lincr/$Nk] - integrator LoadControl $LincrReduced - for {set ik 1} {$ik <=$Nk} {incr ik 1} { - set t [format "%7.5f" [expr [getTime] + $LincrReduced]] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1]; # this will return zero if no convergence problems were encountered -*if(IntvData(Use_initial_stiffness_iterations,int)==1) - if {$AnalOk != 0} { - puts "\nTrying Newton-Raphson with Initial Stiffness\n" - test NormDispIncr $TolStatic 2000 0 - algorithm Newton -initial - set t [format "%7.5f" [expr [getTime] + $LincrReduced]] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag - algorithm $algorithmTypeStatic - } - if {$AnalOk !=0} { - puts "\nTrying Modified Newton-Raphson with Initial Stiffness\n" - test NormDispIncr $TolStatic 2000 0 - algorithm ModifiedNewton -initial - set t [format "%7.5f" [expr [getTime] + $LincrReduced]] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag - algorithm $algorithmTypeStatic - } -*else - if {$AnalOk != 0} { - puts "\nTrying Newton-Raphson\n" - test NormDispIncr $TolStatic 2000 0 - algorithm Newton - set t [format "%7.5f" [expr [getTime] + $LincrReduced]] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag - algorithm $algorithmTypeStatic - } - if {$AnalOk !=0} { - puts "\nTrying Modified Newton-Raphson\n" - test NormDispIncr $TolStatic 2000 0 - algorithm ModifiedNewton - set t [format "%7.5f" [expr [getTime] + $LincrReduced]] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag - algorithm $algorithmTypeStatic - } -*endif - if {$AnalOk != 0} { - puts "\nTrying Broyden\n" - algorithm Broyden 8 - set t [format "%7.5f" [expr [getTime] + $LincrReduced]] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1 ] - algorithm $algorithmTypeStatic - } - if {$AnalOk != 0} { - puts "\nTrying Newton-Raphson with LineSearch\n" - algorithm NewtonLineSearch - set t [format "%7.5f" [expr [getTime] + $LincrReduced]] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - algorithm $algorithmTypeStatic - } - if {$AnalOk !=0} { - puts "\nTrying BFGS\n" - algorithm BFGS - set t [format "%7.5f" [expr [getTime] + $LincrReduced]] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - algorithm $algorithmTypeStatic - } - if {$AnalOk == 0} { - set LoadCounter [expr $LoadCounter+1.0/$Nk] - set committedSteps [expr $committedSteps+1] - } - } - }; # end if Nk=8 - }; # end while loop -}; # end if AnalOk - -if {$AnalOk != 0 } { - puts "\nAnalysis FAILED\n" -} else { - puts "\nAnalysis completed SUCCESSFULLY" - puts "Committed steps : $committedSteps\n" -} \ No newline at end of file diff --git a/bas/Analysis/SolutionAlgorithmsDynamic.bas b/bas/Analysis/SolutionAlgorithmsDynamic.bas index 8d8fe6a..d5f2605 100644 --- a/bas/Analysis/SolutionAlgorithmsDynamic.bas +++ b/bas/Analysis/SolutionAlgorithmsDynamic.bas @@ -1,4 +1,12 @@ +set committedSteps 1 +set Nsteps [expr int($TmaxAnalysis/$DtAnalysis)] + +*if(IntvData(Use_initial_stiffness_iterations,int)==1) +variable strIni /Ini +*else +variable strIni {} +*endif *if(strcmp(IntvData(Convergence_criterion),"Norm_Unbalance")==0) variable testTypeDynamic NormUnbalance *elseif(strcmp(IntvData(Convergence_criterion),"Norm_Displacement_Increment")==0) @@ -32,12 +40,11 @@ variable algorithmTypeDynamic BFGS *elseif(strcmp(IntvData(Solution_algorithm),"KrylovNewton")==0) variable algorithmTypeDynamic KrylovNewton *endif -set committedSteps 1 -set Nsteps [expr int($TmaxAnalysis/$DtAnalysis)] + for {set i 1} { $i <= $Nsteps } {incr i 1} { set t [format "%7.5f" [expr [getTime] + $DtAnalysis]] *if(PrintTime==1) - puts -nonewline "Time (*IntvNum)$t " + puts -nonewline "(*IntvNum) $algorithmTypeDynamic$strIni Time $t " *endif set AnalOk [analyze 1 $DtAnalysis]; # perform analysis - returns 0 if analysis was successful if {$AnalOk == 0} { @@ -47,11 +54,8 @@ for {set i 1} { $i <= $Nsteps } {incr i 1} { } } -if {$AnalOk != 0} { ; # analysis was not successful - # -------------------------------------------------------------------------------------------------- - # change some analysis parameters to achieve convergence - # performance is slower inside this loop - # Time-controlled analysis +if {$AnalOk != 0} {; # if analysis fails, alternative algorithms and substepping is applied + set firstFail 1 set AnalOk 0 set controlTime [getTime] set Nk 1; # dt = dt/Nk @@ -60,97 +64,102 @@ if {$AnalOk != 0} { ; # analysis was not successful set InitialTolFlag 1 set returnToInitTolFlag 0 set ChangeToleranceFlag 0 - set SkipFirstLoopForToleranceRelaxFlag 1 + set SkipFirstLoopForTolRelaxFlag 1 *endif while {$controlTime < $TmaxAnalysis && $AnalOk == 0} { if { ($Nk == 1 && $AnalOk == 0) || ($Nk == 2 && $AnalOk == 0) } { - set Nk 1 + set Nk 1 if {$returnToInitStepFlag} { - puts "\nBack to initial time step ..\n" + puts "\nBack to initial step\n" set returnToInitStepFlag 0 } *if(IntvData(Tolerance_relaxation,int)==1) if {$returnToInitTolFlag} { - if {!$InitialTolFlag} { - puts "\nBack to initial error tolerance ..\n" + if {!$InitialTolFlag} { + puts "\nBack to initial error tolerance\n" *format "%g" - set TolDynamic [expr $TolDynamic/*IntvData(Relaxation_factor,real)] - set InitialTolFlag 1 + set TolDynamic [expr $TolDynamic/*IntvData(Relaxation_factor,real)] + set InitialTolFlag 1 *if(strcmp(IntvData(Convergence_criterion),"Norm_Unbalance")==0) *format "%d" -test NormUnbalance $TolDynamic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag + test NormUnbalance $TolDynamic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag *elseif(strcmp(IntvData(Convergence_criterion),"Norm_Displacement_Increment")==0) *format "%d" -test NormDispIncr $TolDynamic *IntvData(Max_Iterations_per_Step) *LoggingFlag + test NormDispIncr $TolDynamic *IntvData(Max_Iterations_per_Step) *LoggingFlag *elseif(strcmp(IntvData(Convergence_criterion),"Energy_Increment")==0) *format "%d" -test EnergyIncr $TolDynamic *IntvData(Max_Iterations_per_Step) *LoggingFlag + test EnergyIncr $TolDynamic *IntvData(Max_Iterations_per_Step) *LoggingFlag *elseif(strcmp(IntvData(Convergence_criterion),"Relative_Norm_Unbalance")==0) *format "%d" -test RelativeNormUnbalance $TolDynamic *IntvData(Max_Iterations_per_Step) *LoggingFlag + test RelativeNormUnbalance $TolDynamic *IntvData(Max_Iterations_per_Step) *LoggingFlag *elseif(strcmp(IntvData(Convergence_criterion),"Relative_Norm_Displacement_Increment")==0) *format "%d" -test RelativeNormDispIncr $TolDynamic *IntvData(Max_Iterations_per_Step) *LoggingFlag + test RelativeNormDispIncr $TolDynamic *IntvData(Max_Iterations_per_Step) *LoggingFlag *elseif(strcmp(IntvData(Convergence_criterion),"Total_Relative_Norm_Displacement_Increment")==0) *format "%d" -test RelativeTotalNormDispIncr $TolDynamic *IntvData(Max_Iterations_per_Step) *LoggingFlag + test RelativeTotalNormDispIncr $TolDynamic *IntvData(Max_Iterations_per_Step) *LoggingFlag *elseif(strcmp(IntvData(Convergence_criterion),"Relative_Energy_Increment")==0) *format "%d" -test RelativeEnergyIncr $TolDynamic *IntvData(Max_Iterations_per_Step) *LoggingFlag + test RelativeEnergyIncr $TolDynamic *IntvData(Max_Iterations_per_Step) *LoggingFlag *elseif(strcmp(IntvData(Convergence_criterion),"Fixed_Number_of_Iterations")==0) *format "%d" -test FixedNumIter *IntvData(Max_Iterations_per_Step) *LoggingFlag + test FixedNumIter *IntvData(Max_Iterations_per_Step) *LoggingFlag *endif - } + } } else { - if {$InitialTolFlag && $ChangeToleranceFlag && !$SkipFirstLoopForToleranceRelaxFlag} { + if {$InitialTolFlag && $ChangeToleranceFlag && !$SkipFirstLoopForTolRelaxFlag} { *format "%g" - puts "\nTolerance is multiplied by *IntvData(Relaxation_factor,real) \n" + puts "Tolerance is multiplied by *IntvData(Relaxation_factor,real)\n" *format "%g" - set TolDynamic [expr $TolDynamic***IntvData(Relaxation_factor,real)] - set InitialTolFlag 0 + set TolDynamic [expr $TolDynamic***IntvData(Relaxation_factor,real)] + set InitialTolFlag 0 *if(strcmp(IntvData(Convergence_criterion),"Norm_Unbalance")==0) *format "%d" -test NormUnbalance $TolDynamic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag + test NormUnbalance $TolDynamic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag *elseif(strcmp(IntvData(Convergence_criterion),"Norm_Displacement_Increment")==0) *format "%d" -test NormDispIncr $TolDynamic *IntvData(Max_Iterations_per_Step) *LoggingFlag + test NormDispIncr $TolDynamic *IntvData(Max_Iterations_per_Step) *LoggingFlag *elseif(strcmp(IntvData(Convergence_criterion),"Energy_Increment")==0) *format "%d" -test EnergyIncr $TolDynamic *IntvData(Max_Iterations_per_Step) *LoggingFlag + test EnergyIncr $TolDynamic *IntvData(Max_Iterations_per_Step) *LoggingFlag *elseif(strcmp(IntvData(Convergence_criterion),"Relative_Norm_Unbalance")==0) *format "%d" -test RelativeNormUnbalance $TolDynamic *IntvData(Max_Iterations_per_Step) *LoggingFlag + test RelativeNormUnbalance $TolDynamic *IntvData(Max_Iterations_per_Step) *LoggingFlag *elseif(strcmp(IntvData(Convergence_criterion),"Relative_Norm_Displacement_Increment")==0) *format "%d" -test RelativeNormDispIncr $TolDynamic *IntvData(Max_Iterations_per_Step) *LoggingFlag + test RelativeNormDispIncr $TolDynamic *IntvData(Max_Iterations_per_Step) *LoggingFlag *elseif(strcmp(IntvData(Convergence_criterion),"Total_Relative_Norm_Displacement_Increment")==0) *format "%d" -test RelativeTotalNormDispIncr $TolDynamic *IntvData(Max_Iterations_per_Step) *LoggingFlag + test RelativeTotalNormDispIncr $TolDynamic *IntvData(Max_Iterations_per_Step) *LoggingFlag *elseif(strcmp(IntvData(Convergence_criterion),"Relative_Energy_Increment")==0) *format "%d" -test RelativeEnergyIncr $TolDynamic *IntvData(Max_Iterations_per_Step) *LoggingFlag + test RelativeEnergyIncr $TolDynamic *IntvData(Max_Iterations_per_Step) *LoggingFlag *elseif(strcmp(IntvData(Convergence_criterion),"Fixed_Number_of_Iterations")==0) *format "%d" -test FixedNumIter *IntvData(Max_Iterations_per_Step) *LoggingFlag + test FixedNumIter *IntvData(Max_Iterations_per_Step) *LoggingFlag *endif } } -set SkipFirstLoopForToleranceRelaxFlag 0 + set SkipFirstLoopForTolRelaxFlag 0 *endif - set t [format "%7.5f" [expr [getTime] + $DtAnalysis]] + if {$firstFail == 0} {; # for the first time only, do not repeat previous failed step + set t [format "%7.5f" [expr [getTime] + $DtAnalysis]] *if(PrintTime==1) - puts -nonewline "Time (*IntvNum)$t " + puts -nonewline "(*IntvNum) $algorithmTypeDynamic$strIni Time $t " *endif - set AnalOk [analyze 1 $DtAnalysis] + set AnalOk [analyze 1 $DtAnalysis] + } else { + set AnalOk 1 + set firstFail 0 + } *if((strcmp(IntvData(Solution_algorithm),"Full_Newton-Raphson")==0 && IntvData(Use_initial_stiffness_iterations,int)==0 ) || strcmp(IntvData(Solution_algorithm),"Newton-Raphson_with_line_search")==0 || strcmp(IntvData(Solution_algorithm),"BFGS")==0 || strcmp(IntvData(Solution_algorithm),"Broyden")==0 || strcmp(IntvData(Solution_algorithm),"KrylovNewton")==0) if {$AnalOk != 0} { - puts "\nTrying Newton-Raphson with Initial Stiffness \n" - test NormDispIncr $TolDynamic $maxNumIterDynamic *LoggingFlag + puts "\nTrying NR/initial\n" + test NormDispIncr $TolDynamic $maxNumIterDynamic *LoggingFlag algorithm Newton -initial set t [format "%7.5f" [expr [getTime] + $DtAnalysis]] *if(PrintTime==1) - puts -nonewline "Time (*IntvNum)$t " + puts -nonewline "(*IntvNum) Newton/Ini Time $t " *endif set AnalOk [analyze 1 $DtAnalysis] test $testTypeDynamic $TolDynamic $maxNumIterDynamic *LoggingFlag @@ -159,12 +168,12 @@ set SkipFirstLoopForToleranceRelaxFlag 0 *endif *if(strcmp(IntvData(Solution_algorithm),"Modified_Newton-Raphson")==0 && IntvData(Use_initial_stiffness_iterations,int)==0) if {$AnalOk != 0} { - puts "\nTrying Modified Newton-Raphson with Initial Stiffness \n" - test NormDispIncr $TolDynamic $maxNumIterDynamic *LoggingFlag + puts "\nTrying mNR/initial\n" + test NormDispIncr $TolDynamic $maxNumIterDynamic *LoggingFlag algorithm ModifiedNewton -initial set t [format "%7.5f" [expr [getTime] + $DtAnalysis]] *if(PrintTime==1) - puts -nonewline "Time (*IntvNum)$t " + puts -nonewline "(*IntvNum) ModifiedNewton/Ini Time $t " *endif set AnalOk [analyze 1 $DtAnalysis] test $testTypeDynamic $TolDynamic $maxNumIterDynamic *LoggingFlag @@ -174,11 +183,12 @@ set SkipFirstLoopForToleranceRelaxFlag 0 if {$AnalOk == 0} { set committedSteps [expr $committedSteps+1] } - } + }; # end if Nk=1 + # substepping /2 if {($Nk == 1 && $AnalOk!=0) || ($Nk == 4 && $AnalOk==0)} { set Nk 2.0 set continueFlag 1 -puts "\nInitial time step is divided by 2 ..\n" + puts "\nInitial step is divided by 2\n" set currTime1 [getTime] set curStep [expr int($currTime1/$DtAnalysis)] set remStep1 [expr int(($Nsteps-$curStep)**2.0)] @@ -187,38 +197,38 @@ puts "\nInitial time step is divided by 2 ..\n" if {$continueFlag==0} { break } - set t [format "%7.5f" [expr [getTime] + $ReducedDtAnalysis]] + set t [format "%7.5f" [expr [getTime] + $ReducedDtAnalysis]] *if(PrintTime==1) - puts -nonewline "Time (*IntvNum)$t " + puts -nonewline "(*IntvNum) $algorithmTypeDynamic$strIni Time $t " *endif - set AnalOk [analyze 1 $ReducedDtAnalysis] + set AnalOk [analyze 1 $ReducedDtAnalysis] *if((strcmp(IntvData(Solution_algorithm),"Full_Newton-Raphson")==0 && IntvData(Use_initial_stiffness_iterations,int)==0 ) || strcmp(IntvData(Solution_algorithm),"Newton-Raphson_with_line_search")==0 || strcmp(IntvData(Solution_algorithm),"BFGS")==0 || strcmp(IntvData(Solution_algorithm),"Broyden")==0 || strcmp(IntvData(Solution_algorithm),"KrylovNewton")==0) - if {$AnalOk != 0} { - puts "\nTrying Newton-Raphson with Initial Stiffness \n" - test NormDispIncr $TolDynamic $maxNumIterDynamic *LoggingFlag - algorithm Newton -initial - set t [format "%7.5f" [expr [getTime] + $ReducedDtAnalysis]] + if {$AnalOk != 0} { + puts "\nTrying NR/initial\n" + test NormDispIncr $TolDynamic $maxNumIterDynamic *LoggingFlag + algorithm Newton -initial + set t [format "%7.5f" [expr [getTime] + $ReducedDtAnalysis]] *if(PrintTime==1) - puts -nonewline "Time (*IntvNum)$t " + puts -nonewline "(*IntvNum) Newton/Ini Time $t " *endif - set AnalOk [analyze 1 $ReducedDtAnalysis] - test $testTypeDynamic $TolDynamic $maxNumIterDynamic *LoggingFlag - algorithm $algorithmTypeDynamic - } + set AnalOk [analyze 1 $ReducedDtAnalysis] + test $testTypeDynamic $TolDynamic $maxNumIterDynamic *LoggingFlag + algorithm $algorithmTypeDynamic + } *endif *if(strcmp(IntvData(Solution_algorithm),"Modified_Newton-Raphson")==0 && IntvData(Use_initial_stiffness_iterations,int)==0) - if {$AnalOk != 0} { - puts "\nTrying Modified Newton-Raphson with Initial Stiffness \n" - test NormDispIncr $TolDynamic $maxNumIterDynamic *LoggingFlag - algorithm ModifiedNewton -initial - set t [format "%7.5f" [expr [getTime] + $ReducedDtAnalysis]] + if {$AnalOk != 0} { + puts "\nTrying mNR/initial\n" + test NormDispIncr $TolDynamic $maxNumIterDynamic *LoggingFlag + algorithm ModifiedNewton -initial + set t [format "%7.5f" [expr [getTime] + $ReducedDtAnalysis]] *if(PrintTime==1) - puts -nonewline "Time (*IntvNum)$t " + puts -nonewline "(*IntvNum) ModifiedNewton/Ini Time $t " *endif - set AnalOk [analyze 1 $ReducedDtAnalysis] - test $testTypeDynamic $TolDynamic $maxNumIterDynamic *LoggingFlag - algorithm $algorithmTypeDynamic - } + set AnalOk [analyze 1 $ReducedDtAnalysis] + test $testTypeDynamic $TolDynamic $maxNumIterDynamic *LoggingFlag + algorithm $algorithmTypeDynamic + } *endif if {$AnalOk == 0} { set committedSteps [expr $committedSteps+1] @@ -226,35 +236,33 @@ puts "\nInitial time step is divided by 2 ..\n" set continueFlag 0 } } - if {$AnalOk == 0} { - set returnToInitStepFlag 1 - } - } + if {$AnalOk == 0} { + set returnToInitStepFlag 1 + } + }; # end if Nk=2 *if(IntvData(Tolerance_relaxation,int)==1) *if(strcmp(IntvData(Tolerance_relaxation_after_failed_substepping_of),"/2")==0) -if {$AnalOk != 0 } { - if {$InitialTolFlag} { - - set Nk 1; # go back to initial step and there tolerance is updated - set AnalOk 0 - set returnToInitStepFlag 1 - set ChangeToleranceFlag 1 - set returnToInitTolFlag 0 + if {$AnalOk != 0 } { + if {$InitialTolFlag} { + set Nk 1; # back to initial step - tolerance relaxation + set AnalOk 0 + set returnToInitStepFlag 1 + set ChangeToleranceFlag 1 + set returnToInitTolFlag 0 + } + } else { + if {!$InitialTolFlag} { + set Nk 1 + set returnToInitTolFlag 1 + } } -} else { - if {!$InitialTolFlag} { - - set Nk 1 - set returnToInitTolFlag 1 - - } -} *endif *endif + # substepping /4 if {($Nk == 2 && $AnalOk!=0) || ($Nk == 8 && $AnalOk == 0)} { set Nk 4.0 set continueFlag 1 -puts "\nInitial time step is divided by 4 ..\n" + puts "\nInitial step is divided by 4\n" set currTime2 [getTime] set curStep [expr ($currTime2-$currTime1)/$ReducedDtAnalysis] set remStep2 [expr int(($remStep1-$curStep)**2.0)] @@ -265,36 +273,36 @@ puts "\nInitial time step is divided by 4 ..\n" } set t [format "%7.5f" [expr [getTime] + $ReducedDtAnalysis]] *if(PrintTime==1) - puts -nonewline "Time (*IntvNum)$t " + puts -nonewline "(*IntvNum) $algorithmTypeDynamic$strIni Time $t " *endif set AnalOk [analyze 1 $ReducedDtAnalysis] *if((strcmp(IntvData(Solution_algorithm),"Full_Newton-Raphson")==0 && IntvData(Use_initial_stiffness_iterations,int)==0 ) || strcmp(IntvData(Solution_algorithm),"Newton-Raphson_with_line_search")==0 || strcmp(IntvData(Solution_algorithm),"BFGS")==0 || strcmp(IntvData(Solution_algorithm),"Broyden")==0 || strcmp(IntvData(Solution_algorithm),"KrylovNewton")==0) - if {$AnalOk != 0} { - puts "\nTrying Newton-Raphson with Initial Stiffness \n" - test NormDispIncr $TolDynamic $maxNumIterDynamic *LoggingFlag - algorithm Newton -initial - set t [format "%7.5f" [expr [getTime] + $ReducedDtAnalysis]] + if {$AnalOk != 0} { + puts "\nTrying NR/initial\n" + test NormDispIncr $TolDynamic $maxNumIterDynamic *LoggingFlag + algorithm Newton -initial + set t [format "%7.5f" [expr [getTime] + $ReducedDtAnalysis]] *if(PrintTime==1) - puts -nonewline "Time (*IntvNum)$t " + puts -nonewline "(*IntvNum) Newton/Ini Time $t " *endif - set AnalOk [analyze 1 $ReducedDtAnalysis] - test $testTypeDynamic $TolDynamic $maxNumIterDynamic *LoggingFlag - algorithm $algorithmTypeDynamic - } + set AnalOk [analyze 1 $ReducedDtAnalysis] + test $testTypeDynamic $TolDynamic $maxNumIterDynamic *LoggingFlag + algorithm $algorithmTypeDynamic + } *endif *if(strcmp(IntvData(Solution_algorithm),"Modified_Newton-Raphson")==0 && IntvData(Use_initial_stiffness_iterations,int)==0) - if {$AnalOk != 0} { - puts "\nTrying Modified Newton-Raphson with Initial Stiffness \n" - test NormDispIncr $TolDynamic $maxNumIterDynamic *LoggingFlag - algorithm ModifiedNewton -initial - set t [format "%7.5f" [expr [getTime] + $ReducedDtAnalysis]] + if {$AnalOk != 0} { + puts "\nTrying mNR/initial\n" + test NormDispIncr $TolDynamic $maxNumIterDynamic *LoggingFlag + algorithm ModifiedNewton -initial + set t [format "%7.5f" [expr [getTime] + $ReducedDtAnalysis]] *if(PrintTime==1) - puts -nonewline "Time (*IntvNum)$t " + puts -nonewline "(*IntvNum) ModifiedNewton/Ini Time $t " *endif - set AnalOk [analyze 1 $ReducedDtAnalysis] - test $testTypeDynamic $TolDynamic $maxNumIterDynamic *LoggingFlag - algorithm $algorithmTypeDynamic - } + set AnalOk [analyze 1 $ReducedDtAnalysis] + test $testTypeDynamic $TolDynamic $maxNumIterDynamic *LoggingFlag + algorithm $algorithmTypeDynamic + } *endif if {$AnalOk == 0} { set committedSteps [expr $committedSteps+1] @@ -302,35 +310,33 @@ puts "\nInitial time step is divided by 4 ..\n" set continueFlag 0 } } - if {$AnalOk == 0} { - set returnToInitStepFlag 1 - } - } + if {$AnalOk == 0} { + set returnToInitStepFlag 1 + } + }; # end if Nk=4 *if(IntvData(Tolerance_relaxation,int)==1) *if(strcmp(IntvData(Tolerance_relaxation_after_failed_substepping_of),"/4")==0) -if {$AnalOk != 0 } { - if {$InitialTolFlag} { - - set Nk 1; # go back to initial step and there tolerance is updated - set AnalOk 0 - set returnToInitStepFlag 1 - set ChangeToleranceFlag 1 - set returnToInitTolFlag 0 + if {$AnalOk != 0 } { + if {$InitialTolFlag} { + set Nk 1; # back to initial step - tolerance relaxation + set AnalOk 0 + set returnToInitStepFlag 1 + set ChangeToleranceFlag 1 + set returnToInitTolFlag 0 + } + } else { + if {!$InitialTolFlag} { + set Nk 1 + set returnToInitTolFlag 1 + } } -} else { - if {!$InitialTolFlag} { - - set Nk 1 - set returnToInitTolFlag 1 - - } -} *endif *endif + # substepping /8 if {($Nk == 4 && $AnalOk!=0) || ($Nk == 16 && $AnalOk == 0)} { set Nk 8.0 set continueFlag 1 -puts "\nInitial time step is divided by 8 ..\n" + puts "\nInitial step is divided by 8\n" set currTime3 [getTime] set curStep [expr ($currTime3-$currTime2)/$ReducedDtAnalysis] set remStep3 [expr int(($remStep2-$curStep)**2.0)] @@ -341,36 +347,36 @@ puts "\nInitial time step is divided by 8 ..\n" } set t [format "%7.5f" [expr [getTime] + $ReducedDtAnalysis]] *if(PrintTime==1) - puts -nonewline "Time (*IntvNum)$t " + puts -nonewline "(*IntvNum) $algorithmTypeDynamic$strIni Time $t " *endif set AnalOk [analyze 1 $ReducedDtAnalysis] *if((strcmp(IntvData(Solution_algorithm),"Full_Newton-Raphson")==0 && IntvData(Use_initial_stiffness_iterations,int)==0 ) || strcmp(IntvData(Solution_algorithm),"Newton-Raphson_with_line_search")==0 || strcmp(IntvData(Solution_algorithm),"BFGS")==0 || strcmp(IntvData(Solution_algorithm),"Broyden")==0 || strcmp(IntvData(Solution_algorithm),"KrylovNewton")==0) - if {$AnalOk != 0} { - puts "\nTrying Newton-Raphson with Initial Stiffness \n" - test NormDispIncr $TolDynamic $maxNumIterDynamic *LoggingFlag - algorithm Newton -initial - set t [format "%7.5f" [expr [getTime] + $ReducedDtAnalysis]] + if {$AnalOk != 0} { + puts "\nTrying NR/initial\n" + test NormDispIncr $TolDynamic $maxNumIterDynamic *LoggingFlag + algorithm Newton -initial + set t [format "%7.5f" [expr [getTime] + $ReducedDtAnalysis]] *if(PrintTime==1) - puts -nonewline "Time (*IntvNum)$t " + puts -nonewline "(*IntvNum) Newton/Ini Time $t " *endif - set AnalOk [analyze 1 $ReducedDtAnalysis] - test $testTypeDynamic $TolDynamic $maxNumIterDynamic *LoggingFlag - algorithm $algorithmTypeDynamic - } + set AnalOk [analyze 1 $ReducedDtAnalysis] + test $testTypeDynamic $TolDynamic $maxNumIterDynamic *LoggingFlag + algorithm $algorithmTypeDynamic + } *endif *if(strcmp(IntvData(Solution_algorithm),"Modified_Newton-Raphson")==0 && IntvData(Use_initial_stiffness_iterations,int)==0) - if {$AnalOk != 0} { - puts "\nTrying Modified Newton-Raphson with Initial Stiffness \n" - test NormDispIncr $TolDynamic $maxNumIterDynamic *LoggingFlag - algorithm ModifiedNewton -initial - set t [format "%7.5f" [expr [getTime] + $ReducedDtAnalysis]] + if {$AnalOk != 0} { + puts "\nTrying mNR/initial\n" + test NormDispIncr $TolDynamic $maxNumIterDynamic *LoggingFlag + algorithm ModifiedNewton -initial + set t [format "%7.5f" [expr [getTime] + $ReducedDtAnalysis]] *if(PrintTime==1) - puts -nonewline "Time (*IntvNum)$t " + puts -nonewline "(*IntvNum) ModifiedNewton/Ini Time $t " *endif - set AnalOk [analyze 1 $ReducedDtAnalysis] - test $testTypeDynamic $TolDynamic $maxNumIterDynamic *LoggingFlag - algorithm $algorithmTypeDynamic - } + set AnalOk [analyze 1 $ReducedDtAnalysis] + test $testTypeDynamic $TolDynamic $maxNumIterDynamic *LoggingFlag + algorithm $algorithmTypeDynamic + } *endif if {$AnalOk == 0} { set committedSteps [expr $committedSteps+1] @@ -378,35 +384,33 @@ puts "\nInitial time step is divided by 8 ..\n" set continueFlag 0 } } - if {$AnalOk == 0} { - set returnToInitStepFlag 1 - } - } + if {$AnalOk == 0} { + set returnToInitStepFlag 1 + } + }; # end if Nk=8 *if(IntvData(Tolerance_relaxation,int)==1) *if(strcmp(IntvData(Tolerance_relaxation_after_failed_substepping_of),"/8")==0) -if {$AnalOk != 0 } { - if {$InitialTolFlag} { - - set Nk 1; # go back to initial step and there tolerance is updated - set AnalOk 0 - set returnToInitStepFlag 1 - set ChangeToleranceFlag 1 - set returnToInitTolFlag 0 + if {$AnalOk != 0 } { + if {$InitialTolFlag} { + set Nk 1; # back to initial step - tolerance relaxation + set AnalOk 0 + set returnToInitStepFlag 1 + set ChangeToleranceFlag 1 + set returnToInitTolFlag 0 + } + } else { + if {!$InitialTolFlag} { + set Nk 1 + set returnToInitTolFlag 1 + } } -} else { - if {!$InitialTolFlag} { - - set Nk 1 - set returnToInitTolFlag 1 - - } -} *endif *endif + # substepping /16 if {($Nk == 8 && $AnalOk!=0)} { set Nk 16.0 set continueFlag 1 -puts "\nInitial time step is divided by 16 ..\n" + puts "\nInitial step is divided by 16\n" set currTime4 [getTime] set curStep [expr ($currTime4-$currTime3)/$ReducedDtAnalysis] set remStep4 [expr int(($remStep3-$curStep)**2.0)] @@ -417,36 +421,36 @@ puts "\nInitial time step is divided by 16 ..\n" } set t [format "%7.5f" [expr [getTime] + $ReducedDtAnalysis]] *if(PrintTime==1) - puts -nonewline "Time (*IntvNum)$t " + puts -nonewline "(*IntvNum) $algorithmTypeDynamic$strIni Time $t " *endif set AnalOk [analyze 1 $ReducedDtAnalysis] *if((strcmp(IntvData(Solution_algorithm),"Full_Newton-Raphson")==0 && IntvData(Use_initial_stiffness_iterations,int)==0 ) || strcmp(IntvData(Solution_algorithm),"Newton-Raphson_with_line_search")==0 || strcmp(IntvData(Solution_algorithm),"BFGS")==0 || strcmp(IntvData(Solution_algorithm),"Broyden")==0 || strcmp(IntvData(Solution_algorithm),"KrylovNewton")==0) - if {$AnalOk != 0} { - puts "\nTrying Newton-Raphson with Initial Stiffness \n" - test NormDispIncr $TolDynamic $maxNumIterDynamic *LoggingFlag - algorithm Newton -initial - set t [format "%7.5f" [expr [getTime] + $ReducedDtAnalysis]] + if {$AnalOk != 0} { + puts "\nTrying NR/initial\n" + test NormDispIncr $TolDynamic $maxNumIterDynamic *LoggingFlag + algorithm Newton -initial + set t [format "%7.5f" [expr [getTime] + $ReducedDtAnalysis]] *if(PrintTime==1) - puts -nonewline "Time (*IntvNum)$t " + puts -nonewline "(*IntvNum) Newton/Ini Time $t " *endif - set AnalOk [analyze 1 $ReducedDtAnalysis] - test $testTypeDynamic $TolDynamic $maxNumIterDynamic *LoggingFlag - algorithm $algorithmTypeDynamic - } + set AnalOk [analyze 1 $ReducedDtAnalysis] + test $testTypeDynamic $TolDynamic $maxNumIterDynamic *LoggingFlag + algorithm $algorithmTypeDynamic + } *endif *if(strcmp(IntvData(Solution_algorithm),"Modified_Newton-Raphson")==0 && IntvData(Use_initial_stiffness_iterations,int)==0) - if {$AnalOk != 0} { - puts "\nTrying Modified Newton-Raphson with Initial Stiffness \n" - test NormDispIncr $TolDynamic $maxNumIterDynamic *LoggingFlag - algorithm ModifiedNewton -initial - set t [format "%7.5f" [expr [getTime] + $ReducedDtAnalysis]] + if {$AnalOk != 0} { + puts "\nTrying mNR/initial\n" + test NormDispIncr $TolDynamic $maxNumIterDynamic *LoggingFlag + algorithm ModifiedNewton -initial + set t [format "%7.5f" [expr [getTime] + $ReducedDtAnalysis]] *if(PrintTime==1) - puts -nonewline "Time (*IntvNum)$t " + puts -nonewline "(*IntvNum) ModifiedNewton/Ini Time $t " *endif - set AnalOk [analyze 1 $ReducedDtAnalysis] - test $testTypeDynamic $TolDynamic $maxNumIterDynamic *LoggingFlag - algorithm $algorithmTypeDynamic - } + set AnalOk [analyze 1 $ReducedDtAnalysis] + test $testTypeDynamic $TolDynamic $maxNumIterDynamic *LoggingFlag + algorithm $algorithmTypeDynamic + } *endif if {$AnalOk == 0} { set committedSteps [expr $committedSteps+1] @@ -454,43 +458,36 @@ puts "\nInitial time step is divided by 16 ..\n" set continueFlag 0 } } - if {$AnalOk == 0} { - set returnToInitStepFlag 1 - } - } + if {$AnalOk == 0} { + set returnToInitStepFlag 1 + } + }; # end if Nk=16 *if(IntvData(Tolerance_relaxation,int)==1) *if(strcmp(IntvData(Tolerance_relaxation_after_failed_substepping_of),"/16")==0) -if {$AnalOk != 0 } { - if {$InitialTolFlag} { - - set Nk 1; # go back to initial step and there tolerance is updated - set AnalOk 0 - set returnToInitStepFlag 1 - set ChangeToleranceFlag 1 - set returnToInitTolFlag 0 + if {$AnalOk != 0 } { + if {$InitialTolFlag} { + set Nk 1; # back to initial step - tolerance relaxation + set AnalOk 0 + set returnToInitStepFlag 1 + set ChangeToleranceFlag 1 + set returnToInitTolFlag 0 + } + } else { + if {!$InitialTolFlag} { + set Nk 1 + set returnToInitTolFlag 1 + } } -} else { - if {!$InitialTolFlag} { - - set Nk 1 - set returnToInitTolFlag 1 - - } -} *endif *endif -*# if tolerance relaxation is not enough, break the while loop *if(IntvData(Tolerance_relaxation,int)==1) -if {$AnalOk != 0 } { - - if {!$InitialTolFlag} { - - break; - + if {$AnalOk != 0 } { + if {!$InitialTolFlag} { + break + } } -} *endif - set controlTime [getTime] + set controlTime [getTime] } } @@ -498,6 +495,6 @@ if {$AnalOk == 0} { puts "\nAnalysis completed SUCCESSFULLY" puts "Committed steps : $committedSteps\n" } else { - puts "\nAnalysis FAILED\n" + puts "\nAnalysis FAILED" puts "Committed steps : $committedSteps\n" } \ No newline at end of file diff --git a/bas/Analysis/StaticCyclicAnalysis.bas b/bas/Analysis/StaticCyclicAnalysis.bas index 0397272..6e93710 100644 --- a/bas/Analysis/StaticCyclicAnalysis.bas +++ b/bas/Analysis/StaticCyclicAnalysis.bas @@ -1,4 +1,6 @@ + set iDmax [list] +set iNSteps [list] set Nsteps *steps set committedSteps 1 set IDctrlNode *IntvData(Control_node,int) @@ -15,8 +17,19 @@ lappend iDmax *operation(tempratio*(IntvData(Total_displacement,real))) lappend iDmax *operation(tempratio*(IntvData(Total_rotation,real))) *endif lappend iNcycles *IntvData(Displacement_peaks-cycles,*operation(i+1),int) +*format "%g" +*if(IntvData(Adjust_number_of_steps_according_to_displacement_ratio,int)==1) +lappend iNSteps [expr int(*tempratio**$Nsteps)] +*else +lappend iNSteps $Nsteps +*endif *endfor +*if(IntvData(Use_initial_stiffness_iterations,int)==1) +variable strIni /Ini +*else +variable strIni {} +*endif *if(strcmp(IntvData(Convergence_criterion),"Norm_Unbalance")==0) variable testTypeStatic NormUnbalance *elseif(strcmp(IntvData(Convergence_criterion),"Norm_Displacement_Increment")==0) @@ -34,8 +47,8 @@ variable testTypeStatic RelativeEnergyIncr *elseif(strcmp(IntvData(Convergence_criterion),"Fixed_Number_of_Iterations")==0) variable testTypeStatic FixedNumIter *endif -variable TolStatic *IntvData(Tolerance,real); -variable maxNumIterStatic *IntvData(Max_Iterations_per_Step,int); +variable TolStatic *IntvData(Tolerance,real) +variable maxNumIterStatic *IntvData(Max_Iterations_per_Step,int) *if(strcmp(IntvData(Solution_algorithm),"Full_Newton-Raphson")==0) variable algorithmTypeStatic Newton *elseif(strcmp(IntvData(Solution_algorithm),"Modified_Newton-Raphson")==0) @@ -50,129 +63,557 @@ variable algorithmTypeStatic BFGS variable algorithmTypeStatic KrylovNewton *endif -foreach Dmax $iDmax Ncycles $iNcycles { +foreach Dmax $iDmax Ncycles $iNcycles NumSteps $iNSteps { + set DispIncr [expr $Dmax/$NumSteps]; # the displacement increment for each step set Dstepvector "" - set DispIncr [expr $Dmax/$Nsteps] set Disp 0 - if {$Dmax<0} {; # avoid the divide by zero set dx [expr -$DispIncr] } else { set dx $DispIncr } - for {set i 1} {$i <= $Nsteps} {incr i 1} {; # zero to one + for {set i 1} {$i <= $NumSteps} {incr i 1} {; # zero to one set Disp [expr $Disp + $dx] lappend Dstepvector $Disp } - for {set i 1} {$i <= $Nsteps} {incr i 1} {; # one to zero + for {set i 1} {$i <= $NumSteps} {incr i 1} {; # one to zero set Disp [expr $Disp - $dx] lappend Dstepvector $Disp } - for {set i 1} {$i <= $Nsteps} {incr i 1} {; # zero to minus one + for {set i 1} {$i <= $NumSteps} {incr i 1} {; # zero to minus one set Disp [expr $Disp - $dx] lappend Dstepvector $Disp } - for {set i 1} {$i <= $Nsteps} {incr i 1} {; # minus one to zero + for {set i 1} {$i <= $NumSteps} {incr i 1} {; # minus one to zero set Disp [expr $Disp + $dx] lappend Dstepvector $Disp } - for {set i 1} {$i <= $Ncycles} {incr i 1} { + set currentPath 1 set D0 0.0 - foreach Dstep $Dstepvector { - set D1 $Dstep + foreach Dispstep $Dstepvector { + set D1 $Dispstep set Dincr [expr $D1 - $D0] - integrator DisplacementControl $IDctrlNode $IDctrlDOF $Dincr + integrator DisplacementControl $IDctrlNode $IDctrlDOF $Dincr set t [getTime] *if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " + puts -nonewline "(*IntvNum) $algorithmTypeStatic$strIni LF $t " *endif set AnalOk [analyze 1]; # first analyze command - if {$AnalOk != 0} { ; # if fails -*if(IntvData(Use_initial_stiffness_iterations,int)==0) - if {$AnalOk != 0} { - puts "\nTrying Newton-Raphson with Initial Stiffness\n" - test NormDispIncr $TolStatic 1000 *LoggingFlag - algorithm Newton -initial - set t [getTime] -*if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " -*endif - set AnalOk [analyze 1] - test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag - algorithm $algorithmTypeStatic - } - if {$AnalOk !=0} { - puts "\nTrying Modified Newton-Raphson with Initial Stiffness\n" - test NormDispIncr $TolStatic 1000 0 - algorithm ModifiedNewton -initial - set t [getTime] + set D0 $D1; # move to next step + set tempexpr1 [expr abs($D0-$Dmax)] + set tempexpr2 [expr abs($D0+$Dmax)] + set tempexpr3 [expr abs($D0)] + if {($tempexpr1 < 0.0000001) || ($tempexpr2 < 0.0000001) || ($tempexpr3 < 0.0000001)} { + set currentPath [expr $currentPath+1] + } + if {$AnalOk != 0 } { + break + } + } + if {$AnalOk != 0} {; # if analysis fails, alternative algorithms and substepping is applied + set firstFail 1 + set Dstep 0.0 + set AnalOk 0 + set Nk 1 + set returnToInitStepFlag 0 +*if(IntvData(Tolerance_relaxation,int)==1) + set InitialTolFlag 1 + set returnToInitTolFlag 0 + set ChangeToleranceFlag 0 + set SkipFirstLoopForTolRelaxFlag 1 +*endif + set tempexpr [expr abs($Dstep)] + while {($AnalOk == 0 && $currentPath<=3) || ($tempexpr > 0.000001 && $AnalOk == 0 && $currentPath==4)} { + set controlDisp [nodeDisp $IDctrlNode $IDctrlDOF] + set Dstep [expr $controlDisp/$Dmax] + if {($Nk==2 && $AnalOk==0) || ($Nk==1 && $AnalOk==0)} { + set Nk 1 + if {$returnToInitStepFlag} { + puts "\nBack to initial step\n" + set returnToInitStepFlag 0 + } +*if(IntvData(Tolerance_relaxation,int)==1) + if {$returnToInitTolFlag} { + if {!$InitialTolFlag} { + puts "\nBack to initial error tolerance\n" +*format "%g" + set TolStatic [expr $TolStatic/*IntvData(Relaxation_factor,real)] + set InitialTolFlag 1 +*if(strcmp(IntvData(Convergence_criterion),"Norm_Unbalance")==0) +*format "%d" + test NormUnbalance $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Norm_Displacement_Increment")==0) +*format "%d" + test NormDispIncr $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Energy_Increment")==0) +*format "%d" + test EnergyIncr $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Relative_Norm_Unbalance")==0) +*format "%d" + test RelativeNormUnbalance $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Relative_Norm_Displacement_Increment")==0) +*format "%d" + test RelativeNormDispIncr $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Total_Relative_Norm_Displacement_Increment")==0) +*format "%d" + test RelativeTotalNormDispIncr $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Relative_Energy_Increment")==0) +*format "%d" + test RelativeEnergyIncr $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Fixed_Number_of_Iterations")==0) +*format "%d" + test FixedNumIter *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*endif + } + } else { + if {$InitialTolFlag && $ChangeToleranceFlag && !$SkipFirstLoopForTolRelaxFlag} { +*format "%g" + puts "Tolerance is multiplied by *IntvData(Relaxation_factor,real)\n" +*format "%g" + set TolStatic [expr $TolStatic***IntvData(Relaxation_factor,real)] + set InitialTolFlag 0 +*if(strcmp(IntvData(Convergence_criterion),"Norm_Unbalance")==0) +*format "%d" + test NormUnbalance $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Norm_Displacement_Increment")==0) +*format "%d" + test NormDispIncr $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Energy_Increment")==0) +*format "%d" + test EnergyIncr $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Relative_Norm_Unbalance")==0) +*format "%d" + test RelativeNormUnbalance $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Relative_Norm_Displacement_Increment")==0) +*format "%d" + test RelativeNormDispIncr $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Total_Relative_Norm_Displacement_Increment")==0) +*format "%d" + test RelativeTotalNormDispIncr $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Relative_Energy_Increment")==0) +*format "%d" + test RelativeEnergyIncr $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Fixed_Number_of_Iterations")==0) +*format "%d" + test FixedNumIter *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*endif + } + } + set SkipFirstLoopForTolRelaxFlag 0 +*endif + if {$firstFail == 0} {; # for the first time only, do not repeat previous failed step + if {$Dmax > 0} { + if {$currentPath == 1 || $currentPath == 4 } { + integrator DisplacementControl $IDctrlNode $IDctrlDOF $DispIncr; # bring back to original increment + } else { + integrator DisplacementControl $IDctrlNode $IDctrlDOF -$DispIncr + } + } else { + if {$currentPath == 1 || $currentPath == 4 } { + integrator DisplacementControl $IDctrlNode $IDctrlDOF -$DispIncr; # bring back to original increment + } else { + integrator DisplacementControl $IDctrlNode $IDctrlDOF $DispIncr + } + } + set t [getTime] *if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " + puts -nonewline "(*IntvNum) $algorithmTypeStatic$strIni LF $t " *endif - set AnalOk [analyze 1] - test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag - algorithm $algorithmTypeStatic - } -*else - if {$AnalOk != 0} { - puts "\nTrying Newton\n" - test NormDispIncr $TolStatic 1000 *LoggingFlag - algorithm Newton - set t [getTime] + set AnalOk [analyze 1]; # zero for convergence + } else { + set AnalOk 1 + set firstFail 0 + } +*if((strcmp(IntvData(Solution_algorithm),"Full_Newton-Raphson")==0 && IntvData(Use_initial_stiffness_iterations,int)==0 ) || strcmp(IntvData(Solution_algorithm),"Newton-Raphson_with_line_search")==0 || strcmp(IntvData(Solution_algorithm),"BFGS")==0 || strcmp(IntvData(Solution_algorithm),"Broyden")==0 || strcmp(IntvData(Solution_algorithm),"KrylovNewton")==0) + if {$AnalOk != 0} { + puts "\nTrying NR/initial\n" + test NormDispIncr $TolStatic $maxNumIterStatic *LoggingFlag + algorithm Newton -initial + set t [getTime] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) Newton/Ini LF $t " +*endif + set AnalOk [analyze 1] + test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag + algorithm $algorithmTypeStatic + } +*endif +*if(strcmp(IntvData(Solution_algorithm),"Modified_Newton-Raphson")==0 && IntvData(Use_initial_stiffness_iterations,int)==0) + if {$AnalOk != 0} { + puts "\nTrying mNR/initial\n" + test NormDispIncr $TolStatic $maxNumIterStatic *LoggingFlag + algorithm ModifiedNewton -initial + set t [getTime] *if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " + puts -nonewline "(*IntvNum) ModifiedNewton/Ini LF $t " *endif - set AnalOk [analyze 1] - test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag - algorithm $algorithmTypeStatic + set AnalOk [analyze 1] + test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag + algorithm $algorithmTypeStatic + } +*endif + if {$AnalOk == 0} { + set committedSteps [expr $committedSteps+1] + } + }; # end if Nk=1 + # substepping /2 + if {($AnalOk !=0 && $Nk==1) || ($AnalOk==0 && $Nk==4)} { + set Nk 2; # reduce step size + set continueFlag 1 + puts "\nInitial step is divided by 2\n" + set DincrReduced [expr $DispIncr/$Nk] + if {$Dmax > 0} { + if {$currentPath == 1 || $currentPath == 4 } { + integrator DisplacementControl $IDctrlNode $IDctrlDOF $DincrReduced; # bring back to original increment + } else { + integrator DisplacementControl $IDctrlNode $IDctrlDOF -$DincrReduced + } + } else { + if {$currentPath == 1 || $currentPath == 4 } { + integrator DisplacementControl $IDctrlNode $IDctrlDOF -$DincrReduced; # bring back to original increment + } else { + integrator DisplacementControl $IDctrlNode $IDctrlDOF $DincrReduced + } + } + for {set ik 1} {$ik <=$Nk} {incr ik 1} { + if {$continueFlag==0} { + break + } + set t [getTime] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) $algorithmTypeStatic$strIni LF $t " +*endif + set AnalOk [analyze 1]; # zero for convergence +*if((strcmp(IntvData(Solution_algorithm),"Full_Newton-Raphson")==0 && IntvData(Use_initial_stiffness_iterations,int)==0 ) || strcmp(IntvData(Solution_algorithm),"Newton-Raphson_with_line_search")==0 || strcmp(IntvData(Solution_algorithm),"BFGS")==0 || strcmp(IntvData(Solution_algorithm),"Broyden")==0 || strcmp(IntvData(Solution_algorithm),"KrylovNewton")==0) + if {$AnalOk != 0} { + puts "\nTrying NR/initial\n" + test NormDispIncr $TolStatic $maxNumIterStatic *LoggingFlag + algorithm Newton -initial + set t [getTime] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) Newton/Ini LF $t " +*endif + set AnalOk [analyze 1] + test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag + algorithm $algorithmTypeStatic + } +*endif +*if(strcmp(IntvData(Solution_algorithm),"Modified_Newton-Raphson")==0 && IntvData(Use_initial_stiffness_iterations,int)==0) + if {$AnalOk != 0} { + puts "\nTrying mNR/initial\n" + test NormDispIncr $TolStatic $maxNumIterStatic *LoggingFlag + algorithm ModifiedNewton -initial + set t [getTime] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) ModifiedNewton/Ini LF $t " +*endif + set AnalOk [analyze 1] + test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag + algorithm $algorithmTypeStatic + } +*endif + if {$AnalOk == 0} { + set committedSteps [expr $committedSteps+1] + } else { + set continueFlag 0 + } + } + if {$AnalOk == 0} { + set returnToInitStepFlag 1 + } + }; # end if Nk=2 +*if(IntvData(Tolerance_relaxation,int)==1) +*if(strcmp(IntvData(Tolerance_relaxation_after_failed_substepping_of),"/2")==0) + if {$AnalOk != 0 } { + if {$InitialTolFlag} { + set Nk 1; # back to initial step - tolerance relaxation + set AnalOk 0 + set returnToInitStepFlag 1 + set ChangeToleranceFlag 1 + set returnToInitTolFlag 0 + } + } else { + if {!$InitialTolFlag} { + set Nk 1 + set returnToInitTolFlag 1 + } } - if {$AnalOk !=0} { - puts "\nTrying Modified Newton\n" - test NormDispIncr $TolStatic 1000 0 - algorithm ModifiedNewton - set t [getTime] +*endif +*endif + # substepping /4 + if {($AnalOk !=0 && $Nk==2) || ($AnalOk==0 && $Nk==8)} { + set Nk 4; # reduce step size + set continueFlag 1 + puts "\nInitial step is divided by 4\n" + set DincrReduced [expr $DispIncr/$Nk] + if {$Dmax > 0} { + if {$currentPath == 1 || $currentPath == 4 } { + integrator DisplacementControl $IDctrlNode $IDctrlDOF $DincrReduced; # bring back to original increment + } else { + integrator DisplacementControl $IDctrlNode $IDctrlDOF -$DincrReduced + } + } else { + if {$currentPath == 1 || $currentPath == 4 } { + integrator DisplacementControl $IDctrlNode $IDctrlDOF -$DincrReduced; # bring back to original increment + } else { + integrator DisplacementControl $IDctrlNode $IDctrlDOF $DincrReduced + } + } + for {set ik 1} {$ik <=$Nk} {incr ik 1} { + if {$continueFlag==0} { + break + } + set t [getTime] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) $algorithmTypeStatic$strIni LF $t " +*endif + set AnalOk [analyze 1]; # zero for convergence +*if((strcmp(IntvData(Solution_algorithm),"Full_Newton-Raphson")==0 && IntvData(Use_initial_stiffness_iterations,int)==0 ) || strcmp(IntvData(Solution_algorithm),"Newton-Raphson_with_line_search")==0 || strcmp(IntvData(Solution_algorithm),"BFGS")==0 || strcmp(IntvData(Solution_algorithm),"Broyden")==0 || strcmp(IntvData(Solution_algorithm),"KrylovNewton")==0) + if {$AnalOk != 0} { + puts "\nTrying NR/initial\n" + test NormDispIncr $TolStatic $maxNumIterStatic *LoggingFlag + algorithm Newton -initial + set t [getTime] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) Newton/Ini LF $t " +*endif + set AnalOk [analyze 1] + test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag + algorithm $algorithmTypeStatic + } +*endif +*if(strcmp(IntvData(Solution_algorithm),"Modified_Newton-Raphson")==0 && IntvData(Use_initial_stiffness_iterations,int)==0) + if {$AnalOk != 0} { + puts "\nTrying mNR/initial\n" + test NormDispIncr $TolStatic $maxNumIterStatic *LoggingFlag + algorithm ModifiedNewton -initial + set t [getTime] *if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " + puts -nonewline "(*IntvNum) ModifiedNewton/Ini LF $t " +*endif + set AnalOk [analyze 1] + test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag + algorithm $algorithmTypeStatic + } *endif - set AnalOk [analyze 1] - test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag - algorithm $algorithmTypeStatic + if {$AnalOk == 0} { + set committedSteps [expr $committedSteps+1] + } else { + set continueFlag 0 + } + } + if {$AnalOk == 0} { + set returnToInitStepFlag 1 + } + }; # end if Nk=4 +*if(IntvData(Tolerance_relaxation,int)==1) +*if(strcmp(IntvData(Tolerance_relaxation_after_failed_substepping_of),"/4")==0) + if {$AnalOk != 0 } { + if {$InitialTolFlag} { + set Nk 1; # back to initial step - tolerance relaxation + set AnalOk 0 + set returnToInitStepFlag 1 + set ChangeToleranceFlag 1 + set returnToInitTolFlag 0 + } + } else { + if {!$InitialTolFlag} { + set Nk 1 + set returnToInitTolFlag 1 + } } *endif - if {$AnalOk != 0} { - puts "\nTrying Broyden\n" - algorithm Broyden 8 - set t [getTime] +*endif + # substepping /8 + if {$AnalOk !=0 && $Nk==4 || ($Nk == 16 && $AnalOk == 0)} { + set Nk 8; # reduce step size + set continueFlag 1 + puts "\nInitial step is divided by 8\n" + set DincrReduced [expr $DispIncr/$Nk] + if {$Dmax > 0} { + if {$currentPath == 1 || $currentPath == 4 } { + integrator DisplacementControl $IDctrlNode $IDctrlDOF $DincrReduced; # bring back to original increment + } else { + integrator DisplacementControl $IDctrlNode $IDctrlDOF -$DincrReduced + } + } else { + if {$currentPath == 1 || $currentPath == 4 } { + integrator DisplacementControl $IDctrlNode $IDctrlDOF -$DincrReduced; # bring back to original increment + } else { + integrator DisplacementControl $IDctrlNode $IDctrlDOF $DincrReduced + } + } + for {set ik 1} {$ik <=$Nk} {incr ik 1} { + if {$continueFlag==0} { + break + } + set t [getTime] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) $algorithmTypeStatic$strIni LF $t " +*endif + set AnalOk [analyze 1]; # zero for convergence +*if((strcmp(IntvData(Solution_algorithm),"Full_Newton-Raphson")==0 && IntvData(Use_initial_stiffness_iterations,int)==0 ) || strcmp(IntvData(Solution_algorithm),"Newton-Raphson_with_line_search")==0 || strcmp(IntvData(Solution_algorithm),"BFGS")==0 || strcmp(IntvData(Solution_algorithm),"Broyden")==0 || strcmp(IntvData(Solution_algorithm),"KrylovNewton")==0) + if {$AnalOk != 0} { + puts "\nTrying NR/initial\n" + test NormDispIncr $TolStatic $maxNumIterStatic *LoggingFlag + algorithm Newton -initial + set t [getTime] *if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " + puts -nonewline "(*IntvNum) Newton/Ini LF $t " *endif - set AnalOk [analyze 1] - algorithm $algorithmTypeStatic + set AnalOk [analyze 1] + test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag + algorithm $algorithmTypeStatic + } +*endif +*if(strcmp(IntvData(Solution_algorithm),"Modified_Newton-Raphson")==0 && IntvData(Use_initial_stiffness_iterations,int)==0) + if {$AnalOk != 0} { + puts "\nTrying mNR/initial\n" + test NormDispIncr $TolStatic $maxNumIterStatic *LoggingFlag + algorithm ModifiedNewton -initial + set t [getTime] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) ModifiedNewton/Ini LF $t " +*endif + set AnalOk [analyze 1] + test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag + algorithm $algorithmTypeStatic + } +*endif + if {$AnalOk == 0} { + set committedSteps [expr $committedSteps+1] + } else { + set continueFlag 0 + } + } + if {$AnalOk == 0} { + set returnToInitStepFlag 1 + } + }; # end if Nk=8 +*if(IntvData(Tolerance_relaxation,int)==1) +*if(strcmp(IntvData(Tolerance_relaxation_after_failed_substepping_of),"/8")==0) + if {$AnalOk != 0 } { + if {$InitialTolFlag} { + set Nk 1; # back to initial step - tolerance relaxation + set AnalOk 0 + set returnToInitStepFlag 1 + set ChangeToleranceFlag 1 + set returnToInitTolFlag 0 + } + } else { + if {!$InitialTolFlag} { + set Nk 1 + set returnToInitTolFlag 1 + } } - if {$AnalOk != 0} { - puts "\nTrying NewtonWithLineSearch\n" - algorithm NewtonLineSearch 0.8 - set t [getTime] +*endif +*endif + # substepping /16 + if {($Nk == 8 && $AnalOk!=0)} { + set Nk 16; # reduce step size + set continueFlag 1 + puts "\nInitial step is divided by 16\n" + set DincrReduced [expr $DispIncr/$Nk] + if {$Dmax > 0} { + if {$currentPath == 1 || $currentPath == 4 } { + integrator DisplacementControl $IDctrlNode $IDctrlDOF $DincrReduced; # bring back to original increment + } else { + integrator DisplacementControl $IDctrlNode $IDctrlDOF -$DincrReduced + } + } else { + if {$currentPath == 1 || $currentPath == 4 } { + integrator DisplacementControl $IDctrlNode $IDctrlDOF -$DincrReduced; # bring back to original increment + } else { + integrator DisplacementControl $IDctrlNode $IDctrlDOF $DincrReduced + } + } + for {set ik 1} {$ik <=$Nk} {incr ik 1} { + if {$continueFlag==0} { + break + } + set t [getTime] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) $algorithmTypeStatic$strIni LF $t " +*endif + set AnalOk [analyze 1]; # zero for convergence +*if((strcmp(IntvData(Solution_algorithm),"Full_Newton-Raphson")==0 && IntvData(Use_initial_stiffness_iterations,int)==0 ) || strcmp(IntvData(Solution_algorithm),"Newton-Raphson_with_line_search")==0 || strcmp(IntvData(Solution_algorithm),"BFGS")==0 || strcmp(IntvData(Solution_algorithm),"Broyden")==0 || strcmp(IntvData(Solution_algorithm),"KrylovNewton")==0) + if {$AnalOk != 0} { + puts "\nTrying NR/initial\n" + test NormDispIncr $TolStatic $maxNumIterStatic *LoggingFlag + algorithm Newton -initial + set t [getTime] *if(PrintTime==1) - puts -nonewline "LF (*IntvNum)$t " + puts -nonewline "(*IntvNum) Newton/Ini LF $t " *endif - set AnalOk [analyze 1] - algorithm $algorithmTypeStatic + set AnalOk [analyze 1] + test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag + algorithm $algorithmTypeStatic + } +*endif +*if(strcmp(IntvData(Solution_algorithm),"Modified_Newton-Raphson")==0 && IntvData(Use_initial_stiffness_iterations,int)==0) + if {$AnalOk != 0} { + puts "\nTrying mNR/initial\n" + test NormDispIncr $TolStatic $maxNumIterStatic *LoggingFlag + algorithm ModifiedNewton -initial + set t [getTime] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) ModifiedNewton/Ini LF $t " +*endif + set AnalOk [analyze 1] + test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag + algorithm $algorithmTypeStatic + } +*endif + if {$AnalOk == 0} { + set committedSteps [expr $committedSteps+1] + } else { + set continueFlag 0 + } + } + if {$AnalOk == 0} { + set returnToInitStepFlag 1 + } + }; # end if Nk=16 +*if(IntvData(Tolerance_relaxation,int)==1) +*if(strcmp(IntvData(Tolerance_relaxation_after_failed_substepping_of),"/16")==0) + if {$AnalOk != 0 } { + if {$InitialTolFlag} { + set Nk 1; # back to initial step - tolerance relaxation + set AnalOk 0 + set returnToInitStepFlag 1 + set ChangeToleranceFlag 1 + set returnToInitTolFlag 0 + } + } else { + if {!$InitialTolFlag} { + set Nk 1 + set returnToInitTolFlag 1 + } } - if {$AnalOk != 0} { - puts "\nAnalysis FAILED\n" - return -1 - }; # end if - if {$AnalOk == 0} { - set committedSteps [expr $committedSteps+1] +*endif +*endif +*if(IntvData(Tolerance_relaxation,int)==1) + if {$AnalOk != 0 } { + if {!$InitialTolFlag} { + break + } } - }; # end if - if {$AnalOk == 0} { - set committedSteps [expr $committedSteps+1] - } - set D0 $D1; # move to next step - }; # end Dstep +*endif + set controlDisp [nodeDisp $IDctrlNode $IDctrlDOF] + set Dstep [expr $controlDisp/$Dmax] + set tempexpr1 [expr abs($Dstep-1)] + set tempexpr2 [expr abs($Dstep+1)] + set tempexpr3 [expr abs($Dstep)] + if {$tempexpr1 < 0.0000001 || $tempexpr2 < 0.0000001 || $tempexpr3 < 0.0000001} { + set currentPath [expr $currentPath+1] + } + set tempexpr [expr abs($Dstep)] + }; # end while loop + }; # end if $AnalOk !=0 + if {$AnalOk != 0 } { + break + } }; # end i }; # end of iDmax @@ -180,5 +621,6 @@ if {$AnalOk == 0} { puts "\nAnalysis completed SUCCESSFULLY" puts "Committed steps : $committedSteps\n" } else { - puts "\nAnalysis FAILED\n" + puts "\nAnalysis FAILED" + puts "Committed steps : $committedSteps\n" } \ No newline at end of file diff --git a/bas/Analysis/StaticDisplacementControl.bas b/bas/Analysis/StaticDisplacementControl.bas new file mode 100644 index 0000000..b8d5df5 --- /dev/null +++ b/bas/Analysis/StaticDisplacementControl.bas @@ -0,0 +1,508 @@ + +*format "%g" +*if(strcmp(IntvData(Control_node_direction),"UX")==0 || strcmp(IntvData(Control_node_direction),"UY")==0 || strcmp(IntvData(Control_node_direction),"UZ")==0) +set Dmax *IntvData(Total_displacement,real) +*# Rotation control direction +*else +set Dmax *IntvData(Total_rotation,real) +*endif +*format "%f" +set Dincr *DispIncr +*format "%d" +set Nsteps *steps +set committedSteps 1 +set IDctrlNode *IntvData(Control_node,int) +set IDctrlDOF *NodeCtrlDOF + +*if(IntvData(Use_initial_stiffness_iterations,int)==1) +variable strIni /Ini +*else +variable strIni {} +*endif +*if(strcmp(IntvData(Convergence_criterion),"Norm_Unbalance")==0) +variable testTypeStatic NormUnbalance +*elseif(strcmp(IntvData(Convergence_criterion),"Norm_Displacement_Increment")==0) +variable testTypeStatic NormDispIncr +*elseif(strcmp(IntvData(Convergence_criterion),"Energy_Increment")==0) +variable testTypeStatic EnergyIncr +*elseif(strcmp(IntvData(Convergence_criterion),"Relative_Norm_Unbalance")==0) +variable testTypeStatic RelativeNormUnbalance +*elseif(strcmp(IntvData(Convergence_criterion),"Relative_Norm_Displacement_Increment")==0) +variable testTypeStatic RelativeNormDispIncr +*elseif(strcmp(IntvData(Convergence_criterion),"Total_Relative_Norm_Displacement_Increment")==0) +variable testTypeStatic RelativeTotalNormDispIncr +*elseif(strcmp(IntvData(Convergence_criterion),"Relative_Energy_Increment")==0) +variable testTypeStatic RelativeEnergyIncr +*elseif(strcmp(IntvData(Convergence_criterion),"Fixed_Number_of_Iterations")==0) +variable testTypeStatic FixedNumIter +*endif +*format "%g" +variable TolStatic *IntvData(Tolerance,real) +variable maxNumIterStatic *IntvData(Max_Iterations_per_Step,int) +*if(strcmp(IntvData(Solution_algorithm),"Full_Newton-Raphson")==0) +variable algorithmTypeStatic Newton +*elseif(strcmp(IntvData(Solution_algorithm),"Modified_Newton-Raphson")==0) +variable algorithmTypeStatic ModifiedNewton +*elseif(strcmp(IntvData(Solution_algorithm),"Newton-Raphson_with_line_search")==0) +variable algorithmTypeStatic NewtonLineSearch +*elseif(strcmp(IntvData(Solution_algorithm),"Broyden")==0) +variable algorithmTypeStatic Broyden +*elseif(strcmp(IntvData(Solution_algorithm),"BFGS")==0) +variable algorithmTypeStatic BFGS +*elseif(strcmp(IntvData(Solution_algorithm),"KrylovNewton")==0) +variable algorithmTypeStatic KrylovNewton +*endif + +for {set i 1} { $i <= $Nsteps } {incr i 1} { + set t [getTime] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) $algorithmTypeStatic$strIni LF $t " +*endif + set AnalOk [analyze 1] + if {$AnalOk !=0} { + break + } else { + set committedSteps [expr $committedSteps+1] + } +} + +if {$AnalOk != 0} {; # if analysis fails, alternative algorithms and substepping is applied + set firstFail 1 + set Dstep 0.0 + set AnalOk 0 + set Nk 1 + set returnToInitStepFlag 0 +*if(IntvData(Tolerance_relaxation,int)==1) + set InitialTolFlag 1 + set returnToInitTolFlag 0 + set ChangeToleranceFlag 0 + set SkipFirstLoopForTolRelaxFlag 1 +*endif + while {$Dstep <= 1.0 && $AnalOk == 0} { + set controlDisp [nodeDisp $IDctrlNode $IDctrlDOF] + set Dstep [expr $controlDisp/$Dmax] + if {($Nk==2 && $AnalOk==0) || ($Nk==1 && $AnalOk==0)} { + set Nk 1 + if {$returnToInitStepFlag} { + puts "\nBack to initial step\n" + set returnToInitStepFlag 0 + } +*if(IntvData(Tolerance_relaxation,int)==1) + if {$returnToInitTolFlag} { + if {!$InitialTolFlag} { + puts "\nBack to initial error tolerance\n" +*format "%g" + set TolStatic [expr $TolStatic/*IntvData(Relaxation_factor,real)] + set InitialTolFlag 1 +*if(strcmp(IntvData(Convergence_criterion),"Norm_Unbalance")==0) +*format "%d" + test NormUnbalance $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Norm_Displacement_Increment")==0) +*format "%d" + test NormDispIncr $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Energy_Increment")==0) +*format "%d" + test EnergyIncr $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Relative_Norm_Unbalance")==0) +*format "%d" + test RelativeNormUnbalance $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Relative_Norm_Displacement_Increment")==0) +*format "%d" + test RelativeNormDispIncr $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Total_Relative_Norm_Displacement_Increment")==0) +*format "%d" + test RelativeTotalNormDispIncr $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Relative_Energy_Increment")==0) +*format "%d" + test RelativeEnergyIncr $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Fixed_Number_of_Iterations")==0) +*format "%d" + test FixedNumIter *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*endif + } + } else { + if {$InitialTolFlag && $ChangeToleranceFlag && !$SkipFirstLoopForTolRelaxFlag} { +*format "%g" + puts "Tolerance is multiplied by *IntvData(Relaxation_factor,real)\n" +*format "%g" + set TolStatic [expr $TolStatic***IntvData(Relaxation_factor,real)] + set InitialTolFlag 0 +*if(strcmp(IntvData(Convergence_criterion),"Norm_Unbalance")==0) +*format "%d" + test NormUnbalance $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Norm_Displacement_Increment")==0) +*format "%d" + test NormDispIncr $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Energy_Increment")==0) +*format "%d" + test EnergyIncr $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Relative_Norm_Unbalance")==0) +*format "%d" + test RelativeNormUnbalance $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Relative_Norm_Displacement_Increment")==0) +*format "%d" + test RelativeNormDispIncr $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Total_Relative_Norm_Displacement_Increment")==0) +*format "%d" + test RelativeTotalNormDispIncr $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Relative_Energy_Increment")==0) +*format "%d" + test RelativeEnergyIncr $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Fixed_Number_of_Iterations")==0) +*format "%d" + test FixedNumIter *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*endif + } + } + set SkipFirstLoopForTolRelaxFlag 0 +*endif + if {$firstFail == 0} { # for the first time only, do not repeat previous failed step + integrator DisplacementControl $IDctrlNode $IDctrlDOF $Dincr; # reset to original increment + set t [getTime] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) $algorithmTypeStatic$strIni LF $t " +*endif + set AnalOk [analyze 1]; # zero for convergence + } else { + set AnalOk 1 + set firstFail 0 + } +*if((strcmp(IntvData(Solution_algorithm),"Full_Newton-Raphson")==0 && IntvData(Use_initial_stiffness_iterations,int)==0 ) || strcmp(IntvData(Solution_algorithm),"Newton-Raphson_with_line_search")==0 || strcmp(IntvData(Solution_algorithm),"BFGS")==0 || strcmp(IntvData(Solution_algorithm),"Broyden")==0 || strcmp(IntvData(Solution_algorithm),"KrylovNewton")==0) + if {$AnalOk != 0} { + puts "\nTrying NR/initial\n" + test NormDispIncr $TolStatic $maxNumIterStatic *LoggingFlag + algorithm Newton -initial + set t [getTime] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) Newton/Ini LF $t " +*endif + set AnalOk [analyze 1] + test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag + algorithm $algorithmTypeStatic + } +*endif +*if(strcmp(IntvData(Solution_algorithm),"Modified_Newton-Raphson")==0 && IntvData(Use_initial_stiffness_iterations,int)==0) + if {$AnalOk != 0} { + puts "\nTrying mNR/initial\n" + test NormDispIncr $TolStatic $maxNumIterStatic *LoggingFlag + algorithm ModifiedNewton -initial + set t [getTime] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) ModifiedNewton/Ini LF $t " +*endif + set AnalOk [analyze 1] + test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag + algorithm $algorithmTypeStatic + } +*endif + if {$AnalOk == 0} { + set committedSteps [expr $committedSteps+1] + } + }; # end if Nk=1 + # substepping /2 + if {($AnalOk !=0 && $Nk==1) || ($AnalOk==0 && $Nk==4)} { + set Nk 2; # reduce step size + set continueFlag 1 + puts "\nInitial step is divided by 2\n" + set DincrReduced [expr $Dincr/$Nk] + integrator DisplacementControl $IDctrlNode $IDctrlDOF $DincrReduced + for {set ik 1} {$ik <=$Nk} {incr ik 1} { + if {$continueFlag==0} { + break + } + set t [getTime] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) $algorithmTypeStatic$strIni LF $t " +*endif + set AnalOk [analyze 1]; # zero for convergence +*if((strcmp(IntvData(Solution_algorithm),"Full_Newton-Raphson")==0 && IntvData(Use_initial_stiffness_iterations,int)==0 ) || strcmp(IntvData(Solution_algorithm),"Newton-Raphson_with_line_search")==0 || strcmp(IntvData(Solution_algorithm),"BFGS")==0 || strcmp(IntvData(Solution_algorithm),"Broyden")==0 || strcmp(IntvData(Solution_algorithm),"KrylovNewton")==0) + if {$AnalOk != 0} { + puts "\nTrying NR/initial\n" + test NormDispIncr $TolStatic $maxNumIterStatic *LoggingFlag + algorithm Newton -initial + set t [getTime] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) Newton/Ini LF $t " +*endif + set AnalOk [analyze 1] + test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag + algorithm $algorithmTypeStatic + } +*endif +*if(strcmp(IntvData(Solution_algorithm),"Modified_Newton-Raphson")==0 && IntvData(Use_initial_stiffness_iterations,int)==0) + if {$AnalOk != 0} { + puts "\nTrying mNR/initial\n" + test NormDispIncr $TolStatic $maxNumIterStatic *LoggingFlag + algorithm ModifiedNewton -initial + set t [getTime] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) ModifiedNewton/Ini LF $t " +*endif + set AnalOk [analyze 1] + test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag + algorithm $algorithmTypeStatic + } +*endif + if {$AnalOk == 0} { + set committedSteps [expr $committedSteps+1] + } else { + set continueFlag 0 + } + } + if {$AnalOk == 0} { + set returnToInitStepFlag 1 + } + }; # end if Nk=2 +*if(IntvData(Tolerance_relaxation,int)==1) +*if(strcmp(IntvData(Tolerance_relaxation_after_failed_substepping_of),"/2")==0) + if {$AnalOk != 0 } { + if {$InitialTolFlag} { + set Nk 1; # back to initial step - tolerance relaxation + set AnalOk 0 + set returnToInitStepFlag 1 + set ChangeToleranceFlag 1 + set returnToInitTolFlag 0 + } + } else { + if {!$InitialTolFlag} { + set Nk 1 + set returnToInitTolFlag 1 + } + } +*endif +*endif + # substepping /4 + if {($AnalOk !=0 && $Nk==2) || ($AnalOk==0 && $Nk==8)} { + set Nk 4; # reduce step size + set continueFlag 1 + puts "\nInitial step is divided by 4\n" + set DincrReduced [expr $Dincr/$Nk] + integrator DisplacementControl $IDctrlNode $IDctrlDOF $DincrReduced + for {set ik 1} {$ik <=$Nk} {incr ik 1} { + if {$continueFlag==0} { + break + } + set t [getTime] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) $algorithmTypeStatic$strIni LF $t " +*endif + set AnalOk [analyze 1]; # zero for convergence +*if((strcmp(IntvData(Solution_algorithm),"Full_Newton-Raphson")==0 && IntvData(Use_initial_stiffness_iterations,int)==0 ) || strcmp(IntvData(Solution_algorithm),"Newton-Raphson_with_line_search")==0 || strcmp(IntvData(Solution_algorithm),"BFGS")==0 || strcmp(IntvData(Solution_algorithm),"Broyden")==0 || strcmp(IntvData(Solution_algorithm),"KrylovNewton")==0) + if {$AnalOk != 0} { + puts "\nTrying NR/initial\n" + test NormDispIncr $TolStatic $maxNumIterStatic *LoggingFlag + algorithm Newton -initial + set t [getTime] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) Newton/Ini LF $t " +*endif + set AnalOk [analyze 1] + test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag + algorithm $algorithmTypeStatic + } +*endif +*if(strcmp(IntvData(Solution_algorithm),"Modified_Newton-Raphson")==0 && IntvData(Use_initial_stiffness_iterations,int)==0) + if {$AnalOk != 0} { + puts "\nTrying mNR/initial\n" + test NormDispIncr $TolStatic $maxNumIterStatic *LoggingFlag + algorithm ModifiedNewton -initial + set t [getTime] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) ModifiedNewton/Ini LF $t " +*endif + set AnalOk [analyze 1] + test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag + algorithm $algorithmTypeStatic + } +*endif + if {$AnalOk == 0} { + set committedSteps [expr $committedSteps+1] + } else { + set continueFlag 0 + } + } + if {$AnalOk == 0} { + set returnToInitStepFlag 1 + } + }; # end if Nk=4 +*if(IntvData(Tolerance_relaxation,int)==1) +*if(strcmp(IntvData(Tolerance_relaxation_after_failed_substepping_of),"/4")==0) + if {$AnalOk != 0 } { + if {$InitialTolFlag} { + set Nk 1; # back to initial step - tolerance relaxation + set AnalOk 0 + set returnToInitStepFlag 1 + set ChangeToleranceFlag 1 + set returnToInitTolFlag 0 + } + } else { + if {!$InitialTolFlag} { + set Nk 1 + set returnToInitTolFlag 1 + } + } +*endif +*endif + # substepping /8 + if {$AnalOk !=0 && $Nk==4 || ($Nk == 16 && $AnalOk == 0)} { + set Nk 8; # reduce step size + set continueFlag 1 + puts "\nInitial step is divided by 8\n" + set DincrReduced [expr $Dincr/$Nk] + integrator DisplacementControl $IDctrlNode $IDctrlDOF $DincrReduced + for {set ik 1} {$ik <=$Nk} {incr ik 1} { + if {$continueFlag==0} { + break + } + set t [getTime] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) $algorithmTypeStatic$strIni LF $t " +*endif + set AnalOk [analyze 1]; # zero for convergence +*if((strcmp(IntvData(Solution_algorithm),"Full_Newton-Raphson")==0 && IntvData(Use_initial_stiffness_iterations,int)==0 ) || strcmp(IntvData(Solution_algorithm),"Newton-Raphson_with_line_search")==0 || strcmp(IntvData(Solution_algorithm),"BFGS")==0 || strcmp(IntvData(Solution_algorithm),"Broyden")==0 || strcmp(IntvData(Solution_algorithm),"KrylovNewton")==0) + if {$AnalOk != 0} { + puts "\nTrying NR/initial\n" + test NormDispIncr $TolStatic $maxNumIterStatic *LoggingFlag + algorithm Newton -initial + set t [getTime] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) Newton/Ini LF $t " +*endif + set AnalOk [analyze 1] + test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag + algorithm $algorithmTypeStatic + } +*endif +*if(strcmp(IntvData(Solution_algorithm),"Modified_Newton-Raphson")==0 && IntvData(Use_initial_stiffness_iterations,int)==0) + if {$AnalOk != 0} { + puts "\nTrying mNR/initial\n" + test NormDispIncr $TolStatic $maxNumIterStatic *LoggingFlag + algorithm ModifiedNewton -initial + set t [getTime] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) ModifiedNewton/Ini LF $t " +*endif + set AnalOk [analyze 1] + test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag + algorithm $algorithmTypeStatic + } +*endif + if {$AnalOk == 0} { + set committedSteps [expr $committedSteps+1] + } else { + set continueFlag 0 + } + } + if {$AnalOk == 0} { + set returnToInitStepFlag 1 + } + }; # end if Nk=8 +*if(IntvData(Tolerance_relaxation,int)==1) +*if(strcmp(IntvData(Tolerance_relaxation_after_failed_substepping_of),"/8")==0) + if {$AnalOk != 0 } { + if {$InitialTolFlag} { + set Nk 1; # back to initial step - tolerance relaxation + set AnalOk 0 + set returnToInitStepFlag 1 + set ChangeToleranceFlag 1 + set returnToInitTolFlag 0 + } + } else { + if {!$InitialTolFlag} { + set Nk 1 + set returnToInitTolFlag 1 + } + }; # end if Nk=8 +*endif +*endif + # substepping /16 + if {($Nk == 8 && $AnalOk!=0)} { + set Nk 16; # reduce step size + set continueFlag 1 + puts "\nInitial step is divided by 16\n" + set DincrReduced [expr $Dincr/$Nk] + integrator DisplacementControl $IDctrlNode $IDctrlDOF $DincrReduced + for {set ik 1} {$ik <=$Nk} {incr ik 1} { + if {$continueFlag==0} { + break + } + set t [getTime] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) $algorithmTypeStatic$strIni LF $t " +*endif + set AnalOk [analyze 1]; # zero for convergence +*if((strcmp(IntvData(Solution_algorithm),"Full_Newton-Raphson")==0 && IntvData(Use_initial_stiffness_iterations,int)==0 ) || strcmp(IntvData(Solution_algorithm),"Newton-Raphson_with_line_search")==0 || strcmp(IntvData(Solution_algorithm),"BFGS")==0 || strcmp(IntvData(Solution_algorithm),"Broyden")==0 || strcmp(IntvData(Solution_algorithm),"KrylovNewton")==0) + if {$AnalOk != 0} { + puts "\nTrying NR/initial\n" + test NormDispIncr $TolStatic $maxNumIterStatic *LoggingFlag + algorithm Newton -initial + set t [getTime] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) Newton/Ini LF $t " +*endif + set AnalOk [analyze 1] + test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag + algorithm $algorithmTypeStatic + } +*endif +*if(strcmp(IntvData(Solution_algorithm),"Modified_Newton-Raphson")==0 && IntvData(Use_initial_stiffness_iterations,int)==0) + if {$AnalOk != 0} { + puts "\nTrying mNR/initial\n" + test NormDispIncr $TolStatic $maxNumIterStatic *LoggingFlag + algorithm ModifiedNewton -initial + set t [getTime] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) ModifiedNewton/Ini LF $t " +*endif + set AnalOk [analyze 1] + test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag + algorithm $algorithmTypeStatic + } +*endif + if {$AnalOk == 0} { + set committedSteps [expr $committedSteps+1] + } else { + set continueFlag 0 + } + } + if {$AnalOk == 0} { + set returnToInitStepFlag 1 + } + }; # end if Nk=16 +*if(IntvData(Tolerance_relaxation,int)==1) +*if(strcmp(IntvData(Tolerance_relaxation_after_failed_substepping_of),"/16")==0) + if {$AnalOk != 0 } { + if {$InitialTolFlag} { + set Nk 1; # back to initial step - tolerance relaxation + set AnalOk 0 + set returnToInitStepFlag 1 + set ChangeToleranceFlag 1 + set returnToInitTolFlag 0 + } + } else { + if {!$InitialTolFlag} { + set Nk 1 + set returnToInitTolFlag 1 + } + } +*endif +*endif +*if(IntvData(Tolerance_relaxation,int)==1) + if {$AnalOk != 0 } { + if {! $InitialTolFlag} { + break + } + } +*endif + set controlDisp [nodeDisp $IDctrlNode $IDctrlDOF] + set Dstep [expr $controlDisp/$Dmax] + }; # end while loop +}; # end if AnalOk + +if {$AnalOk == 0} { + puts "\nAnalysis completed SUCCESSFULLY" + puts "Committed steps : $committedSteps\n" +} else { + puts "\nAnalysis FAILED" + puts "Committed steps : $committedSteps\n" +} \ No newline at end of file diff --git a/bas/Analysis/StaticLoadControl.bas b/bas/Analysis/StaticLoadControl.bas new file mode 100644 index 0000000..7ac8662 --- /dev/null +++ b/bas/Analysis/StaticLoadControl.bas @@ -0,0 +1,494 @@ + +*format "%f" +set Lincr *LoadIncr +*format "%d" +set Nsteps *steps +set committedSteps 1 +set LoadCounter 0 + +*if(IntvData(Use_initial_stiffness_iterations,int)==1) +variable strIni /Ini +*else +variable strIni {} +*endif +*if(strcmp(IntvData(Convergence_criterion),"Norm_Unbalance")==0) +variable testTypeStatic NormUnbalance +*elseif(strcmp(IntvData(Convergence_criterion),"Norm_Displacement_Increment")==0) +variable testTypeStatic NormDispIncr +*elseif(strcmp(IntvData(Convergence_criterion),"Energy_Increment")==0) +variable testTypeStatic EnergyIncr +*elseif(strcmp(IntvData(Convergence_criterion),"Relative_Norm_Unbalance")==0) +variable testTypeStatic RelativeNormUnbalance +*elseif(strcmp(IntvData(Convergence_criterion),"Relative_Norm_Displacement_Increment")==0) +variable testTypeStatic RelativeNormDispIncr +*elseif(strcmp(IntvData(Convergence_criterion),"Total_Relative_Norm_Displacement_Increment")==0) +variable testTypeStatic RelativeTotalNormDispIncr +*elseif(strcmp(IntvData(Convergence_criterion),"Relative_Energy_Increment")==0) +variable testTypeStatic RelativeEnergyIncr +*elseif(strcmp(IntvData(Convergence_criterion),"Fixed_Number_of_Iterations")==0) +variable testTypeStatic FixedNumIter +*endif +*format "%g" +variable TolStatic *IntvData(Tolerance,real) +variable maxNumIterStatic *IntvData(Max_Iterations_per_Step,int) +*if(strcmp(IntvData(Solution_algorithm),"Full_Newton-Raphson")==0) +variable algorithmTypeStatic Newton +*elseif(strcmp(IntvData(Solution_algorithm),"Modified_Newton-Raphson")==0) +variable algorithmTypeStatic ModifiedNewton +*elseif(strcmp(IntvData(Solution_algorithm),"Newton-Raphson_with_line_search")==0) +variable algorithmTypeStatic NewtonLineSearch +*elseif(strcmp(IntvData(Solution_algorithm),"Broyden")==0) +variable algorithmTypeStatic Broyden +*elseif(strcmp(IntvData(Solution_algorithm),"BFGS")==0) +variable algorithmTypeStatic BFGS +*elseif(strcmp(IntvData(Solution_algorithm),"KrylovNewton")==0) +variable algorithmTypeStatic KrylovNewton +*endif + +for {set i 1} { $i <= $Nsteps } {incr i 1} { + set t [format "%7.5f" [expr [getTime] + $Lincr]] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) $algorithmTypeStatic$strIni LF $t " +*endif + set AnalOk [analyze 1] + if {$AnalOk !=0} { + break + } else { + set LoadCounter [expr $LoadCounter+1.0] + set committedSteps [expr $committedSteps+1] + } +} + +if {$AnalOk != 0} {; # if analysis fails, alternative algorithms and substepping is applied + set firstFail 1 + set AnalOk 0 + set Nk 1 + set returnToInitStepFlag 0 +*if(IntvData(Tolerance_relaxation,int)==1) + set InitialTolFlag 1 + set returnToInitTolFlag 0 + set ChangeToleranceFlag 0 + set SkipFirstLoopForTolRelaxFlag 1 +*endif + while {$LoadCounter < $Nsteps && $AnalOk == 0} { + if {($Nk==2 && $AnalOk==0) || ($Nk==1 && $AnalOk==0)} { + set Nk 1 + if {$returnToInitStepFlag} { + puts "\nBack to initial step\n" + set returnToInitStepFlag 0 + } +*if(IntvData(Tolerance_relaxation,int)==1) + if {$returnToInitTolFlag} { + if {!$InitialTolFlag} { + puts "\nBack to initial error tolerance\n" +*format "%g" + set TolStatic [expr $TolStatic/*IntvData(Relaxation_factor,real)] + set InitialTolFlag 1 +*if(strcmp(IntvData(Convergence_criterion),"Norm_Unbalance")==0) +*format "%d" + test NormUnbalance $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Norm_Displacement_Increment")==0) +*format "%d" + test NormDispIncr $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Energy_Increment")==0) +*format "%d" + test EnergyIncr $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Relative_Norm_Unbalance")==0) +*format "%d" + test RelativeNormUnbalance $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Relative_Norm_Displacement_Increment")==0) +*format "%d" + test RelativeNormDispIncr $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Total_Relative_Norm_Displacement_Increment")==0) +*format "%d" + test RelativeTotalNormDispIncr $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Relative_Energy_Increment")==0) +*format "%d" + test RelativeEnergyIncr $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Fixed_Number_of_Iterations")==0) +*format "%d" + test FixedNumIter *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*endif + } + } else { + if {$InitialTolFlag && $ChangeToleranceFlag && !$SkipFirstLoopForTolRelaxFlag} { +*format "%g" + puts "Tolerance is multiplied by *IntvData(Relaxation_factor,real)\n" +*format "%g" + set TolStatic [expr $TolStatic***IntvData(Relaxation_factor,real)] + set InitialTolFlag 0 +*if(strcmp(IntvData(Convergence_criterion),"Norm_Unbalance")==0) +*format "%d" + test NormUnbalance $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Norm_Displacement_Increment")==0) +*format "%d" + test NormDispIncr $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Energy_Increment")==0) +*format "%d" + test EnergyIncr $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Relative_Norm_Unbalance")==0) +*format "%d" + test RelativeNormUnbalance $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Relative_Norm_Displacement_Increment")==0) +*format "%d" + test RelativeNormDispIncr $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Total_Relative_Norm_Displacement_Increment")==0) +*format "%d" + test RelativeTotalNormDispIncr $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Relative_Energy_Increment")==0) +*format "%d" + test RelativeEnergyIncr $TolStatic *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*elseif(strcmp(IntvData(Convergence_criterion),"Fixed_Number_of_Iterations")==0) +*format "%d" + test FixedNumIter *IntvData(Max_Iterations_per_Step,int) *LoggingFlag +*endif + } + } + set SkipFirstLoopForTolRelaxFlag 0 +*endif + if {$firstFail == 0} { # for the first time only, do not repeat previous failed step + integrator LoadControl $Lincr; # reset to original increment + set t [format "%7.5f" [expr [getTime] + $Lincr]] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) $algorithmTypeStatic$strIni LF $t " +*endif + set AnalOk [analyze 1]; # zero for convergence + } else { + set AnalOk 1 + set firstFail 0 + } +*if((strcmp(IntvData(Solution_algorithm),"Full_Newton-Raphson")==0 && IntvData(Use_initial_stiffness_iterations,int)==0 ) || strcmp(IntvData(Solution_algorithm),"Newton-Raphson_with_line_search")==0 || strcmp(IntvData(Solution_algorithm),"BFGS")==0 || strcmp(IntvData(Solution_algorithm),"Broyden")==0 || strcmp(IntvData(Solution_algorithm),"KrylovNewton")==0) + if {$AnalOk != 0} { + puts "\nTrying NR/initial\n" + test NormDispIncr $TolStatic $maxNumIterStatic *LoggingFlag + algorithm Newton -initial + set t [format "%7.5f" [expr [getTime] + $Lincr]] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) Newton/Ini LF $t " +*endif + set AnalOk [analyze 1] + test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag + algorithm $algorithmTypeStatic + } +*endif +*if(strcmp(IntvData(Solution_algorithm),"Modified_Newton-Raphson")==0 && IntvData(Use_initial_stiffness_iterations,int)==0) + if {$AnalOk != 0} { + puts "\nTrying mNR/initial\n" + test NormDispIncr $TolStatic $maxNumIterStatic *LoggingFlag + algorithm ModifiedNewton -initial + set t set t [format "%7.5f" [expr [getTime] + $Lincr]] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) ModifiedNewton/Ini LF $t " +*endif + set AnalOk [analyze 1] + test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag + algorithm $algorithmTypeStatic + } +*endif + if {$AnalOk == 0} { + set LoadCounter [expr $LoadCounter+1.0/$Nk] + set committedSteps [expr $committedSteps+1] + } + }; # end if Nk=1 + # substepping /2 + if {($AnalOk !=0 && $Nk==1) || ($AnalOk==0 && $Nk==4)} { + set Nk 2; # reduce step size + set continueFlag 1 + puts "\nInitial step is divided by 2\n" + set LincrReduced [expr $Lincr/$Nk] + integrator LoadControl $LincrReduced + for {set ik 1} {$ik <=$Nk} {incr ik 1} { + if {$continueFlag==0} { + break + } + set t [format "%7.5f" [expr [getTime] + $LincrReduced]] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) $algorithmTypeStatic$strIni LF $t " +*endif + set AnalOk [analyze 1]; # zero for convergence +*if((strcmp(IntvData(Solution_algorithm),"Full_Newton-Raphson")==0 && IntvData(Use_initial_stiffness_iterations,int)==0 ) || strcmp(IntvData(Solution_algorithm),"Newton-Raphson_with_line_search")==0 || strcmp(IntvData(Solution_algorithm),"BFGS")==0 || strcmp(IntvData(Solution_algorithm),"Broyden")==0 || strcmp(IntvData(Solution_algorithm),"KrylovNewton")==0) + if {$AnalOk != 0} { + puts "\nTrying NR/initial\n" + test NormDispIncr $TolStatic $maxNumIterStatic *LoggingFlag + algorithm Newton -initial + set t [format "%7.5f" [expr [getTime] + $LincrReduced]] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) Newton/Ini LF $t " +*endif + set AnalOk [analyze 1] + test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag + algorithm $algorithmTypeStatic + } +*endif +*if(strcmp(IntvData(Solution_algorithm),"Modified_Newton-Raphson")==0 && IntvData(Use_initial_stiffness_iterations,int)==0) + if {$AnalOk != 0} { + puts "\nTrying mNR/initial\n" + test NormDispIncr $TolStatic $maxNumIterStatic *LoggingFlag + algorithm ModifiedNewton -initial + set t [format "%7.5f" [expr [getTime] + $LincrReduced]] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) ModifiedNewton/Ini LF $t " +*endif + set AnalOk [analyze 1] + test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag + algorithm $algorithmTypeStatic + } +*endif + if {$AnalOk == 0} { + set LoadCounter [expr $LoadCounter+1.0/$Nk] + set committedSteps [expr $committedSteps+1] + } else { + set continueFlag 0 + } + } + if {$AnalOk == 0} { + set returnToInitStepFlag 1 + } + }; # end if Nk=2 +*if(IntvData(Tolerance_relaxation,int)==1) +*if(strcmp(IntvData(Tolerance_relaxation_after_failed_substepping_of),"/2")==0) + if {$AnalOk != 0 } { + if {$InitialTolFlag} { + set Nk 1; # back to initial step - tolerance relaxation + set AnalOk 0 + set returnToInitStepFlag 1 + set ChangeToleranceFlag 1 + set returnToInitTolFlag 0 + } + } else { + if {!$InitialTolFlag} { + set Nk 1 + set returnToInitTolFlag 1 + } + } +*endif +*endif + # substepping /4 + if {($AnalOk !=0 && $Nk==2) || ($AnalOk==0 && $Nk==8)} { + set Nk 4; # reduce step size + set continueFlag 1 + puts "\nInitial step is divided by 4\n" + set LincrReduced [expr $Lincr/$Nk] + integrator LoadControl $LincrReduced + for {set ik 1} {$ik <=$Nk} {incr ik 1} { + if {$continueFlag==0} { + break + } + set t [format "%7.5f" [expr [getTime] + $LincrReduced]] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) $algorithmTypeStatic$strIni LF $t " +*endif + set AnalOk [analyze 1]; # zero for convergence +*if((strcmp(IntvData(Solution_algorithm),"Full_Newton-Raphson")==0 && IntvData(Use_initial_stiffness_iterations,int)==0 ) || strcmp(IntvData(Solution_algorithm),"Newton-Raphson_with_line_search")==0 || strcmp(IntvData(Solution_algorithm),"BFGS")==0 || strcmp(IntvData(Solution_algorithm),"Broyden")==0 || strcmp(IntvData(Solution_algorithm),"KrylovNewton")==0) + if {$AnalOk != 0} { + puts "\nTrying NR/initial\n" + test NormDispIncr $TolStatic $maxNumIterStatic *LoggingFlag + algorithm Newton -initial + set t [format "%7.5f" [expr [getTime] + $LincrReduced]] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) Newton/Ini LF $t " +*endif + set AnalOk [analyze 1] + test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag + algorithm $algorithmTypeStatic + } +*endif +*if(strcmp(IntvData(Solution_algorithm),"Modified_Newton-Raphson")==0 && IntvData(Use_initial_stiffness_iterations,int)==0) + if {$AnalOk != 0} { + puts "\nTrying mNR/initial\n" + test NormDispIncr $TolStatic $maxNumIterStatic *LoggingFlag + algorithm ModifiedNewton -initial + set t [format "%7.5f" [expr [getTime] + $LincrReduced]] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) ModifiedNewton/Ini LF $t " +*endif + set AnalOk [analyze 1] + test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag + algorithm $algorithmTypeStatic + } +*endif + if {$AnalOk == 0} { + set LoadCounter [expr $LoadCounter+1.0/$Nk] + set committedSteps [expr $committedSteps+1] + } else { + set continueFlag 0 + } + } + if {$AnalOk == 0} { + set returnToInitStepFlag 1 + } + }; # end if Nk=4 +*if(IntvData(Tolerance_relaxation,int)==1) +*if(strcmp(IntvData(Tolerance_relaxation_after_failed_substepping_of),"/4")==0) + if {$AnalOk != 0 } { + if {$InitialTolFlag} { + set Nk 1; # back to initial step - tolerance relaxation + set AnalOk 0 + set returnToInitStepFlag 1 + set ChangeToleranceFlag 1 + set returnToInitTolFlag 0 + } + } else { + if {!$InitialTolFlag} { + set Nk 1 + set returnToInitTolFlag 1 + } + } +*endif +*endif + # substepping /8 + if {$AnalOk !=0 && $Nk==4 || ($Nk == 16 && $AnalOk == 0)} { + set Nk 8; # reduce step size + set continueFlag 1 + puts "\nInitial step is divided by 8\n" + set LincrReduced [expr $Lincr/$Nk] + integrator LoadControl $LincrReduced + for {set ik 1} {$ik <=$Nk} {incr ik 1} { + if {$continueFlag==0} { + break + } + set t [format "%7.5f" [expr [getTime] + $LincrReduced]] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) $algorithmTypeStatic$strIni LF $t " +*endif + set AnalOk [analyze 1]; # zero for convergence +*if((strcmp(IntvData(Solution_algorithm),"Full_Newton-Raphson")==0 && IntvData(Use_initial_stiffness_iterations,int)==0 ) || strcmp(IntvData(Solution_algorithm),"Newton-Raphson_with_line_search")==0 || strcmp(IntvData(Solution_algorithm),"BFGS")==0 || strcmp(IntvData(Solution_algorithm),"Broyden")==0 || strcmp(IntvData(Solution_algorithm),"KrylovNewton")==0) + if {$AnalOk != 0} { + puts "\nTrying NR/initial\n" + test NormDispIncr $TolStatic $maxNumIterStatic *LoggingFlag + algorithm Newton -initial + set t [format "%7.5f" [expr [getTime] + $LincrReduced]] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) Newton/Ini LF $t " +*endif + set AnalOk [analyze 1] + test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag + algorithm $algorithmTypeStatic + } +*endif +*if(strcmp(IntvData(Solution_algorithm),"Modified_Newton-Raphson")==0 && IntvData(Use_initial_stiffness_iterations,int)==0) + if {$AnalOk != 0} { + puts "\nTrying mNR/initial\n" + test NormDispIncr $TolStatic $maxNumIterStatic *LoggingFlag + algorithm ModifiedNewton -initial + set t [format "%7.5f" [expr [getTime] + $LincrReduced]] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) ModifiedNewton/Ini LF $t " +*endif + set AnalOk [analyze 1] + test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag + algorithm $algorithmTypeStatic + } +*endif + if {$AnalOk == 0} { + set LoadCounter [expr $LoadCounter+1.0/$Nk] + set committedSteps [expr $committedSteps+1] + } else { + set continueFlag 0 + } + } + if {$AnalOk == 0} { + set returnToInitStepFlag 1 + } + }; # end if Nk=8 +*if(IntvData(Tolerance_relaxation,int)==1) +*if(strcmp(IntvData(Tolerance_relaxation_after_failed_substepping_of),"/8")==0) + if {$AnalOk != 0 } { + if {$InitialTolFlag} { + set Nk 1; # back to initial step - tolerance relaxation + set AnalOk 0 + set returnToInitStepFlag 1 + set ChangeToleranceFlag 1 + set returnToInitTolFlag 0 + } + } else { + if {!$InitialTolFlag} { + set Nk 1 + set returnToInitTolFlag 1 + } + } +*endif +*endif + # substepping /16 + if {($Nk == 8 && $AnalOk!=0)} { + set Nk 16; # reduce step size + set continueFlag 1 + puts "\nInitial step is divided by 16\n" + set LincrReduced [expr $Lincr/$Nk] + integrator LoadControl $LincrReduced + for {set ik 1} {$ik <=$Nk} {incr ik 1} { + if {$continueFlag==0} { + break + } + set t [format "%7.5f" [expr [getTime] + $LincrReduced]] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) $algorithmTypeStatic$strIni LF $t " +*endif + set AnalOk [analyze 1]; # zero for convergence +*if((strcmp(IntvData(Solution_algorithm),"Full_Newton-Raphson")==0 && IntvData(Use_initial_stiffness_iterations,int)==0 ) || strcmp(IntvData(Solution_algorithm),"Newton-Raphson_with_line_search")==0 || strcmp(IntvData(Solution_algorithm),"BFGS")==0 || strcmp(IntvData(Solution_algorithm),"Broyden")==0 || strcmp(IntvData(Solution_algorithm),"KrylovNewton")==0) + if {$AnalOk != 0} { + puts "\nTrying NR/initial\n" + test NormDispIncr $TolStatic $maxNumIterStatic *LoggingFlag + algorithm Newton -initial + set t [format "%7.5f" [expr [getTime] + $LincrReduced]] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) Newton/Ini LF $t " +*endif + set AnalOk [analyze 1] + test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag + algorithm $algorithmTypeStatic + } +*endif +*if(strcmp(IntvData(Solution_algorithm),"Modified_Newton-Raphson")==0 && IntvData(Use_initial_stiffness_iterations,int)==0) + if {$AnalOk != 0} { + puts "\nTrying mNR/initial\n" + test NormDispIncr $TolStatic $maxNumIterStatic *LoggingFlag + algorithm ModifiedNewton -initial + set t [format "%7.5f" [expr [getTime] + $LincrReduced]] +*if(PrintTime==1) + puts -nonewline "(*IntvNum) ModifiedNewton/Ini LF $t " +*endif + set AnalOk [analyze 1] + test $testTypeStatic $TolStatic $maxNumIterStatic *LoggingFlag + algorithm $algorithmTypeStatic + } +*endif + if {$AnalOk == 0} { + set LoadCounter [expr $LoadCounter+1.0/$Nk] + set committedSteps [expr $committedSteps+1] + } else { + set continueFlag 0 + } + } + if {$AnalOk == 0} { + set returnToInitStepFlag 1 + } + }; # end if Nk=16 +*if(IntvData(Tolerance_relaxation,int)==1) +*if(strcmp(IntvData(Tolerance_relaxation_after_failed_substepping_of),"/16")==0) + if {$AnalOk != 0 } { + if {$InitialTolFlag} { + set Nk 1; # back to initial step - tolerance relaxation + set AnalOk 0 + set returnToInitStepFlag 1 + set ChangeToleranceFlag 1 + set returnToInitTolFlag 0 + } + } else { + if {!$InitialTolFlag} { + set Nk 1 + set returnToInitTolFlag 1 + } + } +*endif +*endif + }; # end while loop +}; # end if AnalOk + +if {$AnalOk == 0} { + puts "\nAnalysis completed SUCCESSFULLY" + puts "Committed steps : $committedSteps\n" +} else { + puts "\nAnalysis FAILED" + puts "Committed steps : $committedSteps\n" +} \ No newline at end of file diff --git a/bas/Analysis/UniformGroundMotionRecord.bas b/bas/Analysis/UniformGroundMotionRecord.bas index 634f302..f17f39e 100644 --- a/bas/Analysis/UniformGroundMotionRecord.bas +++ b/bas/Analysis/UniformGroundMotionRecord.bas @@ -279,7 +279,7 @@ set iGMFormat "*\ *end materials *endfor " -*# set the list of record type; accel or disp +*# set the list of record type : accel or disp set iGMType "*\ *for(i=1;i<=directions;i=i+1) *set var currGMID=tcl(ReturnGMFileID *i) diff --git a/bas/Elements/BeamColumnElements/ElasticBeamElements.bas b/bas/Elements/BeamColumnElements/ElasticBeamElements.bas index d2c87dd..f0fcd98 100644 --- a/bas/Elements/BeamColumnElements/ElasticBeamElements.bas +++ b/bas/Elements/BeamColumnElements/ElasticBeamElements.bas @@ -126,7 +126,7 @@ geomTransf Corotational *TransfTag6 0 1 0 *set var Iy=operation(Iy*Iymod) *set var J=operation(J*Jmod) *endif -*#NODESCOORD(1,2) : y coordinate of the 1st node! +*#NodesCoord(1,2) : y coordinate of the 1st node! *#----------------Z axis as Vertical Axis---------------- *if(strcmp(GenData(Vertical_axis),"Z")==0) *# VERTICAL ELEMENTS //Z AXIS diff --git a/bas/Elements/BeamColumnElements/ElasticTimoshenkoBeamElements.bas b/bas/Elements/BeamColumnElements/ElasticTimoshenkoBeamElements.bas index 52b700d..ff4405f 100644 --- a/bas/Elements/BeamColumnElements/ElasticTimoshenkoBeamElements.bas +++ b/bas/Elements/BeamColumnElements/ElasticTimoshenkoBeamElements.bas @@ -139,7 +139,7 @@ geomTransf Corotational *TransfTag6 0 1 0 *set var Iy=operation(Iy*Iymod) *set var J=operation(J*Jmod) *endif -*#NODESCOORD(1,2) : y coordinate of the 1st node! +*#NodesCoord(1,2) : y coordinate of the 1st node! *#----------------Z axis as Vertical Axis---------------- *if(strcmp(GenData(Vertical_axis),"Z")==0) *# VERTICAL ELEMENTS //Z AXIS diff --git a/bas/Model/Meta.bas b/bas/Model/Meta.bas index f966d59..26db19c 100644 --- a/bas/Model/Meta.bas +++ b/bas/Model/Meta.bas @@ -234,7 +234,7 @@ *elseif(ndime==3) *# vertical axis Y *if(strcmp(GenData(Vertical_axis),"Y")==0) -*if(x1!=x2 || z1!=z2) +*if((fabs(x1-x2)/L>1e-3) || (fabs(z1-z2)/L>1e-3)) *# vertical axis Y - oblique element *set var Vecxz1=0.0 *set var Vecxz2=1.0 @@ -248,7 +248,7 @@ *endif *# vertical axis Z *if(strcmp(GenData(Vertical_axis),"Z")==0) -*if(x1!=x2 || y1!=y2) +*if((fabs(x1-x2)/L>1e-3) || (fabs(y1-y2)/L>1e-3)) *# vertical axis Z - oblique element *set var Vecxz1=0.0 *set var Vecxz2=0.0 @@ -307,17 +307,17 @@ *if((V3<1e-6) && (V3>-1e-6)) *set var V3=0 *endif -*if((V1==1) && (V2==0) && (V3 == 0)) +*if((V1==1) && (V2==0) && (V3==0)) +X*\ -*elseif((V1==-1) && (V2==0) && (V3 == 0)) +*elseif((V1==-1) && (V2==0) && (V3==0)) -X*\ -*elseif((V1==0) && (V2==1) && (V3 == 0)) +*elseif((V1==0) && (V2==1) && (V3==0)) +Y*\ -*elseif((V1==0) && (V2==-1) && (V3 == 0)) +*elseif((V1==0) && (V2==-1) && (V3==0)) -Y*\ -*elseif((V1==0) && (V2==0) && (V3 == 1)) +*elseif((V1==0) && (V2==0) && (V3==1)) +Z*\ -*elseif((V1==0) && (V2==0) && (V3 == -1)) +*elseif((V1==0) && (V2==0) && (V3==-1)) -Z*\ *else O*\ diff --git a/bas/Model/Nodes.bas b/bas/Model/Nodes.bas index bba85d5..eedd21f 100644 --- a/bas/Model/Nodes.bas +++ b/bas/Model/Nodes.bas @@ -11,8 +11,8 @@ *set var dummy=tcl(AssignToGroupNodeList *NodesNum *currentDOF) *set var cntNodes=operation(cntNodes+1) *set var cntcurrNodes=operation(cntcurrNodes+1) -*format "%6d%10g%10g%10g" -node *NodesNum *nodescoord(1) *nodescoord(2) *nodescoord(3) +*format "%6d%12g%12g%12g" +node *NodesNum *NodesCoord(1) *NodesCoord(2) *NodesCoord(3) *end nodes *elseif(ndime==2) # node $NodeTag $XCoord $Ycoord @@ -21,7 +21,7 @@ node *NodesNum *nodescoord(1) *nodescoord(2) *nodescoord(3) *set var dummy=tcl(AssignToGroupNodeList *NodesNum *currentDOF) *set var cntcurrNodes=operation(cntcurrNodes+1) *set var cntNodes=operation(cntNodes+1) -*format "%6d%10g%10g" -node *NodesNum *nodescoord(1) *nodescoord(2) +*format "%6d%12g%12g" +node *NodesNum *NodesCoord(1) *NodesCoord(2) *end nodes *endif \ No newline at end of file diff --git a/bas/Sections/Deck2D.bas b/bas/Sections/Deck2D.bas index f872530..b4bcb29 100644 --- a/bas/Sections/Deck2D.bas +++ b/bas/Sections/Deck2D.bas @@ -18,7 +18,7 @@ proc DeckFiberSection2D { secID GJ conc1ID conc2ID steel1ID steel2ID steel3ID st set nfz1 16 } - set height [expr $thick1+$thick2+$hv]; # total external height of the man section; not including top slab and sidewalk + set height [expr $thick1+$thick2+$hv]; # total external height of the man section, not including top slab and sidewalk # Concrete Areas set Area1 [expr $thick1**$width1]; # Area of the middle slab diff --git a/bas/Sections/Deck3D.bas b/bas/Sections/Deck3D.bas index 25cd96b..a01b8b3 100644 --- a/bas/Sections/Deck3D.bas +++ b/bas/Sections/Deck3D.bas @@ -18,7 +18,7 @@ proc DeckFiberSection3D { secID GJ conc1ID conc2ID steel1ID steel2ID steel3ID st set nfy1 16 } - set height [expr $thick1+$thick2+$hv]; # total external height of the main section; not including top slab and sidewalk + set height [expr $thick1+$thick2+$hv]; # total external height of the main section, not including top slab and sidewalk # Concrete Areas set Area1 [expr $thick1**$width1]; # Area of the middle slab diff --git a/bas/tcl/Utilities.tcl b/bas/tcl/Utilities.tcl index cde91e0..43c64a8 100644 --- a/bas/tcl/Utilities.tcl +++ b/bas/tcl/Utilities.tcl @@ -1,3 +1,4 @@ + # Analysis procedures proc ExecutePost {} { @@ -16,9 +17,9 @@ proc ExecutePost {} { cd "[OpenSees::GetProblemTypePath]/exe" - # run OpenSeesPost + # Run OpenSeesPost - if {[GiD_AccessValue get GenData use_binary_format] == 0 } { + if {[GiD_AccessValue get GenData Use_HDF5_binary_output_format] == 0 } { exec {*}[auto_execok start] "OpenSeesPost.exe" "$param1" "$param2" "$OutputStep" @@ -27,6 +28,9 @@ proc ExecutePost {} { exec {*}[auto_execok start] "OpenSeesPost.exe" "$param1" "$param2" "$OutputStep" "/b" } + + UpdateInfoBar + return "" } proc CheckLogAndPost { projectDir projectName doPost } { @@ -44,14 +48,14 @@ proc CheckLogAndPost { projectDir projectName doPost } { foreach line $data { if { ([string match *Analysis* $line]) == 1 && ([string match *time* $line] == 1) } { - set words [split $line] - if { [lindex $words 0] == "Analysis" && [lindex $words 1] == "time" } { + set words [split $line] + if { [lindex $words 0] == "Analysis" && [lindex $words 1] == "time" } { - set pos [string last ":" $line] - set ElapsedTime [string range $line $pos+2 $pos+100] + set pos [string last ":" $line] + set ElapsedTime [string range $line $pos+2 $pos+100] - break - } + break + } } } @@ -92,6 +96,8 @@ proc CheckLogAndPost { projectDir projectName doPost } { } } + + return "" } proc ResetAnalysis {w} { @@ -104,17 +110,17 @@ proc ResetAnalysis {w} { # clear analysis files if {[file exists "$GiDProjectDir/OpenSees"] } { - file delete -force $GiDProjectDir/OpenSees + file delete -force "$GiDProjectDir/OpenSees" } # clear postprocessor files if {[file exists "$GiDProjectDir/$GiDProjectName.post.res.ascii"]} { - file delete -force "$GiDProjectDir/$GiDProjectName.res.post.ascii" + file delete -force "$GiDProjectDir/$GiDProjectName.post.res.ascii" } if {[file exists "$GiDProjectDir/$GiDProjectName.post.res"]} { - file delete -force "$GiDProjectDir/$GiDProjectName.res" + file delete -force "$GiDProjectDir/$GiDProjectName.post.res" } if {[file exists "$GiDProjectDir/$GiDProjectName.post.png"]} { @@ -128,6 +134,9 @@ proc ResetAnalysis {w} { if {[file exists "$GiDProjectDir/$GiDProjectName.post.grf"]} { file delete -force "$GiDProjectDir/$GiDProjectName.post.grf" } + + UpdateInfoBar + return "" } # Analysis commands @@ -141,8 +150,7 @@ proc Create_tcl_file {w} { set info [GiD_Info Project] set ProjectName [lindex $info 1] - if { ![info exists GidProcWin(ww)] || \ - ![winfo exists $GidProcWin(ww).listbox#1] } { + if { ![info exists GidProcWin(ww)] || ![winfo exists $GidProcWin(ww).listbox#1] } { set wbase .gid set ww "" } else { @@ -152,7 +160,7 @@ proc Create_tcl_file {w} { if { $ProjectName == "UNNAMED" } { - tk_dialogRAM $wbase.tmpwin [_ "Error"] [_ "Please save project before creating the .tcl file" ] error 0 [_ "Close"] + tk_dialogRAM $wbase.tmpwin [_ "Error"] [_ "Please save project before creating the .tcl file." ] error 0 [_ "Close"] } else { @@ -161,31 +169,37 @@ proc Create_tcl_file {w} { GiD_Process Mescape Files WriteForBAS "[OpenSees::GetProblemTypePath]/../OpenSees.gid/OpenSees.bas" "[OpenSees::GetProjectPath]/OpenSees/[OpenSees::GetProjectName].tcl" } + UpdateInfoBar return "" } -proc Create_and_open_tcl_file {w} { +proc Open_tcl_file {w} { destroy $w - Create_tcl_file $w + set GiDProjectDir [OpenSees::GetProjectPath] + set GiDProjectName [OpenSees::GetProjectName] - if {[file exists "[OpenSees::GetProjectPath]/OpenSees/[OpenSees::GetProjectName].tcl"] } { + set filename [file join $GiDProjectDir OpenSees "$GiDProjectName.tcl"] + set fexists [file exist $filename] - # open .tcl file + if { $fexists==1 } { - exec {*}[auto_execok start] "" "[OpenSees::GetProjectPath]/OpenSees/[OpenSees::GetProjectName].tcl" & + exec {*}[auto_execok start] "" "$GiDProjectDir/OpenSees/$GiDProjectName.tcl" & } return "" } -# This procedure is used in OpenSees.bas +proc Create_and_open_tcl_file {w} { -proc LogFile {} { + destroy $w -return [join [list logFile \"[OpenSees::GetProjectName].log\"] ] + Create_tcl_file $w + + Open_tcl_file $w + return "" } proc Run_existing_tcl {w doPost} { @@ -228,6 +242,7 @@ proc Run_existing_tcl {w doPost} { tk_dialogRAM $wbase.tmpwin [_ "Error"] [_ "The .tcl file was not created." ] error 0 [_ "Close"] } + UpdateInfoBar return "" } @@ -241,14 +256,14 @@ proc Run_existing_tcl_and_postprocess {w} { return "" } -proc Postprocess {} { +proc Postprocess_only {} { set GiDProjectDir [OpenSees::GetProjectPath] set GiDProjectName [OpenSees::GetProjectName] if {[file exists "$GiDProjectDir/OpenSees/$GiDProjectName.log"] } { - CheckLogAndPost $GiDProjectDir $GiDProjectName 1 + ExecutePost } else { @@ -262,6 +277,8 @@ proc Postprocess {} { tk_dialogRAM $wbase.tmpwin [_ "Error"] [_ "The analysis has not run yet." ] error 0 [_ "Close"] } + + return "" } proc Create_tcl_run_analysis_and_postprocess {w} { @@ -295,9 +312,7 @@ proc Create_tcl_run_analysis_and_postprocess {w} { return "" } -# Analysis dialogs - -proc OpenLogFile {w} { +proc Open_log_file {w} { destroy $w @@ -324,75 +339,78 @@ proc GoToPostProcess {w} { return "" } -proc AnalysisInformationWindow { analResult } { +proc AnalysisInformationWindow { AnalResult } { if { [GidUtils::AreWindowsDisabled] } { return } - switch $analResult { + switch $AnalResult { "NoRun" { set w .gid.win_example InitWindow $w [= "Analysis failed"] ErrorInfo "" "" 1 - if { ![winfo exists $w] } return ; # windows disabled || usemorewindows == 0 + if { ![winfo exists $w] } return; # windows disabled || usemorewindows == 0 ttk::frame $w.top ttk::label $w.top.title_text -text [= ""] ttk::frame $w.information -relief raised - ttk::label $w.information.errormessage -text [= "\tAnalysis could not run !\n\n\tPlease check generated .tcl file and report any issues to https://github.com/rclab-auth/gidopensees/issues\t"] + ttk::label $w.information.errormessage -text [= "Analysis could not run !\n\nPlease check generated .tcl file and report any issues to https://github.com/rclab-auth/gidopensees/issues"] ttk::frame $w.bottom + ttk::button $w.bottom.opentcl -text [= "Open .tcl file"] -command "Open_tcl_file $w" ttk::button $w.bottom.close -text [= "Close"] -command "destroy $w" grid $w.top.title_text -sticky ew grid $w.top -sticky new - grid $w.information.errormessage -sticky w -padx 6 -pady 6 + grid $w.information.errormessage -sticky w -padx 20 -pady 10 grid $w.information -sticky nsew - grid $w.bottom.close -padx 6 - grid $w.bottom -sticky sew -padx 6 -pady 6 + grid $w.bottom.opentcl $w.bottom.close -padx 20 + grid $w.bottom -sticky sew -padx 20 -pady 10 if { $::tcl_version >= 8.5 } { grid anchor $w.bottom center } grid rowconfigure $w 1 -weight 1 grid columnconfigure $w 0 -weight 1 } "RunFailed" { + global ElapsedTime set w .gid.win_example InitWindow $w [= "Analysis failed"] ErrorInfo "" "" 1 - if { ![winfo exists $w] } return ; # windows disabled || usemorewindows == 0 + if { ![winfo exists $w] } return; # windows disabled || usemorewindows == 0 ttk::frame $w.top ttk::label $w.top.title_text -text [= ""] ttk::frame $w.information -relief raised - ttk::label $w.information.errormessage -text [= "\tAnalysis run with errors !\n\n\tErrors were reported during analysis, please check generated .log file for more information.\t"] + ttk::label $w.information.errormessage -text [= "Analysis completed with ERRORS after $ElapsedTime.\n\nErrors were reported during analysis, please check generated .log file for more information."] ttk::frame $w.bottom - ttk::button $w.bottom.openlog -text [= "Open Log file"] -command "OpenLogFile $w" + ttk::button $w.bottom.openlog -text [= "Open log file"] -command "Open_log_file $w" ttk::button $w.bottom.close -text [= "Close"] -command "destroy $w" grid $w.top.title_text -sticky ew grid $w.top -sticky new - grid $w.information.errormessage -sticky w -padx 6 -pady 6 + grid $w.information.errormessage -sticky w -padx 20 -pady 10 grid $w.information -sticky nsew - grid $w.bottom.openlog $w.bottom.close -padx 6 - grid $w.bottom -sticky sew -padx 6 -pady 6 + grid $w.bottom.openlog $w.bottom.close -padx 20 + grid $w.bottom -sticky sew -padx 20 -pady 10 if { $::tcl_version >= 8.5 } { grid anchor $w.bottom center } grid rowconfigure $w 1 -weight 1 grid columnconfigure $w 0 -weight 1 } "RunFailedPost" { + global ElapsedTime set w .gid.win_example InitWindow $w [= "Analysis failed"] ErrorInfo "" "" 1 - if { ![winfo exists $w] } return ; # windows disabled || usemorewindows == 0 + if { ![winfo exists $w] } return; # windows disabled || usemorewindows == 0 ttk::frame $w.top ttk::label $w.top.title_text -text [= ""] ttk::frame $w.information -relief raised - ttk::label $w.information.errormessage -text [= "\tAnalysis run with errors !\n\n\tErrors were reported during analysis, please check generated .log file for more information.\t"] + ttk::label $w.information.errormessage -text [= "Analysis completed with ERRORS after $ElapsedTime.\n\nErrors were reported during analysis, please check generated .log file for more information."] ttk::frame $w.bottom - ttk::button $w.bottom.openlog -text [= "Open Log file"] -command "OpenLogFile $w" + ttk::button $w.bottom.openlog -text [= "Open log file"] -command "Open_log_file $w" ttk::button $w.bottom.close -text [= "Close"] -command "destroy $w" - ttk::button $w.bottom.ignore -text [= "Ignore"] -command "GoToPostProcess $w" + ttk::button $w.bottom.ignore -text [= "Postprocess anyway"] -command "GoToPostProcess $w" grid $w.top.title_text -sticky ew grid $w.top -sticky new - grid $w.information.errormessage -sticky w -padx 6 -pady 6 + grid $w.information.errormessage -sticky w -padx 20 -pady 10 grid $w.information -sticky nsew - grid $w.bottom.openlog $w.bottom.ignore $w.bottom.close -padx 6 - grid $w.bottom -sticky sew -padx 6 -pady 6 + grid $w.bottom.openlog $w.bottom.close $w.bottom.ignore -padx 20 + grid $w.bottom -sticky sew -padx 20 -pady 10 if { $::tcl_version >= 8.5 } { grid anchor $w.bottom center } grid rowconfigure $w 1 -weight 1 grid columnconfigure $w 0 -weight 1 @@ -402,19 +420,20 @@ proc AnalysisInformationWindow { analResult } { global ElapsedTime set w .gid.win_example InitWindow $w [= "Analysis successful"] ErrorInfo "" "" 1 - if { ![winfo exists $w] } return ;# windows disabled || usemorewindows == 0 + if { ![winfo exists $w] } return; # windows disabled || usemorewindows == 0 ttk::frame $w.top ttk::label $w.top.title_text -text [= ""] ttk::frame $w.information -relief raised - ttk::label $w.information.errormessage -text [= "\tAnalysis completed successfully after $ElapsedTime\t"] + ttk::label $w.information.errormessage -text [= "Analysis completed SUCCESSFULLY after $ElapsedTime."] ttk::frame $w.bottom + ttk::button $w.bottom.openlog -text [= "Open log file"] -command "Open_log_file $w" ttk::button $w.bottom.close -text [= "Close"] -command "destroy $w" grid $w.top.title_text -sticky ew grid $w.top -sticky new - grid $w.information.errormessage -sticky w -padx 6 -pady 6 + grid $w.information.errormessage -sticky w -padx 20 -pady 10 grid $w.information -sticky nsew - grid $w.bottom.close -padx 6 - grid $w.bottom -sticky sew -padx 6 -pady 6 + grid $w.bottom.openlog $w.bottom.close -padx 20 + grid $w.bottom -sticky sew -padx 20 -pady 10 if { $::tcl_version >= 8.5 } { grid anchor $w.bottom center } grid rowconfigure $w 1 -weight 1 grid columnconfigure $w 0 -weight 1 @@ -424,20 +443,21 @@ proc AnalysisInformationWindow { analResult } { global ElapsedTime set w .gid.win_example InitWindow $w [= "Analysis successful"] ErrorInfo "" "" 1 - if { ![winfo exists $w] } return ;# windows disabled || usemorewindows == 0 + if { ![winfo exists $w] } return; # windows disabled || usemorewindows == 0 ttk::frame $w.top ttk::label $w.top.title_text -text [= ""] ttk::frame $w.information -relief raised - ttk::label $w.information.errormessage -text [= "\tAnalysis completed successfully after $ElapsedTime\t\n\n\tContinue to postprocessing ?"] + ttk::label $w.information.errormessage -text [= "Analysis completed SUCCESSFULLY after $ElapsedTime.\n\nContinue to postprocessing ?"] ttk::frame $w.bottom - ttk::button $w.bottom.post -text [= "Postprocess"] -command "GoToPostProcess $w" + ttk::button $w.bottom.openlog -text [= "Open log file"] -command "Open_log_file $w" ttk::button $w.bottom.close -text [= "Close"] -command "destroy $w" + ttk::button $w.bottom.post -text [= "Postprocess"] -command "GoToPostProcess $w" grid $w.top.title_text -sticky ew grid $w.top -sticky new - grid $w.information.errormessage -sticky w -padx 6 -pady 6 + grid $w.information.errormessage -sticky w -padx 20 -pady 10 grid $w.information -sticky nsew - grid $w.bottom.post $w.bottom.close -padx 6 - grid $w.bottom -sticky sew -padx 6 -pady 6 + grid $w.bottom.openlog $w.bottom.close $w.bottom.post -padx 20 + grid $w.bottom -sticky sew -padx 20 -pady 10 if { $::tcl_version >= 8.5 } { grid anchor $w.bottom center } grid rowconfigure $w 1 -weight 1 grid columnconfigure $w 0 -weight 1 @@ -447,19 +467,19 @@ proc AnalysisInformationWindow { analResult } { proc WantToRegenMeshMessage {} { - set answer [tk_messageBox -parent .gid -message "Model has changed without mesh regeneration.\nDo you want to generate the mesh ?" -title "GiD+OpenSees" -type yesno -icon warning] + set answer [tk_messageBox -parent .gid -message "Model has changed without mesh updating.\nDo you want to regenerate the mesh ?" -title "Mesh update" -type yesno -icon warning] switch -- $answer { yes { - GiD_Process Mescape Meshing generate + GiD_Process Mescape Meshing generate } + no destroy } - } -# Pre analysis dialogs +# Analysis menu options proc Opt1_dialog { } { @@ -473,28 +493,29 @@ proc Opt1_dialog { } { OpenSees::SetProjectNameAndPath set GiDProjectDir [OpenSees::GetProjectPath] + set GiDProjectName [OpenSees::GetProjectName] - set file "$GiDProjectDir/OpenSees" + set file "$GiDProjectDir/OpenSees/$GiDProjectName.tcl" set fexists [file exist $file] set w .gid.warn1 if { $fexists == 1 } { InitWindow $w [= "Warning"] ErrorInfo "" "" 1 - if { ![winfo exists $w] } return ;# windows disabled || usemorewindows == 0 + if { ![winfo exists $w] } return; # windows disabled || usemorewindows == 0 ttk::frame $w.top ttk::label $w.top.title_text -text [= ""] ttk::frame $w.information -relief raised - ttk::label $w.information.warningmessage -text [= "\tCreating the .tcl file and running the analysis will overwrite any user modifications and delete any existing results.\t\n\n\tDo you want to continue ?"] + ttk::label $w.information.warningmessage -text [= "Creating the .tcl file and running the analysis will overwrite any user modifications and delete any existing results.\n\nDo you want to continue ?"] ttk::frame $w.bottom ttk::button $w.bottom.continue -text [= "Yes"] -command [= "Create_tcl_run_analysis_and_postprocess $w"] ttk::button $w.bottom.destroy -text [= "No"] -command "destroy $w" grid $w.top.title_text -sticky ew grid $w.top -sticky new - grid $w.information.warningmessage -sticky w -padx 6 -pady 6 + grid $w.information.warningmessage -sticky w -padx 20 -pady 10 grid $w.information -sticky nsew - grid $w.bottom.continue $w.bottom.destroy -padx 6 - grid $w.bottom -sticky sew -padx 6 -pady 6 + grid $w.bottom.continue $w.bottom.destroy -padx 20 + grid $w.bottom -sticky sew -padx 20 -pady 10 if { $::tcl_version >= 8.5 } { grid anchor $w.bottom center } grid rowconfigure $w 1 -weight 1 grid columnconfigure $w 0 -weight 1 @@ -504,6 +525,7 @@ proc Opt1_dialog { } { Create_tcl_run_analysis_and_postprocess $w } } + return "" } @@ -517,37 +539,39 @@ proc Opt2_dialog { } { OpenSees::SetProjectNameAndPath set GiDProjectDir [OpenSees::GetProjectPath] + set GiDProjectName [OpenSees::GetProjectName] - set file "$GiDProjectDir/OpenSees" + set file "$GiDProjectDir/OpenSees/$GiDProjectName.tcl" set fexists [file exist $file] set w .gid.warn2 if { $fexists == 1 } { InitWindow $w [= "Warning"] ErrorInfo "" "" 1 - if { ![winfo exists $w] } return ;# windows disabled || usemorewindows == 0 + if { ![winfo exists $w] } return; # windows disabled || usemorewindows == 0 ttk::frame $w.top ttk::label $w.top.title_text -text [= ""] ttk::frame $w.information -relief raised - ttk::label $w.information.warningmessage -text [= "\tCreating the .tcl file will overwrite any user modifications.\t\n\n\tDo you want to continue ?"] + ttk::label $w.information.warningmessage -text [= "Creating the .tcl file will overwrite any user modifications.\n\nDo you want to continue ?"] ttk::frame $w.bottom ttk::button $w.bottom.continue -text [= "Yes"] -command [= "Create_tcl_file $w"] ttk::button $w.bottom.destroy -text [= "No"] -command "destroy $w" grid $w.top.title_text -sticky ew grid $w.top -sticky new - grid $w.information.warningmessage -sticky w -padx 6 -pady 6 + grid $w.information.warningmessage -sticky w -padx 20 -pady 10 grid $w.information -sticky nsew - grid $w.bottom.continue $w.bottom.destroy -padx 6 - grid $w.bottom -sticky sew -padx 6 -pady 6 + grid $w.bottom.continue $w.bottom.destroy -padx 20 + grid $w.bottom -sticky sew -padx 20 -pady 10 if { $::tcl_version >= 8.5 } { grid anchor $w.bottom center } grid rowconfigure $w 1 -weight 1 grid columnconfigure $w 0 -weight 1 } else { - Create_tcl_file $w + Create_tcl_file $w } } + return "" } @@ -560,39 +584,40 @@ proc Opt3_dialog { } { } else { OpenSees::SetProjectNameAndPath - set GiDProjectDir [OpenSees::GetProjectPath] + set GiDProjectName [OpenSees::GetProjectName] - set file "$GiDProjectDir/OpenSees" + set file "$$GiDProjectDir/OpenSees/$GiDProjectName.tcl" set fexists [file exist $file] set w .gid.warn3 if { $fexists == 1 } { InitWindow $w [= "Warning"] ErrorInfo "" "" 1 - if { ![winfo exists $w] } return ;# windows disabled || usemorewindows == 0 + if { ![winfo exists $w] } return; # windows disabled || usemorewindows == 0 ttk::frame $w.top ttk::label $w.top.title_text -text [= ""] ttk::frame $w.information -relief raised - ttk::label $w.information.warningmessage -text [= "\tCreating the .tcl file will overwrite any user modifications.\t\n\n\tDo you want to continue ?"] + ttk::label $w.information.warningmessage -text [= "Creating the .tcl file will overwrite any user modifications.\n\nDo you want to continue ?"] ttk::frame $w.bottom ttk::button $w.bottom.continue -text [= "Yes"] -command [= "Create_and_open_tcl_file $w"] ttk::button $w.bottom.destroy -text [= "No"] -command "destroy $w" grid $w.top.title_text -sticky ew grid $w.top -sticky new - grid $w.information.warningmessage -sticky w -padx 6 -pady 6 + grid $w.information.warningmessage -sticky w -padx 20 -pady 10 grid $w.information -sticky nsew - grid $w.bottom.continue $w.bottom.destroy -padx 6 - grid $w.bottom -sticky sew -padx 6 -pady 6 + grid $w.bottom.continue $w.bottom.destroy -padx 20 + grid $w.bottom -sticky sew -padx 20 -pady 10 if { $::tcl_version >= 8.5 } { grid anchor $w.bottom center } grid rowconfigure $w 1 -weight 1 grid columnconfigure $w 0 -weight 1 } else { - Create_and_open_tcl_file $w + Create_and_open_tcl_file $w } } + return "" } @@ -600,8 +625,9 @@ proc Opt4_dialog { } { OpenSees::SetProjectNameAndPath set GiDProjectDir [OpenSees::GetProjectPath] + set GiDProjectName [OpenSees::GetProjectName] - set file "$GiDProjectDir/OpenSees" + set file "$GiDProjectDir/OpenSees/$GiDProjectName.log" set fexists [file exist $file] set w .gid.warn4 set false 0 @@ -609,20 +635,20 @@ proc Opt4_dialog { } { if { $fexists == 1 } { InitWindow $w [= "Warning"] ErrorInfo "" "" 1 - if { ![winfo exists $w] } return ;# windows disabled || usemorewindows == 0 + if { ![winfo exists $w] } return; # windows disabled || usemorewindows == 0 ttk::frame $w.top ttk::label $w.top.title_text -text [= ""] ttk::frame $w.information -relief raised - ttk::label $w.information.warningmessage -text [= "\tRunning the analysis will delete any existing results.\t\n\n\tDo you want to continue ?"] + ttk::label $w.information.warningmessage -text [= "Running the analysis will delete any existing results.\n\nDo you want to continue ?"] ttk::frame $w.bottom ttk::button $w.bottom.continue -text [= "Yes"] -command [= "Run_existing_tcl $w $false"] ttk::button $w.bottom.destroy -text [= "No"] -command "destroy $w" grid $w.top.title_text -sticky ew grid $w.top -sticky new - grid $w.information.warningmessage -sticky w -padx 6 -pady 6 + grid $w.information.warningmessage -sticky w -padx 20 -pady 10 grid $w.information -sticky nsew - grid $w.bottom.continue $w.bottom.destroy -padx 6 - grid $w.bottom -sticky sew -padx 6 -pady 6 + grid $w.bottom.continue $w.bottom.destroy -padx 20 + grid $w.bottom -sticky sew -padx 20 -pady 10 if { $::tcl_version >= 8.5 } { grid anchor $w.bottom center } grid rowconfigure $w 1 -weight 1 grid columnconfigure $w 0 -weight 1 @@ -637,9 +663,27 @@ proc Opt4_dialog { } { proc Opt5_dialog { } { - OpenSees::SetProjectNameAndPath + Postprocess_only - Postprocess + set w .gid.warn6 + InitWindow $w [= "Translation completed"] ErrorInfo "" "" 1 + if { ![winfo exists $w] } return; # windows disabled || usemorewindows == 0 + ttk::frame $w.top + ttk::label $w.top.title_text -text [= ""] + ttk::frame $w.information -relief raised + ttk::label $w.information.warningmessage -text [= "Proceed to postprocess ?"] + ttk::frame $w.bottom + ttk::button $w.bottom.continue -text [= "Yes"] -command [= "GoToPostProcess $w"] + ttk::button $w.bottom.destroy -text [= "No"] -command "destroy $w" + grid $w.top.title_text -sticky ew + grid $w.top -sticky new + grid $w.information.warningmessage -sticky w -padx 20 -pady 0 + grid $w.information -sticky nsew + grid $w.bottom.continue $w.bottom.destroy -padx 20 + grid $w.bottom -sticky sew -padx 20 -pady 10 + if { $::tcl_version >= 8.5 } { grid anchor $w.bottom center } + grid rowconfigure $w 1 -weight 1 + grid columnconfigure $w 0 -weight 1 return "" } @@ -648,28 +692,29 @@ proc Opt6_dialog { } { OpenSees::SetProjectNameAndPath set GiDProjectDir [OpenSees::GetProjectPath] + set GiDProjectName [OpenSees::GetProjectName] - set file "$GiDProjectDir/OpenSees" + set file "$GiDProjectDir/OpenSees/$GiDProjectName.log" set fexists [file exist $file] set w .gid.warn6 if { $fexists == 1 } { InitWindow $w [= "Warning"] ErrorInfo "" "" 1 - if { ![winfo exists $w] } return ;# windows disabled || usemorewindows == 0 + if { ![winfo exists $w] } return; # windows disabled || usemorewindows == 0 ttk::frame $w.top ttk::label $w.top.title_text -text [= ""] ttk::frame $w.information -relief raised - ttk::label $w.information.warningmessage -text [= "\tRunning the analysis will delete any existing results.\t\n\n\tDo you want to continue ?"] + ttk::label $w.information.warningmessage -text [= "Running the analysis will delete any existing results.\n\nDo you want to continue ?"] ttk::frame $w.bottom ttk::button $w.bottom.continue -text [= "Yes"] -command [= "Run_existing_tcl_and_postprocess $w"] ttk::button $w.bottom.destroy -text [= "No"] -command "destroy $w" grid $w.top.title_text -sticky ew grid $w.top -sticky new - grid $w.information.warningmessage -sticky w -padx 6 -pady 6 + grid $w.information.warningmessage -sticky w -padx 20 -pady 10 grid $w.information -sticky nsew - grid $w.bottom.continue $w.bottom.destroy -padx 6 - grid $w.bottom -sticky sew -padx 6 -pady 6 + grid $w.bottom.continue $w.bottom.destroy -padx 20 + grid $w.bottom -sticky sew -padx 20 -pady 10 if { $::tcl_version >= 8.5 } { grid anchor $w.bottom center } grid rowconfigure $w 1 -weight 1 grid columnconfigure $w 0 -weight 1 @@ -686,27 +731,30 @@ proc Opt7_dialog { } { OpenSees::SetProjectNameAndPath set GiDProjectDir [OpenSees::GetProjectPath] + set GiDProjectName [OpenSees::GetProjectName] - set file "$GiDProjectDir/OpenSees" - set fexists [file exist $file] + set file1 "$GiDProjectDir/OpenSees/$GiDProjectName.tcl" + set file2 "$GiDProjectDir/$GiDProjectName.post.res" + set fexists1 [file exist $file1] + set fexists2 [file exist $file2] set w .gid.warn6 - if { $fexists == 1 } { + if { ($fexists1 == 1) || ($fexists1 == 1) } { InitWindow $w [= "Warning"] ErrorInfo "" "" 1 - if { ![winfo exists $w] } return ;# windows disabled || usemorewindows == 0 + if { ![winfo exists $w] } return; # windows disabled || usemorewindows == 0 ttk::frame $w.top ttk::label $w.top.title_text -text [= ""] ttk::frame $w.information -relief raised - ttk::label $w.information.warningmessage -text [= "\tResetting analysis will delete any existing .tcl files and results.\t\n\n\tDo you want to continue ?"] + ttk::label $w.information.warningmessage -text [= "Resetting the analysis will delete any existing .tcl files and results.\n\nDo you want to continue ?"] ttk::frame $w.bottom ttk::button $w.bottom.continue -text [= "Yes"] -command [= "ResetAnalysis $w"] ttk::button $w.bottom.destroy -text [= "No"] -command "destroy $w" grid $w.top.title_text -sticky ew grid $w.top -sticky new - grid $w.information.warningmessage -sticky w -padx 6 -pady 6 + grid $w.information.warningmessage -sticky w -padx 20 -pady 10 grid $w.information -sticky nsew - grid $w.bottom.continue $w.bottom.destroy -padx 6 - grid $w.bottom -sticky sew -padx 6 -pady 6 + grid $w.bottom.continue $w.bottom.destroy -padx 20 + grid $w.bottom -sticky sew -padx 20 -pady 10 if { $::tcl_version >= 8.5 } { grid anchor $w.bottom center } grid rowconfigure $w 1 -weight 1 grid columnconfigure $w 0 -weight 1 @@ -715,6 +763,8 @@ proc Opt7_dialog { } { return "" } +# Various menu options + proc Import_dialog { } { set types { @@ -727,7 +777,7 @@ proc Import_dialog { } { regsub -all {/} $tcl {\\} tcl if {$tcl ne ""} { - + # wait message global ibarBackgroundColor ibarTextColor ibarLineColor @@ -796,19 +846,19 @@ proc Import_dialog { } { set w .gid.win_example InitWindow $w [= "Import finished"] ErrorInfo "" "" 1 - if { ![winfo exists $w] } return ; # windows disabled || usemorewindows == 0 + if { ![winfo exists $w] } return; # windows disabled || usemorewindows == 0 ttk::frame $w.top ttk::label $w.top.title_text -text [= ""] ttk::frame $w.information -relief raised - ttk::label $w.information.errormessage -text [= "\tGeometry was successfully imported from $tcl\t\t"] + ttk::label $w.information.errormessage -text [= "Geometry was successfully imported from $tcl"] ttk::frame $w.bottom ttk::button $w.bottom.close -text [= "Close"] -command "destroy $w" grid $w.top.title_text -sticky ew grid $w.top -sticky new - grid $w.information.errormessage -sticky w -padx 6 -pady 6 + grid $w.information.errormessage -sticky w -padx 20 -pady 10 grid $w.information -sticky nsew - grid $w.bottom.close -padx 6 - grid $w.bottom -sticky sew -padx 6 -pady 6 + grid $w.bottom.close -padx 20 + grid $w.bottom -sticky sew -padx 20 -pady 10 if { $::tcl_version >= 8.5 } { grid anchor $w.bottom center } grid rowconfigure $w 1 -weight 1 grid columnconfigure $w 0 -weight 1 @@ -817,19 +867,19 @@ proc Import_dialog { } { set w .gid.win_example InitWindow $w [= "Import failed"] ErrorInfo "" "" 1 - if { ![winfo exists $w] } return ; # windows disabled || usemorewindows == 0 + if { ![winfo exists $w] } return; # windows disabled || usemorewindows == 0 ttk::frame $w.top ttk::label $w.top.title_text -text [= ""] ttk::frame $w.information -relief raised - ttk::label $w.information.errormessage -text [= "\tCould not import model geometry.\t\n\n\tPlease report your model to GitHub issues.\t\n\t(https://github.com/rclab-auth/gidopensees/issues)\t\t"] + ttk::label $w.information.errormessage -text [= "Could not import model geometry.\n\nPlease report your model to GitHub issues.\n(https://github.com/rclab-auth/gidopensees/issues)"] ttk::frame $w.bottom ttk::button $w.bottom.close -text [= "Close"] -command "destroy $w" grid $w.top.title_text -sticky ew grid $w.top -sticky new - grid $w.information.errormessage -sticky w -padx 6 -pady 6 + grid $w.information.errormessage -sticky w -padx 20 -pady 10 grid $w.information -sticky nsew - grid $w.bottom.close -padx 6 - grid $w.bottom -sticky sew -padx 6 -pady 6 + grid $w.bottom.close -padx 20 + grid $w.bottom -sticky sew -padx 20 -pady 10 if { $::tcl_version >= 8.5 } { grid anchor $w.bottom center } grid rowconfigure $w 1 -weight 1 grid columnconfigure $w 0 -weight 1 @@ -839,7 +889,33 @@ proc Import_dialog { } { return "" } -# About option in GiD+OpenSees Menu +proc btn_Open_tcl { } { + + set GiDProjectDir [OpenSees::GetProjectPath] + set GiDProjectName [OpenSees::GetProjectName] + set OpenSeesPath [OpenSees::GetOpenSeesPath] + global GidProcWin + + if {[file exists "$GiDProjectDir/OpenSees/$GiDProjectName.tcl"] } { + + exec {*}[auto_execok start] "" "$GiDProjectDir/OpenSees/$GiDProjectName.tcl" & + + } else { + + if { ![info exists GidProcWin(ww)] || ![winfo exists $GidProcWin(ww).listbox#1] } { + set wbase .gid + set ww "" + } else { + set wbase $GidProcWin(ww) + set ww $GidProcWin(ww).listbox#1 + } + + tk_dialogRAM $wbase.tmpwin [_ "Error"] [_ "The .tcl file was not created." ] error 0 [_ "Close"] + } + + UpdateInfoBar + return "" +} proc AboutOpenSeesProbType { } { @@ -885,7 +961,7 @@ proc OpenSees_Menu { dir } { # Tab labels - set tabs [list \ + set tabs [list \ [= "Import geometry from existing .tcl (beta)"] \ [= "Create .tcl, run analysis and postprocess"] \ "---" \ @@ -960,7 +1036,7 @@ proc OpenSees_Menu { dir } { set position 0 - foreach tab $tabs command $cmds icon $icons { + foreach tab $tabs command $cmds icon $icons { set full_path_icon [file normalize [file join $dir img Menu $icon]] GiDMenu::InsertOption "GiD+OpenSees" [list $tab] $position PRE $command "" $full_path_icon incr position @@ -999,3 +1075,11 @@ proc ConvertToMPa { Value Unit } { } return $Value } + +# This procedure is used in OpenSees.bas + +proc LogFile {} { + +return [join [list logFile \"[OpenSees::GetProjectName].log\"] ] + +} diff --git a/img/Menu/btn_Axes.png b/img/Menu/btn_Axes.png new file mode 100644 index 0000000..507fddd Binary files /dev/null and b/img/Menu/btn_Axes.png differ diff --git a/img/Menu/mnu_VersionHistory.png b/img/Menu/mnu_VersionHistory.png deleted file mode 100644 index 767389a..0000000 Binary files a/img/Menu/mnu_VersionHistory.png and /dev/null differ diff --git a/img/Menu/mnu_Wiki.png b/img/Menu/mnu_Wiki.png index aad5b5d..1b49045 100644 Binary files a/img/Menu/mnu_Wiki.png and b/img/Menu/mnu_Wiki.png differ diff --git a/img/Toolbar/Black/Splash.png b/img/Toolbar/Black/Splash.png index c252a74..9887380 100644 Binary files a/img/Toolbar/Black/Splash.png and b/img/Toolbar/Black/Splash.png differ diff --git a/img/Toolbar/Black/btn_tcl.png b/img/Toolbar/Black/btn_tcl.png new file mode 100644 index 0000000..00f1414 Binary files /dev/null and b/img/Toolbar/Black/btn_tcl.png differ diff --git a/img/Toolbar/Classic/Splash.png b/img/Toolbar/Classic/Splash.png index 9e852c0..697eb25 100644 Binary files a/img/Toolbar/Classic/Splash.png and b/img/Toolbar/Classic/Splash.png differ diff --git a/img/Toolbar/Classic/btn_tcl.png b/img/Toolbar/Classic/btn_tcl.png new file mode 100644 index 0000000..22aea46 Binary files /dev/null and b/img/Toolbar/Classic/btn_tcl.png differ diff --git a/post/OpenSeesPost.dpr b/post/OpenSeesPost.dpr index 4999fb0..8aa7683 100644 --- a/post/OpenSeesPost.dpr +++ b/post/OpenSeesPost.dpr @@ -299,13 +299,15 @@ var Valid, Found : boolean; i,j : integer; - Mult, - StepTime, - TotTime : double; + Mult : double; ElemID, ElemCrash : array of integer; ElemType : array of string; Elem : integer; + s : string; + Intv, + IntPrev, + Sum : integer; begin if not FileExists(LogFile) then @@ -332,55 +334,71 @@ begin if Valid then begin STAT := TStringList.Create; - STAT.Add('Interval'#9'Interval step'#9'Total step'#9'Time step'#9'Time'#9'Iterations'#9'Norm'#9'Criterion'#9'Step multiplier'); + STAT.Add('Interval'#9'Interval step'#9'Total step'#9'Step multiplier'#9'LF/Time'#9'Iterations'#9'Algorithm'#9'Criterion'#9'Norm'); i := 0; cnt := 0; Mult := 1; - TotTime := 0; + IntPrev := 0; + Sum := 0; while i < LOG.Count do begin - if LOG.Strings[i] = 'Back to initial time step ..' then + if LOG.Strings[i] = 'Back to initial step' then Mult := 1 - else if LOG.Strings[i] = 'Initial time step is divided by 2 ..' then + else if LOG.Strings[i] = 'Initial step is divided by 2' then Mult := 1/2 - else if LOG.Strings[i] = 'Initial time step is divided by 4 ..' then + else if LOG.Strings[i] = 'Initial step is divided by 4' then Mult := 1/4 - else if LOG.Strings[i] = 'Initial time step is divided by 8 ..' then + else if LOG.Strings[i] = 'Initial step is divided by 8' then Mult := 1/8 - else if LOG.Strings[i] = 'Initial time step is divided by 16 ..' then + else if LOG.Strings[i] = 'Initial step is divided by 16' then Mult := 1/16; - if (Pos('iteration:',LOG.Strings[i]) <> 0) then + if (Copy(LOG.Strings[i],1,1) = '(') and (Pos('- iteration:',LOG.Strings[i]) <> 0) then begin - if GetIntervalStep(cnt) = 0 then - TotTime := 0; + Inc(cnt); + Inc(Sum); - if Int_Time[GetIntervalNumber(cnt)-1] <> 0 then - StepTime := Mult * Int_Time[GetIntervalNumber(cnt)-1] - else - StepTime := 0; + Intv := StrToInt(Trim(Copy( LOG.Strings[i],Pos('(',LOG.Strings[i])+1,Pos(')',LOG.Strings[i])-Pos('(',LOG.Strings[i])-1 ))); - TotTime := TotTime+StepTime; + if Intv <> IntPrev then + begin + cnt := 1; + IntPrev := Intv; + end; - STAT.Add( IntToStr(GetIntervalNumber(cnt))+#9+ - IntToStr(GetIntervalStep(cnt))+#9+ - IntToStr(cnt+1)+#9+ - FloatToStr(StepTime)+#9+ - FloatToStr(TotTime)+#9+ - Trim(Copy(LOG.Strings[i],Pos('iteration:',LOG.Strings[i])+10,Pos(' current',LOG.Strings[i])-Pos('iteration:',LOG.Strings[i])-10 ))+#9+ - Trim(Copy(LOG.Strings[i],Pos('Norm:',LOG.Strings[i])+5,Pos(' (max',LOG.Strings[i])-Pos('iteration:',LOG.Strings[i])-5 ))+#9+ - Trim(Copy(LOG.Strings[i],Pos('CTest',LOG.Strings[i])+5,Pos('::',LOG.Strings[i])-Pos('CTest',LOG.Strings[i])-5 ))+#9+ - FloatToStr(Mult)); + s := IntToStr(Intv)+#9; + s := s + IntToStr(cnt)+#9; + s := s + IntToStr(Sum)+#9; - Inc(cnt); + s := s + FloatToStr(Mult)+#9; + + if Pos('Time',LOG.Strings[i]) <> 0 then + s := s + Trim(Copy( LOG.Strings[i],Pos('Time ',LOG.Strings[i])+5,Pos(' CTest',LOG.Strings[i])-Pos('Time ',LOG.Strings[i])-5 ))+#9; + + if Pos('LF',LOG.Strings[i]) <> 0 then + s := s + Trim(Copy( LOG.Strings[i],Pos('LF ',LOG.Strings[i])+3,Pos(' CTest',LOG.Strings[i])-Pos('LF ',LOG.Strings[i])-3 ))+#9; + + s := s + Trim(Copy( LOG.Strings[i],Pos('iteration:',LOG.Strings[i])+10,Pos(' current',LOG.Strings[i])-Pos('iteration:',LOG.Strings[i])-10 ))+#9; + + if Pos('Time',LOG.Strings[i]) <> 0 then + s := s + Trim(Copy( LOG.Strings[i],Pos(') ',LOG.Strings[i])+2,Pos(' Time',LOG.Strings[i])-Pos(') ',LOG.Strings[i])-2 ))+#9; + + if Pos('LF',LOG.Strings[i]) <> 0 then + s := s + Trim(Copy( LOG.Strings[i],Pos(') ',LOG.Strings[i])+2,Pos(' LF',LOG.Strings[i])-Pos(') ',LOG.Strings[i])-2 ))+#9; + + s := s + Trim(Copy( LOG.Strings[i],Pos('CTest',LOG.Strings[i])+5,Pos('::',LOG.Strings[i])-Pos('CTest',LOG.Strings[i])-5 ))+#9; + + s := s + Trim(Copy( LOG.Strings[i],Pos('Norm:',LOG.Strings[i])+5,Pos(' (max',LOG.Strings[i])-Pos('Norm:',LOG.Strings[i])-5 )); + + STAT.Add(s); end; Inc(i); end; - STAT.SaveToFile(ExtractFilePath(LogFile)+'Analysis performance.out'); + STAT.SaveToFile(ExtractFilePath(LogFile)+'Analysis performance.xls'); STAT.Free; end; @@ -449,7 +467,7 @@ begin for i := 0 to Length(ElemID)-1 do STAT.Add(IntToStr(ElemID[i])+#9+ElemType[i]+#9+IntToStr(ElemCrash[i])); - STAT.SaveToFile(ExtractFilePath(LogFile)+'Analysis problems.out'); + STAT.SaveToFile(ExtractFilePath(LogFile)+'Analysis problems.xls'); STAT.Free; end; @@ -4006,11 +4024,11 @@ begin writeln; - if ParamStr(3) = '/b' then + if ParamStr(4) = '/b' then begin TextColor(LightGreen); - write('Creating binary results file...'); + write('Creating HDF5 binary results file...'); // convert to binary @@ -4023,7 +4041,7 @@ begin begin write('Text results file...'); - RenameFile(ResFileASCII,ResFileBin); + RenameFile(ResFileASCII,ResFileBin); // ASCII just becomes post.res end; writeln(#8#8#8' : '+GetFileSize(ResFileBin)); diff --git a/tcl/Fiber.tcl b/tcl/Fiber.tcl index 9f761d6..0db09bf 100644 --- a/tcl/Fiber.tcl +++ b/tcl/Fiber.tcl @@ -13,7 +13,7 @@ proc Fiber::CalcReinfBarArea { event args } { SYNC { set pi 3.14159265358979323846 - set GDN [lindex $args 0] + set GDN [lindex $args 0] set STRUCT [lindex $args 1] set QUESTION [lindex $args 2] @@ -169,7 +169,7 @@ proc Fiber::CalcTorsionalStiffness { event args } { SYNC { set pi 3.14159265358979323846 - set GDN [lindex $args 0] + set GDN [lindex $args 0] set STRUCT [lindex $args 1] set QUESTION [lindex $args 2] @@ -447,7 +447,7 @@ proc Fiber::SuggestFibers { event args } { SYNC { - set GDN [lindex $args 0] + set GDN [lindex $args 0] set STRUCT [lindex $args 1] set QUESTION [lindex $args 2] set ndm [OpenSees::ReturnProjectDimensions] @@ -471,7 +471,7 @@ proc Fiber::SuggestFibers { event args } { "3" { - if { $height >= $width } { + if { $height >= $width } { set Fibers_z [roundUp [expr 15*$height/$width] ] set Fibers_y 15 @@ -486,7 +486,7 @@ proc Fiber::SuggestFibers { event args } { } "2" { - if { $height >= $width } { + if { $height >= $width } { set Fibers_y [roundUp [expr 15*$height/$width] ] set Fibers_z 15 @@ -1089,9 +1089,9 @@ set ::FiberCustomVisited 0 proc Fiber::Script { event args } { - variable script; - variable scriptParent; - variable scriptRegions; + variable script + variable scriptParent + variable scriptRegions switch $event { @@ -1190,7 +1190,7 @@ proc Fiber::Script { event args } { } proc Fiber::SetScript { Material Region text } { - variable script; + variable script set script($Material,$Region) $text return "" @@ -1198,7 +1198,7 @@ proc Fiber::SetScript { Material Region text } { proc Fiber::SaveScriptFile { Material Region } { - variable script; + variable script set data [GiD_Info Project] set ProjectName [lindex $data 1] diff --git a/tcl/GenData.tcl b/tcl/GenData.tcl index 9fd03b2..214c756 100644 --- a/tcl/GenData.tcl +++ b/tcl/GenData.tcl @@ -5,8 +5,8 @@ namespace eval GenData { proc GenData::Description { event args } { - variable Description_text; - variable Description_Parent; + variable Description_text + variable Description_Parent OpenSees::SetProjectNameAndPath set GiDProjectDir [OpenSees::GetProjectPath] set GiDProjectName [OpenSees::GetProjectName] @@ -22,6 +22,7 @@ proc GenData::Description { event args } { set filename [file join $GiDProjectDir "$GiDProjectName.txt"] set fexist [file exist $filename] + set Description_text "" if { $fexist == 1 } { set fp [open $filename r] @@ -38,7 +39,7 @@ proc GenData::Description { event args } { set QUESTION [lindex $args 4] grid [text $PARENT.description -width 70 -height 13 -font {Calibri -14} ] -column 1 -row [expr $ROW+1] $PARENT.description delete 1.0 end - $PARENT.description insert 1.0 "$Description_text" + $PARENT.description insert 1.0 [string trim $Description_text] return "" } @@ -48,8 +49,19 @@ proc GenData::Description { event args } { set STRUCT [lindex $args 1] set QUESTION [lindex $args 2] set Description_text [$Description_Parent.description get 1.0 end] - set ok [GenData::SaveDescriptionFile] + if { [string trim $Description_text] != "" } { + set ok [GenData::SaveDescriptionFile] + + } else { + + set filename [file join $GiDProjectDir "$GiDProjectName.txt"] + set fexist [file exist $filename] + + if { $fexist == 1 } { + file delete -force $filename + } + } } DEPEND { @@ -58,8 +70,9 @@ proc GenData::Description { event args } { } CLOSE { + UpdateInfoBar - return "" + } } @@ -73,7 +86,7 @@ proc GenData::SaveDescriptionFile { } { OpenSees::SetProjectNameAndPath set GiDProjectDir [OpenSees::GetProjectPath] set GiDProjectName [OpenSees::GetProjectName] - variable Description_text; + variable Description_text set Description_text [string trim $Description_text] diff --git a/tcl/IntvData.tcl b/tcl/IntvData.tcl index 3321bd0..37237dc 100644 --- a/tcl/IntvData.tcl +++ b/tcl/IntvData.tcl @@ -8,6 +8,7 @@ proc IntvData::MotionDirections { event args } { lassign $args GDN STRUCT QUESTION ACTION VALUE set Dirs [DWLocalGetValue $GDN $STRUCT Directions] + if { $ACTION == "RESTORE" } { set exc_type [DWLocalGetValue $GDN $STRUCT Excitation_type] if { $exc_type == "Sine" } { @@ -56,12 +57,10 @@ proc IntvData::MotionDirections { event args } { set dummy [TK_DWSet $GDN $STRUCT "First_ground_motion_direction" "#CURRENT#" normal] set dummy [TK_DWSet $GDN $STRUCT "Second_ground_motion_direction" "#CURRENT#" normal] set dummy [TK_DWSet $GDN $STRUCT "Third_ground_motion_direction" "#CURRENT#" normal] - } } } } - } return "" @@ -74,6 +73,7 @@ proc IntvData::ExcitationType { event args } { DEPEND { lassign $args GDN STRUCT QUESTION ACTION VALUE + if { $ACTION == "RESTORE" } { set exc_type [DWLocalGetValue $GDN $STRUCT $QUESTION] if { $exc_type == "Sine" } { @@ -105,8 +105,9 @@ proc IntvData::Integrator { event args } { DEPEND { - lassign $args GDN STRUCT QUESTION ACTION VALUE - if { $ACTION == "RESTORE" } { + lassign $args GDN STRUCT QUESTION ACTION VALUE + + if { $ACTION == "RESTORE" } { set integrator_type [DWLocalGetValue $GDN $STRUCT $QUESTION] set analysis_type [DWLocalGetValue $GDN $STRUCT Analysis_type] @@ -142,14 +143,18 @@ proc IntvData::LoadingPath { event args } { switch $event { - DEPEND { + DEPEND { + + lassign $args GDN STRUCT QUESTION ACTION VALUE - lassign $args GDN STRUCT QUESTION ACTION VALUE - if { $ACTION == "SET" } { + set integrator_type [DWLocalGetValue $GDN $STRUCT Integrator_type] - set dummy [TK_DWSet $GDN $STRUCT $QUESTION $VALUE normal] - set dummy [TK_DWSet $GDN $STRUCT $QUESTION $VALUE disabled] + if { $ACTION == "RESTORE" } { + + if { $integrator_type == "Load_control" } { + set dummy [TK_DWSet $GDN $STRUCT "Loading_path" "Monotonic" disabled] + } } } } @@ -163,8 +168,10 @@ proc IntvData::LoadingType { event args } { DEPEND { - lassign $args GDN STRUCT QUESTION ACTION VALUE - if { $ACTION == "RESTORE" } { + lassign $args GDN STRUCT QUESTION ACTION VALUE + + if { $ACTION == "RESTORE" } { + set loading_type [DWLocalGetValue $GDN $STRUCT $QUESTION] set integrator_type [DWLocalGetValue $GDN $STRUCT Integrator_type] @@ -188,6 +195,7 @@ proc IntvData::LoadingType { event args } { Multiple_support_excitation \ Function \ " + if { [lsearch $StaticIntegratorTypes $integrator_type] == -1 && [lsearch $StaticLoadingTypes $loading_type] != -1 } { set dummy [TK_DWSet $GDN $STRUCT $QUESTION Uniform_excitation normal] } @@ -195,6 +203,15 @@ proc IntvData::LoadingType { event args } { if { [lsearch $TransientIntegratorTypes $integrator_type] == -1 && [lsearch $TransientLoadingTypes $loading_type] != -1 } { set dummy [TK_DWSet $GDN $STRUCT $QUESTION Linear normal] } + + if { $integrator_type == "Load_control" } { + + set dummy [TK_DWSet $GDN $STRUCT "Loading_path" "Monotonic" disabled] + + } elseif { $integrator_type == "Displacement_control" } { + + set dummy [TK_DWSet $GDN $STRUCT "Loading_path" "#CURRENT#" normal] + } } } } @@ -209,6 +226,7 @@ proc IntvData::CtrlNodeDirection {event args } { DEPEND { lassign $args GDN STRUCT QUESTION ACTION VALUE + if { $ACTION == "RESTORE" } { set CtrlNodeDir [DWLocalGetValue $GDN $STRUCT $QUESTION] if { $CtrlNodeDir == "UX" } { @@ -238,6 +256,7 @@ proc IntvData::ToleranceRelaxation {event args} { DEPEND { lassign $args GDN STRUCT QUESTION ACTION VALUE + if { $ACTION == "RESTORE" } { set Checked [DWLocalGetValue $GDN $STRUCT $QUESTION] if { $Checked } { @@ -252,6 +271,7 @@ proc IntvData::ToleranceRelaxation {event args} { } } } + return "" } \ No newline at end of file diff --git a/tcl/PDMY.tcl b/tcl/PDMY.tcl index 03ee238..c85b97e 100644 --- a/tcl/PDMY.tcl +++ b/tcl/PDMY.tcl @@ -18,9 +18,9 @@ proc PDMY::GenerateRecommendedValues { event args } { switch $Soil_type { "Loose_Sand" { - set rho 1.7 ;# ton/m^3 + set rho 1.7; # ton/m^3 set Gr 55; # MPa - set Bulk 150 ;# MPa + set Bulk 150; # MPa set gammamax 0.1 set Fangle 29 set d 0.5 @@ -50,9 +50,9 @@ proc PDMY::GenerateRecommendedValues { event args } { set ok [DWLocalSetValue $GDN $STRUCT Initial_void_ratio $voidratio] } "Medium_Sand" { - set rho 1.9 ;# ton/m^3 + set rho 1.9; # ton/m^3 set Gr 75; # MPa - set Bulk 200 ;# MPa + set Bulk 200; # MPa set gammamax 0.1 set Fangle 33 set d 0.5 @@ -82,9 +82,9 @@ proc PDMY::GenerateRecommendedValues { event args } { set ok [DWLocalSetValue $GDN $STRUCT Initial_void_ratio $voidratio] } "Medium-dense_Sand" { - set rho 2.0 ;# ton/m^3 + set rho 2.0; # ton/m^3 set Gr 100; # MPa - set Bulk 300 ;# MPa + set Bulk 300; # MPa set gammamax 0.1 set Fangle 37 set d 0.5 @@ -114,13 +114,13 @@ proc PDMY::GenerateRecommendedValues { event args } { set ok [DWLocalSetValue $GDN $STRUCT Initial_void_ratio $voidratio] } "Dense_Sand" { - set rho 2.1 ;# ton/m^3 + set rho 2.1; # ton/m^3 set Gr 135; # MPa - set Bulk 390 ;# MPa + set Bulk 390; # MPa set gammamax 0.1 set Fangle 40 set d 0.5 - set pr 80; #kPa + set pr 80; # kPa set ptang 27 set contraction 0.03 set dilat1 0.8 diff --git a/tcl/Records.tcl b/tcl/Records.tcl index a9f1b52..864c727 100644 --- a/tcl/Records.tcl +++ b/tcl/Records.tcl @@ -11,14 +11,14 @@ namespace eval Records { proc Records::SetValues {rfilename rformat rtype rdt rsclFactor rLinesSkip rtCol rvCol } { - variable filename; - variable form; - variable type; - variable dt; - variable sclFactor; - variable linesSkip; - variable timeCol; - variable valCol; + variable filename + variable form + variable type + variable dt + variable sclFactor + variable linesSkip + variable timeCol + variable valCol OpenSees::SetProjectNameAndPath @@ -77,8 +77,8 @@ proc Records::SetValues {rfilename rformat rtype rdt rsclFactor rLinesSkip rtCol proc Records::GetFilename {} { - variable filename; - return $filename; + variable filename + return $filename } @@ -87,7 +87,7 @@ proc Records::SetFilename {rfilename} { OpenSees::SetProjectNameAndPath set GiDProjectDir [OpenSees::GetProjectPath] - variable filename; + variable filename set filename "$GiDProjectDir/Records/$rfilename" @@ -96,56 +96,56 @@ proc Records::SetFilename {rfilename} { proc Records::GetFormat {} { - variable form; - return $form; + variable form + return $form } proc Records::GetType {} { - variable type; - return $type; + variable type + return $type } proc Records::GetDt {} { - variable dt; - return $dt; + variable dt + return $dt } proc Records::GetSclFactor {} { - variable sclFactor; - return $sclFactor; + variable sclFactor + return $sclFactor } proc Records::GetLinesSkip {} { - variable linesSkip; - return $linesSkip; + variable linesSkip + return $linesSkip } proc Records::GetTimeCol {} { - variable timeCol; - return $timeCol; + variable timeCol + return $timeCol } proc Records::GetValCol {} { - variable valCol; - return $valCol; + variable valCol + return $valCol } proc Records::Display {event args} { - variable filename; - variable form; - variable type; - variable dt; - variable sclFactor; - variable linesSkip; - variable timeCol; - variable valCol; + variable filename + variable form + variable type + variable dt + variable sclFactor + variable linesSkip + variable timeCol + variable valCol switch $event { @@ -277,7 +277,7 @@ proc Records::FileButton { event args } { #set entry $PARENT.e$ROW set entry "" foreach item [grid slaves $PARENT -row [expr $ROW-1]] { - if { [winfo class $item] == "Entry" || [winfo class $item] == "TEntry" } { + if { [winfo class $item] == "Entry" || [winfo class $item] == "TEntry" } { #assumed that it is the only entry of this row set entry $item break @@ -290,10 +290,9 @@ proc Records::FileButton { event args } { set value [lindex $values $index_field-1] set tkwidgedprivfilenamebutton($QUESTION,filename) $value } - set w [ttk::frame $PARENT.cfilenamebutton$QUESTION] ;#use a name depending on $QUESTION to allow more than one row changed + set w [ttk::frame $PARENT.cfilenamebutton$QUESTION]; # use a name depending on $QUESTION to allow more than one row changed ttk::entry $w.e1 -textvariable tkwidgedprivfilenamebutton($QUESTION,filename) - ttk::button $w.b1 -image [gid_themes::GetImage "folder.png"] \ - -command [list Records::GetFilenameCmd tkwidgedprivfilenamebutton($QUESTION,filename) $w.e1 1] + ttk::button $w.b1 -image [gid_themes::GetImage "folder.png"] -command [list Records::GetFilenameCmd tkwidgedprivfilenamebutton($QUESTION,filename) $w.e1 1] set tkwidgedprivfilenamebutton($QUESTION,widget) $w grid $w.e1 $w.b1 -sticky ew grid columnconfigure $w {0} -weight 1 @@ -333,6 +332,7 @@ proc Records::FileButton { event args } { array unset tkwidgedprivfilenamebutton UpdateInfoBar + } } @@ -355,8 +355,15 @@ proc Records::GetFilenameCmd { varname entry {tail 0}} { if { $ProjectName == "UNNAMED" } { - #tk_dialogRAM $wbase.tmpwin [_ "Warning"] [_ "Before using a Record file, you need to save the project" ] warning 0 [_ "OK"] - set answer [tk_messageBox -message "Before saving a Record file, you need to save the Project" -type ok -icon warning] + if { ![info exists GidProcWin(ww)] || ![winfo exists $GidProcWin(ww).listbox#1] } { + set wbase .gid + set ww "" + } else { + set wbase $GidProcWin(ww) + set ww $GidProcWin(ww).listbox#1 + } + + tk_dialogRAM $wbase.tmpwin [_ "Error"] [_ "Before selecting a record file, you need to save the project first." ] error 0 [_ "Close"] set current_value "" } else { diff --git a/tcl/SecAggregator.tcl b/tcl/SecAggregator.tcl index c563bee..f12a687 100644 --- a/tcl/SecAggregator.tcl +++ b/tcl/SecAggregator.tcl @@ -9,7 +9,7 @@ proc SecAggregator::CheckFieldValues { event args } { set PARENT [lindex $args 0] upvar [lindex $args 1] ROW - set label [label $PARENT.info -text [= "Section Force-Deformation response for a particular section DOF:"] ] + set label [label $PARENT.info -text [= "Section Force-Deformation response for a particular section DOF:"] ] grid $label -column 0 -row [expr $ROW+0] -sticky nw } diff --git a/tcl/SeriesParallel.tcl b/tcl/SeriesParallel.tcl index 51ad14c..d92ba5b 100644 --- a/tcl/SeriesParallel.tcl +++ b/tcl/SeriesParallel.tcl @@ -68,6 +68,7 @@ proc SeriesParallel::CheckFieldValues { event args } { CLOSE { UpdateInfoBar + } } diff --git a/tcl/Various.tcl b/tcl/Various.tcl index 79c42a7..a356277 100644 --- a/tcl/Various.tcl +++ b/tcl/Various.tcl @@ -16,7 +16,7 @@ proc TK_ActiveIntervalinLoads { event args } { set b [Button $PARENT.changeintv -text [= " Change Interval "] -helptext [= "Change Interval"] -command $cmd -state normal] grid $b -column 1 -row [expr $ROW] -sticky nw -pady 5 - return "" + return "" } SYNC { @@ -42,7 +42,7 @@ proc TK_EditInterval { event args } { CLOSE { UpdateInfoBar - + return "" } } @@ -153,11 +153,11 @@ proc TK_ElementWikiInfo { event args } { } - image create photo img -format PNG -file [file join [OpenSees::GetProblemTypePath] img/Menu/mnu_Wiki.png] - set b [Button $PARENT.wikiinfo -image img -text [= " Element Info "] -helptext [= "Visit OpenSees Wiki for more information"] -command $cmd -state normal -compound left] + image create photo wiki -format PNG -file [file join [OpenSees::GetProblemTypePath] img/Menu/mnu_Wiki.png] + set b [Button $PARENT.wikiinfo -image wiki -text [= " Element Info "] -helptext [= "Visit OpenSees Wiki for more information"] -command $cmd -state normal -compound left] grid $b -column 1 -row [expr $ROW+1] -sticky nw -pady 5 - return "" + return "" } } @@ -269,13 +269,16 @@ proc TK_MaterialWikiInfo { event args } { "MinMax" { set cmd "VisitWeb http://opensees.berkeley.edu/wiki/index.php/MinMax_Material" } + "BondSP01" { + set cmd "VisitWeb http://opensees.berkeley.edu/wiki/index.php/Bond_SP01_-_-_Strain_Penetration_Model_for_Fully_Anchored_Steel_Reinforcing_Bars" + } } - image create photo img -format PNG -file [file join [OpenSees::GetProblemTypePath] img/Menu/mnu_Wiki.png] - set b [Button $PARENT.wikiinfo -image img -text [= " Material info "] -helptext [= "Visit OpenSees Wiki for more information"] -command $cmd -state normal -compound left] + image create photo wiki -format PNG -file [file join [OpenSees::GetProblemTypePath] img/Menu/mnu_Wiki.png] + set b [Button $PARENT.wikiinfo -image wiki -text [= " Material info "] -helptext [= "Visit OpenSees Wiki for more information"] -command $cmd -state normal -compound left] grid $b -column 1 -row [expr $ROW+1] -sticky nw -pady 5 - return "" + return "" } } @@ -323,11 +326,11 @@ proc TK_SectionWikiInfo { event args } { } } - image create photo img -format PNG -file [file join [OpenSees::GetProblemTypePath] img/Menu/mnu_Wiki.png] - set b [Button $PARENT.wikiinfo -image img -text [= " Section info "] -helptext [= "Visit OpenSees Wiki for more information"] -command $cmd -state normal -compound left] + image create photo wiki -format PNG -file [file join [OpenSees::GetProblemTypePath] img/Menu/mnu_Wiki.png] + set b [Button $PARENT.wikiinfo -image wiki -text [= " Section info "] -helptext [= "Visit OpenSees Wiki for more information"] -command $cmd -state normal -compound left] grid $b -column 1 -row [expr $ROW+1] -sticky nw -pady 5 - return "" + return "" } } @@ -344,8 +347,8 @@ proc TK_ZeroLengthWikiInfo { event args } { upvar [lindex $args 1] ROW set cmd "VisitWeb http://opensees.berkeley.edu/wiki/index.php/ZeroLength_Element" - image create photo img -format PNG -file [file join [OpenSees::GetProblemTypePath] img/Menu/mnu_Wiki.png] - set b [Button $PARENT.wikiinfo -image img -text [= " Element Info "] -helptext [= "Visit OpenSees Wiki for more information"] -command $cmd -state normal -compound left] + image create photo wiki -format PNG -file [file join [OpenSees::GetProblemTypePath] img/Menu/mnu_Wiki.png] + set b [Button $PARENT.wikiinfo -image wiki -text [= " Element Info "] -helptext [= "Visit OpenSees Wiki for more information"] -command $cmd -state normal -compound left] grid $b -column 1 -row [expr $ROW+1] -sticky nw -pady 5 } } @@ -363,8 +366,8 @@ proc TK_MassWikiInfo { event args } { upvar [lindex $args 1] ROW set cmd "VisitWeb http://opensees.berkeley.edu/wiki/index.php/Mass_Command" - image create photo img -format PNG -file [file join [OpenSees::GetProblemTypePath] img/Menu/mnu_Wiki.png] - set b [Button $PARENT.wikiinfo -image img -text [= " More info "] -helptext [= "Visit OpenSees Wiki for more information"] -command $cmd -state normal -compound left] + image create photo wiki -format PNG -file [file join [OpenSees::GetProblemTypePath] img/Menu/mnu_Wiki.png] + set b [Button $PARENT.wikiinfo -image wiki -text [= " More info "] -helptext [= "Visit OpenSees Wiki for more information"] -command $cmd -state normal -compound left] grid $b -column 1 -row [expr $ROW+1] -sticky nw -pady 5 } } @@ -372,7 +375,7 @@ proc TK_MassWikiInfo { event args } { return "" } -proc TK_RigidDiaphragmWikiInfo { event args } { +proc TK_RigidDiaphragmWikiInfo { event args } { switch $event { @@ -382,8 +385,8 @@ proc TK_RigidDiaphragmWikiInfo { event args } { upvar [lindex $args 1] ROW set cmd "VisitWeb http://opensees.berkeley.edu/wiki/index.php/RigidDiaphragm_command" - image create photo img -format PNG -file [file join [OpenSees::GetProblemTypePath] img/Menu/mnu_Wiki.png] - set b [Button $PARENT.wikiinfo -image img -text [= " More Info "] -helptext [= "Visit OpenSees Wiki for more information"] -command $cmd -state normal -compound left] + image create photo wiki -format PNG -file [file join [OpenSees::GetProblemTypePath] img/Menu/mnu_Wiki.png] + set b [Button $PARENT.wikiinfo -image wiki -text [= " More Info "] -helptext [= "Visit OpenSees Wiki for more information"] -command $cmd -state normal -compound left] grid $b -column 1 -row [expr $ROW+1] -sticky nw -pady 5 } } @@ -401,8 +404,8 @@ proc TK_RigidLinkWikiInfo { event args } { upvar [lindex $args 1] ROW set cmd "http://opensees.berkeley.edu/wiki/index.php/RigidLink_command" - image create photo img -format PNG -file [file join [OpenSees::GetProblemTypePath] img/Menu/mnu_Wiki.png] - set b [Button $PARENT.wikiinfo -image img -text [= " More Info "] -helptext [= "Visit OpenSees Wiki for more information"] -command $cmd -state normal -compound left] + image create photo wiki -format PNG -file [file join [OpenSees::GetProblemTypePath] img/Menu/mnu_Wiki.png] + set b [Button $PARENT.wikiinfo -image wiki -text [= " More Info "] -helptext [= "Visit OpenSees Wiki for more information"] -command $cmd -state normal -compound left] grid $b -column 1 -row [expr $ROW+1] -sticky nw -pady 5 } } @@ -420,8 +423,8 @@ proc TK_EqualDOFWikiInfo { event args } { upvar [lindex $args 1] ROW set cmd "VisitWeb http://opensees.berkeley.edu/wiki/index.php/EqualDOF_command" - image create photo img -format PNG -file [file join [OpenSees::GetProblemTypePath] img/Menu/mnu_Wiki.png] - set b [Button $PARENT.wikiinfo -image img -text [= " More info "] -helptext [= "Visit OpenSees Wiki for more information"] -command $cmd -state normal -compound left] + image create photo wiki -format PNG -file [file join [OpenSees::GetProblemTypePath] img/Menu/mnu_Wiki.png] + set b [Button $PARENT.wikiinfo -image wiki -text [= " More info "] -helptext [= "Visit OpenSees Wiki for more information"] -command $cmd -state normal -compound left] grid $b -column 1 -row [expr $ROW+3] -sticky nw -pady 5 } } @@ -439,8 +442,8 @@ proc TK_LineLoadsWikiInfo { event args } { upvar [lindex $args 1] ROW set cmd "VisitWeb http://opensees.berkeley.edu/wiki/index.php/EleLoad_Command" - image create photo img -format PNG -file [file join [OpenSees::GetProblemTypePath] img/Menu/mnu_Wiki.png] - set b [Button $PARENT.wikiinfo -image img -text [= " More Info "] -helptext [= "Visit OpenSees Wiki for more information"] -command $cmd -state normal -compound left] + image create photo wiki -format PNG -file [file join [OpenSees::GetProblemTypePath] img/Menu/mnu_Wiki.png] + set b [Button $PARENT.wikiinfo -image wiki -text [= " More Info "] -helptext [= "Visit OpenSees Wiki for more information"] -command $cmd -state normal -compound left] grid $b -column 1 -row [expr $ROW] -sticky nw -pady 5 } } @@ -458,8 +461,8 @@ proc TK_LoadsWikiInfo { event args } { upvar [lindex $args 1] ROW set cmd "VisitWeb http://opensees.berkeley.edu/wiki/index.php/NodalLoad_Command" - image create photo img -format PNG -file [file join [OpenSees::GetProblemTypePath] img/Menu/mnu_Wiki.png] - set b [Button $PARENT.wikiinfo -image img -text [= " More info "] -helptext [= "Visit OpenSees Wiki for more information"] -command $cmd -state normal -compound left] + image create photo wiki -format PNG -file [file join [OpenSees::GetProblemTypePath] img/Menu/mnu_Wiki.png] + set b [Button $PARENT.wikiinfo -image wiki -text [= " More info "] -helptext [= "Visit OpenSees Wiki for more information"] -command $cmd -state normal -compound left] grid $b -column 1 -row [expr $ROW] -sticky nw -pady 5 } } @@ -477,8 +480,8 @@ proc TK_DisplacementsWikiInfo { event args } { upvar [lindex $args 1] ROW set cmd "VisitWeb http://opensees.berkeley.edu/wiki/index.php/Sp_Command" - image create photo img -format PNG -file [file join [OpenSees::GetProblemTypePath] img/Menu/mnu_Wiki.png] - set b [Button $PARENT.wikiinfo -image img -text [= " More info "] -helptext [= "Visit OpenSees Wiki for more information"] -command $cmd -state normal -compound left] + image create photo wiki -format PNG -file [file join [OpenSees::GetProblemTypePath] img/Menu/mnu_Wiki.png] + set b [Button $PARENT.wikiinfo -image wiki -text [= " More info "] -helptext [= "Visit OpenSees Wiki for more information"] -command $cmd -state normal -compound left] grid $b -column 1 -row [expr $ROW] -sticky nw -pady 5 } } @@ -496,8 +499,8 @@ proc TK_RestraintsWikiInfo { event args } { upvar [lindex $args 1] ROW set cmd "VisitWeb http://opensees.berkeley.edu/wiki/index.php/Fix_command" - image create photo img -format PNG -file [file join [OpenSees::GetProblemTypePath] img/Menu/mnu_Wiki.png] - set b [Button $PARENT.wikiinfo -image img -text [= " More info "] -helptext [= "Visit OpenSees Wiki for more information"] -command $cmd -state normal -compound left] + image create photo wiki -format PNG -file [file join [OpenSees::GetProblemTypePath] img/Menu/mnu_Wiki.png] + set b [Button $PARENT.wikiinfo -image wiki -text [= " More info "] -helptext [= "Visit OpenSees Wiki for more information"] -command $cmd -state normal -compound left] grid $b -column 1 -row [expr $ROW+2] -sticky nw -pady 5 } } @@ -515,8 +518,8 @@ proc TK_AnalWikiInfo { event args } { upvar [lindex $args 1] ROW set cmd "VisitWeb http://opensees.berkeley.edu/wiki/index.php/Analysis_Commands" - image create photo img -format PNG -file [file join [OpenSees::GetProblemTypePath] img/Menu/mnu_Wiki.png] - set b [Button $PARENT.wikiinfo -image img -text [= " Analysis info "] -helptext [= "Visit OpenSees Wiki for more information"] -command $cmd -state normal -compound left] + image create photo wiki -format PNG -file [file join [OpenSees::GetProblemTypePath] img/Menu/mnu_Wiki.png] + set b [Button $PARENT.wikiinfo -image wiki -text [= " Analysis info "] -helptext [= "Visit OpenSees Wiki for more information"] -command $cmd -state normal -compound left] grid $b -column 1 -row [expr $ROW+2] -sticky nw -pady 5 } @@ -530,13 +533,13 @@ proc TK_RegionWikiInfo { event args } { switch $event { INIT { - + set PARENT [lindex $args 0] upvar [lindex $args 1] ROW set cmd "VisitWeb http://opensees.berkeley.edu/wiki/index.php/Region_Command" - image create photo img -format PNG -file [file join [OpenSees::GetProblemTypePath] img/Menu/mnu_Wiki.png] - set b [Button $PARENT.wikiinfo -image img -text [= " More info "] -helptext [= "Visit OpenSees Wiki for more information"] -command $cmd -state normal -compound left] + image create photo wiki -format PNG -file [file join [OpenSees::GetProblemTypePath] img/Menu/mnu_Wiki.png] + set b [Button $PARENT.wikiinfo -image wiki -text [= " More info "] -helptext [= "Visit OpenSees Wiki for more information"] -command $cmd -state normal -compound left] grid $b -column 1 -row [expr $ROW+2] -sticky nw -pady 5 } } @@ -642,7 +645,7 @@ proc TK_PMY-ID { event args } { } SYNC { - + lassign $args GDN STRUCT QUESTION set ChosenMaterial [DWLocalGetValue $GDN $STRUCT "Material"] set MatType [GiD_AccessValue get materials $ChosenMaterial "Material:"] @@ -659,3 +662,23 @@ proc TK_PMY-ID { event args } { return "" } + +proc TK_LocalAxesInfo { event args } { + + switch $event { + + INIT { + + set PARENT [lindex $args 0] + upvar [lindex $args 1] ROW + + set cmd {WarnWinText "LOCAL AXES INFO\n\nThe local-x longitudinal axis is always specified by the positive element direction\n(View -> Normals -> Lines)\n\nIN A 2D PROBLEM :\n\nLocal-x axis coincides with the element positive direction\nLocal-z axis coincides with the global Z axis direction\nLocal-y axis is found by the right hand rule\n\nIN A 3D PROBLEM :\n\nVERTICAL axis is user-specified (Y or Z) in Modeling Options\n\nFor a horizontal element :\nLocal-x axis coincides with the element positive direction\nLocal-z coincides with the direction of the defined VERTICAL axis (global Y or Z)\nLocal-y axis is found by the right hand rule\n\nFor a vertical element :\nLocal-x axis coincides with the element positive direction\nLocal-z positive direction coincides with the global X axis negative direction\nLocal-y axis is found by the right hand rule\n\nFor an oblique element :\nVector Vecxz has the direction of the defined VERTICAL axis (global Y or Z)\nLocal-x axis direction (Vx) coincides with the element positive direction\nLocal-y axis direction (Vy) is found by the cross product Vy = Vecxz x Vx\nLocal-z axis direction (Vz) is found by the cross product Vz = Vx x Vy" "Local axes info"} + image create photo axes -format PNG -file [file join [OpenSees::GetProblemTypePath] img/Menu/btn_Axes.png] + set b [Button $PARENT.axesinfo -image axes -text [= " Local axes info "] -helptext [= "Display local axes information"] -command $cmd -state normal -compound left] + + grid $b -column 1 -row [expr $ROW] -sticky nw -pady 5 + } + } + + return "" +} diff --git a/tcl/ZeroLength.tcl b/tcl/ZeroLength.tcl index 30dffb4..94bceea 100644 --- a/tcl/ZeroLength.tcl +++ b/tcl/ZeroLength.tcl @@ -82,6 +82,7 @@ proc ZeroLength::CheckFieldValues { event args } { CLOSE { UpdateInfoBar + } }