This file is indexed.

/usr/share/elmerpost/tcl/particle.tcl is in elmer-common 6.1.0.svn.5396.dfsg-2ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
#/*****************************************************************************
# *
# *  Elmer, A Finite Element Software for Multiphysical Problems
# *
# *  Copyright 1st April 1995 - , CSC - IT Center for Science Ltd., Finland
# * 
# *  This program is free software; you can redistribute it and/or
# *  modify it under the terms of the GNU General Public License
# *  as published by the Free Software Foundation; either version 2
# *  of the License, or (at your option) any later version.
# * 
# *  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
# *  GNU General Public License for more details.
# *
# *  You should have received a copy of the GNU General Public License
# *  along with this program (in file fem/GPL-2); if not, write to the 
# *  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 
# *  Boston, MA 02110-1301, USA.
# *
# *****************************************************************************/

#*******************************************************************************
#*
#* Particles display parameter settings
#*
#*******************************************************************************
#*
#*                     Author:       Juha Ruokolainen
#*
#*                    Address: CSC - IT Center for Science Ltd.
#*                                Keilaranta 14, P.O. BOX 405
#*                                  02101 Espoo, Finland
#*                                  Tel. +358 0 457 2723
#*                                Telefax: +358 0 457 2302
#*                              EMail: Juha.Ruokolainen@csc.fi
#*
#*                       Date: 26 Sep 1995
#*
#*                Modified by:
#*
#*       Date of modification:
#*
#*******************************************************************************
#
#

#
# 23 Apr 1996
#

set ParticleNofParticles      0
set ParticleLineStyle         0
set ParticleArrowStyle        0
set ParticleQuality           1
set ParticleRadius            1
set ParticleColor             "none"
set ParticleVelocity          "none"
set ParticleParticle          "none"
set ParticleOutDT             1.0E-1
set ParticleMaxDT             1.0E-3
set ParticleTolerance         1.0E-5
set ParticleIntegMethod       1
set ParticleIntegPolicy       1
set ParticleStyle             0

set ParticleVariableNames(0)  "none"
set NumberOfParticleVariables 0

set particle "none"

proc get_particle_variable { w } {
    global particle

    set particle [$w get [$w curselection]]
}

#
# List box containing particle variable names
#
proc make_particle_list { } {
   global ParticleVariableNames NumberOfParticleVariables particle saveparticle

   if { ![info exists ParticleVariableNames] } { return }

   set saveparticle $particle

   toplevel .vlist
   place_window .vlist

   frame .vlist.vari -relief sunken -bg lightblue
   listbox .vlist.vari.list -yscroll ".vlist.vari.scroll set"
   scrollbar .vlist.vari.scroll -command ".vlist.vari.list yview"

   pack .vlist.vari.list -side left -fill y
   pack .vlist.vari.scroll -side left -expand 1 -fill both
   pack .vlist.vari -side top -expand 1 -fill both

   bind .vlist.vari.list <Double-1> { set particle [get_particle_variable %W] }

   frame .vlist.equ
   label .vlist.equ.label -text "math: "
   entry .vlist.equ.entry -width 20 -relief sunken -textvariable mathcmd
   pack .vlist.equ -side top
   pack .vlist.equ.label -side left
   pack .vlist.equ.entry -side left -fill x

   bind .vlist.equ.entry <Return> { math $mathcmd; set particle "tryagain"; }

   frame .vlist.close
   button .vlist.close.ok  -text  "OK" -command { set particle [get_particle_variable .vlist.vari.list]  }
   button .vlist.close.cancel -text  "Cancel" -command { set particle $saveparticle; }

   pack .vlist.close -side top
   pack .vlist.close.ok -side right
   pack .vlist.close.cancel -side right

   set oldfocus [focus]
   set particle "tryagain"
   while { $particle == "tryagain" } {
       .vlist.vari.list delete 0 end

       .vlist.vari.list insert end none
       do i 0 [@ $NumberOfParticleVariables-1] {
           set val $ParticleVariableNames($i)
           .vlist.vari.list insert end $val
       }

       vwait particle
   }
   focus $oldfocus
   destroy .vlist

   return $particle
}


