The load is applied using a very simple command:
pattern UniformExcitation 1 1 -accel $Timeseries_1;
This command creates a UniformExcitation object with tag 1, which applies to all the nodes in direction 1(x), an acceleration pattern (-accel) defined by the value of the parameter $Timeseries_1. If one defines more than one objects of this type, the results would be superimposed. The output of this analysis would be relative relative to the displacement of these nodes (i.e. the nodes fixed in direction 1 will have as output zero accelerations).
The analysis objects need to be defined:
set gamma 0.65
# create the SOE, ConstraintHandler, Integrator, Algorithm and Numberer
integrator Newmark $gamma [expr pow($gamma+0.5, 2)/4] 0.00 0.0 0.0002 0.0
constraints Transformation
algorithm Newton
numberer RCM
system ProfileSPD
analysis Transient
The above command creates a Newmark integrator with gamma=0.65, which adds some minor numerical damping. Also, some minor Rayleigh damping is added. This is a good compromise between accuracy and numerical stability for this part of the analysis. The rest of the analysis is kept the same with the gravity analysis.
During the analysis recorder objects are used to track pore pressures, effective stresses, accelerations, and displacements.
set r_1 [recorder Node -file output_disp_11.txt -nodeRange 1 4204 -time -dT 0.05 -dof 1 2 disp]
set r_2 [recorder Node -file output_accel_11.txt -nodeRange 1 4204 -time -dT 0.05 -dof 1 2 accel]
set r_3 [recorder Node -file output_pore_11.txt -nodeRange 1 4204 -time -dT 0.05 -dof 3 vel]
set r_4 [recorder Element -file stress_1_11.txt -time -dT 0.05 -eleRange 1 3932 material 1 stress]
set r_8 [recorder Element -file strain_1_11.txt -time -dT 0.05 -eleRange 1 3932 material 1 strain]
In the above code, five types of recorders are illustrated, the displacement, the acceleration, the pore pressure, the stress, and the strain recorders. We note that the strain and stress values are extracted from the material class, so different implementations of materials might not include these recorders. Parameters r_1, r_2, r_3, r_4 have handles to the created recorder objects.
Later in the analysis we can conveniently destroy the recorders:
remove recorder $r_1
The above command destroys the recorder object with tag the value of the parameter r_1. This is done to store different parts of the analysis to different output files.
Next, a sample of the code that allows for control on the incrementation of the solution procedure is presented:
set ok 0
set currentTime 0.0
set i_extr_nl 0.0
set dt 0.005
set i_suc 0
set disp_incr 1.0e-5
set iter 30
algorithm Newton
while {$currentTime < 13.} {
test EnergyIncr $disp_incr $iter 2;
set ok [analyze 1 $dt]
set currentTime [getTime]
puts "$ok dt=$dt Disp_incr=$disp_incr #Iter=$iter"
if {$ok ==0} {
set i_suc [expr $i_suc+1]
if {$disp_incr>1e-3} {
set i_extr_nl [expr $i_extr_nl+1]
}
if {$i_suc>10} {
set disp_incr [expr $disp_incr/2]
if {$disp_incr<1e-6} {
set disp_incr 1e-6
}
if {$dt<0.0005} {
set iter 30
}
}
if {$i_suc>20} {
set dt [expr $dt*2]
if {$dt>0.05} {
set dt 0.05
}
}
}
if {$ok !=0} {
set dt [expr $dt/2]
if {$i_suc==0} {
set disp_incr [expr $disp_incr*2]
if {$disp_incr>0.005} {
set disp_incr 0.005
}
}
if {$dt<0.0005} {
set iter 200
}
set i_suc 0
}
}
In the above algorithm we try to evaluate a step using an initial time-step. In case of non-convergence the algorithm changes the convergence criteria and the time-step so that the analysis converges. In case of convergence, the algorithm increases the time-step and tightens the convergence criteria up to some pre-specified limits. This part of the code should always be tailored according to accuracy and speed needs of every analysis.