• R/O
  • SSH

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisão7daa2efe2a234e86ad0fef57281ddceed76ef937 (tree)
Hora2008-06-18 00:04:52
Autoriselllo
Commiteriselllo

Mensagem de Log

I modified test_interaction.tcl by
1)introducing the possibility of initializing the random number generator: I do not need to read the particle positions from an input file any
longer
2)I moved all the input parameters towards the beginning of the file.
3)while ramping up the potential, the code was also calculating the minimum distance separation; this is very time-consuming and useless, so I
removed it.

Mudança Sumário

Diff

diff -r ac99cb2923fb -r 7daa2efe2a23 TCL-codes/test_interaction.tcl
--- a/TCL-codes/test_interaction.tcl Tue Jun 17 14:11:31 2008 +0000
+++ b/TCL-codes/test_interaction.tcl Tue Jun 17 15:04:52 2008 +0000
@@ -1,4 +1,4 @@
1-set n_part 5000; #set density 0.00002
1+set n_part 50; #set density 0.00002
22 #set box_l [expr pow($n_part/$density,1./3.)]
33
44 #set box_l 36.
@@ -14,15 +14,68 @@
1414
1515 puts "the density is, $density"
1616
17-set box_l [expr pow($n_part/$density,1./3.)]
18-set volume [expr pow($box_l,3.)]
17+
18+set tot_time 300.
19+
20+
21+set my_step 0.00125
22+
23+
24+
25+# number of configurations I want to save
26+
27+set N_save 150
28+
29+
30+#initialization random seed
31+
32+set random_ini 200
33+
34+
35+#End of the primary parameters of the simulation
36+
37+##########################################################################################
38+##########################################################################################
39+##########################################################################################
40+##########################################################################################
41+##########################################################################################
1942
2043
2144
2245
23-set magnification 1.
2446
25-setmd box_l [expr $magnification*$box_l] [expr $magnification*$box_l] [expr $magnification*$box_l]
47+set box_l [expr pow($n_part/$density,1./3.)]
48+set volume [expr pow($box_l,3.)]
49+
50+set N_step [expr $tot_time/$my_step]
51+
52+set N_step [expr round($N_step)]
53+
54+
55+set integ_steps 1
56+
57+#I save a configuration every time steps
58+
59+set every [expr $N_step/$N_save]
60+
61+puts "every is, $every"
62+
63+
64+
65+puts "the total number of time steps is, $N_step"
66+
67+
68+
69+
70+
71+# set magnification 1.
72+
73+# setmd box_l [expr $magnification*$box_l] [expr $magnification*$box_l] [expr $magnification*$box_l]
74+
75+
76+setmd box_l $box_l $box_l $box_l
77+
78+
2679 setmd periodic 1 1 1
2780
2881 puts "the box side is, $box_l"
@@ -36,10 +89,10 @@
3689
3790
3891
39-set filename "ini_pos_table.dat"
40-set fp [open $filename "r"]
41-set data [split [read $fp [file size $filename]] "\n"]
42-close $fp
92+# set filename "ini_pos_table.dat"
93+# set fp [open $filename "r"]
94+# set data [split [read $fp [file size $filename]] "\n"]
95+# close $fp
4396
4497
4598
@@ -53,10 +106,31 @@
53106 # part $i pos $posx $posy $posz q $q type $type
54107 # }
55108
56-set pos_part {}
109+
110+
111+#The bits above are no longer necessary: I can now initialize the random number generator with a different seed to make sure
112+#I can run independent simulations
113+
114+
115+
116+
117+
118+#Initialization of the random number generator
119+
120+#initialization random numbers
121+
122+expr srand($random_ini)
123+set l ""; for {set i 0} {$i < [setmd n_nodes]} {incr i} {
124+ lappend l [expr int(32768*rand())]
125+}
126+eval t_random seed $l
127+
128+
129+
130+#set pos_part {} #I no longer need this variable since I am no longer reading the particle positions from an input file
57131
58132 for {set i 0} { $i < $n_part } {incr i} {
59-set p [lindex $data $i]
133+#set p [lindex $data $i]
60134 #puts "p is, $p"
61135 #set p2 [expr $box_l*$p]
62136 #puts "p2 is, $p2"
@@ -64,13 +138,19 @@
64138 #puts "pos_part[1] is, $pos_part(1)"
65139
66140
67-set posx [lindex $p 0 ]
68-set posy [lindex $p 1 ]
69-set posz [lindex $p 2 ]
141+# set posx [lindex $p 0 ]
142+# set posy [lindex $p 1 ]
143+# set posz [lindex $p 2 ]
70144
71-set posx [expr $posx*$box_l]
72-set posy [expr $posy*$box_l]
73-set posz [expr $posz*$box_l]
145+# set posx [expr $posx*$box_l]
146+# set posy [expr $posy*$box_l]
147+# set posz [expr $posz*$box_l]
148+
149+set posx [expr $box_l*[t_random]]
150+set posy [expr $box_l*[t_random]]
151+set posz [expr $box_l*[t_random]]
152+
153+
74154
75155 puts "posz is, $posz"
76156
@@ -89,31 +169,8 @@
89169
90170
91171
92-set tot_time 3000.
93-
94-
95-set my_step 0.00125
96-
97-
98-set N_step [expr $tot_time/$my_step]
99-
100-set N_step [expr round($N_step)]
101172
102173
103-set integ_steps 1
104-
105-# number of configurations I want to save
106-
107-set N_save 1500
108-#I save a configuration every time steps
109-
110-set every [expr $N_step/$N_save]
111-
112-puts "every is, $every"
113-
114-
115-
116-puts "the total number of time steps is, $N_step"
117174
118175
119176 setmd time_step $my_step; setmd skin 0.4
@@ -176,11 +233,11 @@
176233
177234 set cap [expr $cap + $lin_coeff*$delta_t ]
178235
179-set min [analyze mindist]
236+#set min [analyze mindist]
180237
181238 }
182239
183-puts "Warmup finished. Minimal distance now $min"
240+#puts "Warmup finished. Minimal distance now $min"
184241
185242
186243 analyze set chains 0 1 $n_part