proc particle_edit { } {

    global ParticleLineStyle ParticleQuality ParticleRadius ParticleStyle
    global ParticleOutDT ParticleMaxDT  ParticleTolerance ParticleArrowStyle
    global ParticleColor ParticleVelocity ParticleParticle ParticleIntegMethod
    global ParticlePolicy

    if { [winfo exists .particle] } {
        wm iconify .particle
        wm deiconify .particle
        return
    }

    toplevel .particle
    place_window .particle

#
# style
#
    frame .particle.style
    label .particle.style.lab -text "Particle Style: "
    radiobutton .particle.style.vec -value 0 -variable ParticleStyle -text "Arrow"
    radiobutton .particle.style.sph -value 1 -variable ParticleStyle -text "Sphere"

    pack .particle.style -side top
    pack .particle.style.lab -side left
    pack .particle.style.vec -side left  -fill x
    pack .particle.style.sph -side left -fill x

#
# line style
#
    frame .particle.line
    label .particle.line.label -text "Display Style: "
    radiobutton .particle.line.line -value 0 -variable ParticleLineStyle -text "Line"
    radiobutton .particle.line.cyli -value 1 -variable ParticleLineStyle -text "Solid"

    pack .particle.line -side top
    pack .particle.line.label -side left
    pack .particle.line.line -side left -fill x
    pack .particle.line.cyli -side left  -fill x
#
# arrow style
#
    frame .particle.arrow
    label .particle.arrow.label -text "Arrow Style: "
    radiobutton .particle.arrow.stick -value 0 -variable ParticleArrowStyle -text "Stick"
    radiobutton .particle.arrow.arrow -value 1 -variable ParticleArrowStyle -text "Arrow"

    pack .particle.arrow -side top
    pack .particle.arrow.label -side left
    pack .particle.arrow.stick -side left  -fill x
    pack .particle.arrow.arrow -side left -fill x

#
# disp qual
#
    frame .particle.qual
    label .particle.qual.label -text "Display Quality: "
    entry .particle.qual.entry -relief sunken -width 5 -textvariable ParticleQuality

    pack .particle.qual -side top
    pack .particle.qual.label -side left
    pack .particle.qual.entry -side left -fill x

#
# Display scale
#
    frame .particle.radi
    label .particle.radi.label -text "Display Scale: "
    entry .particle.radi.entry -relief sunken -width 5 -textvariable ParticleRadius

    pack .particle.radi -side top
    pack .particle.radi.label -side left
    pack .particle.radi.entry -side left -fill x

#
# color
#
    frame .particle.color
    label .particle.color.label -text "Color Variable: "
    button .particle.color.but -textvariable ParticleColor \
           -command { set ParticleColor [make_scalar_list]; UpdateVariable "ParticleColor" }
    UpdateVariable "ParticleColor"

    pack .particle.color -side top
    pack .particle.color.label -side left
    pack .particle.color.but -side left -fill x

#
# velocity
#
    frame .particle.velocity
    label .particle.velocity.label -text "Velocity Variable: "
    button .particle.velocity.but -textvariable ParticleVelocity \
               -command { set ParticleVelocity [make_vector_list]; }

    pack .particle.velocity -side top
    pack .particle.velocity.label -side left
    pack .particle.velocity.but -side left -fill x

#
# particle
#
    frame .particle.particle
    label .particle.particle.label -text "Particle Variable: "
    button .particle.particle.but -textvariable ParticleParticle \
               -command { set ParticleParticle [make_particle_list]; }

    pack .particle.particle -side top
    pack .particle.particle.label -side left
    pack .particle.particle.but -side left -fill x
#
# space
#
    frame .particle.space0
    label .particle.space0.lab -text " "

    pack .particle.space0 -side top
    pack .particle.space0.lab -side left

#
# integ method
#
    frame .particle.integ
    label .particle.integ.label -text "Integration Method: "
    radiobutton .particle.integ.euler -value 0 -variable ParticleIntegMethod -text "Euler"
    radiobutton .particle.integ.runge -value 1 -variable ParticleIntegMethod -text "Runge Kutta"

    pack .particle.integ -side top
    pack .particle.integ.label -side left
    pack .particle.integ.euler -side left -fill x
    pack .particle.integ.runge -side left  -fill x
#
# integ policy
#
    frame .particle.policy
    label .particle.policy.label -text "Integration Policy: "
    radiobutton .particle.policy.fixed -value 0 -variable ParticleIntegPolicy -text "Fixed"
    radiobutton .particle.policy.adapt -value 1 -variable ParticleIntegPolicy -text "Adaptive"

    pack .particle.policy -side top
    pack .particle.policy.label -side left
    pack .particle.policy.fixed -side left -fill x
    pack .particle.policy.adapt -side left  -fill x
#
# output timestep
#
    frame .particle.time
    label .particle.time.timelab -text "Output timestep: "
    entry .particle.time.timeent -relief sunken -width 7 -textvariable ParticleOutDT

    pack .particle.time -side top
    pack .particle.time.timelab -side left
    pack .particle.time.timeent -side left -fill x

#
# max timestep
#
    label .particle.time.maxdtlab -text "Maximum timestep: "
    entry .particle.time.maxdtent -relief sunken -width 7 -textvariable ParticleMaxDT

    pack .particle.time.maxdtlab -side left
    pack .particle.time.maxdtent -side left -fill x

#
# tolerance
#
    frame .particle.err
    label .particle.err.tolelab -text "Absolute error: "
    entry .particle.err.toleent -relief sunken -width 7 -textvariable ParticleTolerance

    pack .particle.err -side top
    pack .particle.err.tolelab -side left
    pack .particle.err.toleent -side left -fill x
#
# space
#
    frame .particle.space1
    label .particle.space1.lab -text " "

    pack .particle.space1 -side top
    pack .particle.space1.lab -side left

#
# advance / close & apply
#
    frame .particle.buttons
    button .particle.buttons.advance -text "Advance" -command "pintegrate"
    button .particle.buttons.apply -text "Apply" -command "UpdateObject; play"
    button .particle.buttons.close -text "Close" -command "destroy .particle"

    pack .particle.buttons -side top
    pack .particle.buttons.advance -side left
    pack .particle.buttons.apply -side left
    pack .particle.buttons.close -side left -fill x
}

proc pintegrate { } {
    global ParticleAdvance;

    set ParticleAdvance 1
    UpdateObject

    play
}