/usr/share/xcrysden/Tcl/readParam.tcl is in xcrysden-data 1.5.53-1.
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 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 | #############################################################################
# Author: #
# ------ #
# Anton Kokalj Email: Tone.Kokalj@ijs.si #
# Department of Physical and Organic Chemistry Phone: x 386 1 477 3523 #
# Jozef Stefan Institute Fax: x 386 1 477 3811 #
# Jamova 39, SI-1000 Ljubljana #
# SLOVENIA #
# #
# Source: $XCRYSDEN_TOPDIR/Tcl/readParam.tcl
# ------ #
# Copyright (c) 1996-2003 by Anton Kokalj #
#############################################################################
proc read_param { w } {
global groupsel n_groupsel species inp class
# THIS PROC DETERMINE A CLASS OF SPECIES AND READ MINIMAL
# SET OF LATTICE VECTORS & ANGLES
# $w - name of parent's widget
# $species - type of species (polymer, slab, ..)
# n_groupsel - N. of selected group
# ----------------------------------------------
# DEFINITIONS of needed SET's of LATTICE VECTORS
# ----------------------------------------------
# CLASSES for whom only A is NEEDED: "A" class
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# Polymers: -all
# Slabs: -square
# -hexagonal
# Crystals: -cubic
# CLASSES for whom only A,B is NEEDED: "AB" class
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# Slabs: -rectangular
# CLASSES for whom only A,B,GAMMA is NEEDED: "AB_GAMMA" class
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# Slabs: -triclinic
# CLASSES for whom only A,C is NEEDED: "AC" class
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# Crystals: -hexagonal
# -rhombohedral-hexagonal
# -tetragonal
# CLASSES for whom only A,ALFA is NEEDED: "A_ALFA" class
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# Crystals: -rhombohedral-rhombohedral
# REMARK: the following classes can be handled either RHOMBO.,
# ------ either HEXA.: 146 R 3
# 148 R -3
# 155 R 3 2
# 160 R 3 M
# 161 R 3 C
# 166 R -3 M
# 167 R -3 C
# that is ALL groups that are R-centered
# CLASSES for whom only A,B,C is NEEDED: "ABC" class
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# Crystals: -orthorhombic
# CLASSES for whom only A,B,C,"angle" is NEEDED: "ABC_angle" class
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# Crystals: -monoclinic
# CLASSES for whom A,B,C,ALFA,BETA,GAMMA is NEEDED: "ABC_all"class
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# Crystals: -triclinic
frame $w.1
frame $w.2
pack $w.1 $w.2 -expand 1 -fill both
# all polymer are in "A" class
if { $species == "polymer" } {
Entries $w.1 A: inp(A) 10
set class A
}
# we must determine class's number
# if $species == (slab or crystal);
if { $species == "slab" } {
if { $n_groupsel < 8 } {
# TRICLINIC LATTICE
Entries $w.1 {A: B:} {inp(A) inp(B)} 10
Entries $w.2 GAMMA: inp(GAMMA) 10
set class {{A B} {GAMMA}}
}
if { $n_groupsel >= 8 && $n_groupsel < 49 } {
# RECTANGULAR LATTICE
Entries $w.1 {A: B:} {inp(A) inp(B)} 10
set class {{A B}}
}
if { $n_groupsel >= 49 && $n_groupsel < 65 } {
# SQUARE LATTICE
Entries $w.1 A: inp(A) 10
set class A
}
if { $n_groupsel >= 65 } {
# HEXAGONAL LATTICE
Entries $w.1 A: inp(A) 10
set class A
}
}
if { $species == "crystal" } {
if { $n_groupsel < 3 } {
# TRICLINIC LATTICE
Entries $w.1 {A: B: C:} {inp(A) inp(B) inp(C)} 10
Entries $w.2 {ALPHA: BETA: GAMMA:} \
{inp(ALFA) inp(BETA) inp(GAMMA)} 10
set class {{A B C} {ALFA BETA GAMMA}}
}
if { $n_groupsel >= 3 && $n_groupsel < 16 } {
# MONOCLINIC LATTICE
# WARNING: here are three options !!!!
# Entries $w.2 {ALFA: BETA: GAMMA:} {ALFA BETA GAMMA} 10
Entries $w.1 {A: B: C:} {inp(A) inp(B) inp(C)} 10
Entries $w.2 GAMMA: inp(GAMMA) 10
set class {{A B C} {GAMMA}}
}
if { $n_groupsel >= 16 && $n_groupsel < 75 } {
# ORTHOROMBIC LATTICE
Entries $w.1 {A: B: C:} {inp(A) inp(B) inp(C)} 10
set class {{A B C}}
}
if { $n_groupsel >= 75 && $n_groupsel < 143 } {
# TETRAGONAL LATTICE
Entries $w.1 {A: C:} {inp(A) inp(C)} 10
set class {{A C}}
}
# 143 -> 167 some TRIGONAL->HEXA, some TRIGONAL->RHOMBO.
# 168 -> 194 HEXAGONAL
if [info exist inp(IFHR)] {
if { $inp(IFHR) == 1 } {
# RHOMBOHEDRAL AXES
Entries $w.1 {A: ALPHA:} {inp(A) inp(ALFA)} 10
set class {{A} {ALFA}}
return
}
}
if { $n_groupsel >= 143 && $n_groupsel < 195 } {
# HEXAGONAL LATTICE & TRIGONAL WITH HEXA. AXES
Entries $w.1 {A: C:} {inp(A) inp(C)} 10
set class {{A C}}
}
if { $n_groupsel >= 195 } {
# CUBIC LATTICE
Entries $w.1 A: inp(A) 10
set class A
}
}
# set focus to the first entry
focus $w.1.frame.entry1
}
proc WhichPar2Read {input} {
global groupsel n_groupsel species \
inp class distext
#this procs READ&PRINT parameters in OPEN_FILE mode
set param [gets $input]
if { $species == "slab" } {
append distext "> UNIT CELL PARAMETERS - "
if { $n_groupsel < 8 } {
# TRICLINIC LATTICE
set inp(A) [lindex $param 0]
set inp(B) [lindex $param 1]
set inp(GAMMA) [lindex $param 2]
append distext "TRICLINIC LATTICE::\n"
append distext "A = $inp(A), B = $inp(B),\
\n GAMMA = $inp(GAMMA)\n\n"
}
if { $n_groupsel >= 8 && $n_groupsel < 49 } {
# RECTANGULAR LATTICE
set inp(A) [lindex $param 0]
set inp(B) [lindex $param 1]
append distext "RECTANGULAR LATTICE::\n"
append distext "A = $inp(A), B = $inp(B)\n\n"
}
if { $n_groupsel >= 49 && $n_groupsel < 65 } {
# SQUARE LATTICE
set inp(A) [lindex $param 0]
append distext "SQUARE LATTICE::\n"
append distext "A = $inp(A)\n\n"
}
if { $n_groupsel >= 65 } {
# HEXAGONAL LATTICE
set inp(A) [lindex $param 0]
append distext "HEXAGONAL LATTICE::\n"
append distext "A = $inp(A)\n\n"
}
}
if { $species == "crystal" } {
IsNotStandardGroup $groupsel
append distext "> CRYSTAL FAMILY : $inp(CRY_FAM)\n"
append distext "> CRYSTAL CLASS (GROTH - 1921): $inp(CRY_CLASS)\n\n"
append distext "> UNIT CELL PARAMETERS::\n"
if { $n_groupsel <= 230 && [xcNumber n_groupsel int] } {
if { $n_groupsel < 3 } {
# TRICLINIC LATTICE
set inp(A) [lindex $param 0]
set inp(B) [lindex $param 1]
set inp(C) [lindex $param 2]
set inp(ALFA) [lindex $param 3]
set inp(BETA) [lindex $param 4]
set inp(GAMMA) [lindex $param 5]
append distext "A = $inp(A), B = $inp(B), C = $inp(C),\n"
append distext "ALPHA = $inp(ALFA), BETA = $inp(BETA), \
GAMMA = $inp(GAMMA)\n\n"
}
if { $n_groupsel >= 3 && $n_groupsel < 16 } {
# MONOCLINIC LATTICE
# WARNING: here are three options !!!!
set inp(A) [lindex $param 0]
set inp(B) [lindex $param 1]
set inp(C) [lindex $param 2]
set inp(GAMMA) [lindex $param 3]
append distext "A = $inp(A), B = $inp(B), C = $inp(C),\n"
append distext "GAMMA = $inp(GAMMA)\n\n"
}
if { $n_groupsel >= 16 && $n_groupsel < 75 } {
# ORTHOROMBIC LATTICE
set inp(A) [lindex $param 0]
set inp(B) [lindex $param 1]
set inp(C) [lindex $param 2]
append distext "A = $inp(A), B = $inp(B), C = $inp(C),\n\n"
}
if { $n_groupsel >= 75 && $n_groupsel < 143 } {
# TETRAGONAL LATTICE
set inp(A) [lindex $param 0]
set inp(B) [lindex $param 1]
append distext "A = $inp(A), B = $inp(B)\n\n"
}
# 143 -> 167 some TRIGONAL->HEXA, some TRIGONAL->RHOMBO.
# 168 -> 194 HEXAGONAL
if { $n_groupsel >= 143 && $n_groupsel < 168 } {
# TRIGONAL LATTICE (either rhombo. either hexa. axes)
set inp(A) [lindex $param 0]
set rhombohexa "146 148 155 160 161 166 167"
foreach grp $rhombohexa {
if { $n_groupsel == $grp } {
# query for rhombo./hexa. axes
if { $inp(IFHR) == 1 } {
# RHOBOHEDRAL AXES!!!
set inp(ALFA) [lindex $param 1]
append distext "A = $inp(A), ALPHA = $inp(ALFA)\n\n"
return
}
}
}
# HEXAGONAL AXES!!!
set inp(C) [lindex $param 1]
append distext "A = $inp(A), C = $inp(C)\n\n"
}
if { $n_groupsel >= 168 && $n_groupsel < 195 } {
# HEXAGONAL LATTICE
set inp(A) [lindex $param 0]
set inp(C) [lindex $param 1]
append distext "A = $inp(A), C = $inp(C)\n\n"
}
if { $n_groupsel >= 195 } {
# CUBIC LATTICE
set inp(A) [lindex $param 0]
append distext "A = $inp(A)\n\n"
}
} else {
# do it according to class
set i 0
foreach grp $class {
foreach item $grp {
if { $item == "A" } {
set inp(A) [lindex $param $i]
append distext "A = $inp(A)"
incr i
}
if { $item == "B" } {
set inp(B) [lindex $param $i]
append distext ", B = $inp(B)"
incr i
}
if { $item == "C" } {
set inp(C) [lindex $param $i]
append distext ", C = $inp(C)"
incr i
}
if { $item == "ALFA" } {
set inp(ALFA) [lindex $param $i]
append distext ",\nALPHA = $inp(ALFA)"
incr i
}
if { $item == "BETA" } {
set inp(BETA) [lindex $param $i]
append distext ", BETA = $inp(BETA)"
incr i
}
if { $item == "GAMMA" } {
set inp(GAMMA) [lindex $param $i]
if { [info exists inp(ALFA)] || \
[info exists inp(BETA)] } {
append distext ", GAMMA = $inp(GAMMA)"
} else {
append distext "GAMMA = $inp(GAMMA)"
}
incr i
}
}
}
append distext "\n\n"
}
}
append distext "--------------------------------------------------\n\n"
}
proc WhichPar2Print {} {
global groupsel n_groupsel species \
inp class distext
#this procs PRINTS parameters in OPEN_FILE mode
if { $species == "slab" } {
append distext "> UNIT CELL PARAMETERS - "
if { $n_groupsel < 8 } {
# TRICLINIC LATTICE
append distext "TRICLINIC LATTICE::\n"
append distext "A = $inp(A), B = $inp(B),\
\n GAMMA = $inp(GAMMA)\n\n"
}
if { $n_groupsel >= 8 && $n_groupsel < 49 } {
# RECTANGULAR LATTICE
append distext "RECTANGULAR LATTICE::\n"
append distext "A = $inp(A), B = $inp(B)\n\n"
}
if { $n_groupsel >= 49 && $n_groupsel < 65 } {
# SQUARE LATTICE
append distext "SQUARE LATTICE::\n"
append distext "A = $inp(A)\n\n"
}
if { $n_groupsel >= 65 } {
# HEXAGONAL LATTICE
append distext "HEXAGONAL LATTICE::\n"
append distext "A = $inp(A)\n\n"
}
}
if { $species == "crystal" } {
IsNotStandardGroup $groupsel
append distext "> CRYSTAL FAMILY : $inp(CRY_FAM)\n"
append distext "> CRYSTAL CLASS (GROTH - 1921): $inp(CRY_CLASS)\n\n"
append distext "> UNIT CELL PARAMETERS::\n"
puts stdout "IGR:: $n_groupsel"
if { $n_groupsel <= 230 && [xcNumber n_groupsel int] } {
if { $n_groupsel < 3 } {
# TRICLINIC LATTICE
append distext "A = $inp(A), B = $inp(B), C = $inp(C),\n"
append distext "ALPHA = $inp(ALFA), BETA = $inp(BETA), \
GAMMA = $inp(GAMMA)\n\n"
}
if { $n_groupsel >= 3 && $n_groupsel < 16 } {
# MONOCLINIC LATTICE
# WARNING: here are three options !!!!
append distext "A = $inp(A), B = $inp(B), C = $inp(C),\n"
append distext "GAMMA = $inp(GAMMA)\n\n"
}
if { $n_groupsel >= 16 && $n_groupsel < 75 } {
# ORTHOROMBIC LATTICE
append distext "A = $inp(A), B = $inp(B), C = $inp(C),\n\n"
}
if { $n_groupsel >= 75 && $n_groupsel < 143 } {
# TETRAGONAL LATTICE
append distext "A = $inp(A), B = $inp(B)\n\n"
}
if { $n_groupsel >= 143 && $n_groupsel < 168 } {
# TRIGONAL LATTICE (either rhombo. either hexa. axes)
set rhombohexa "146 148 155 160 161 166 167"
foreach grp $rhombohexa {
if { $n_groupsel == $grp } {
# query for rhombo./hexa. axes
if { $inp(IFHR) == 1 } {
# RHOBOHEDRAL AXES!!!
append distext "A = $inp(A), ALPHA = $inp(ALFA)\n\n"
return
}
}
}
# HEXAGONAL AXES!!!
append distext "A = $inp(A), C = $inp(C)\n\n"
}
if { $n_groupsel >= 168 && $n_groupsel < 195 } {
# HEXAGONAL LATTICE
append distext "A = $inp(A), C = $inp(C)\n\n"
}
if { $n_groupsel >= 195 } {
# CUBIC LATTICE
append distext "A = $inp(A)\n\n"
}
} else {
# do it according to class
set i 0
foreach grp $class {
foreach item $grp {
puts stdout "WhichPar2Print:: ITEM> $item"
if { $item == "A" } {
append distext "A = $inp(A)"
incr i
}
if { $item == "B" } {
append distext ", B = $inp(B)"
incr i
}
if { $item == "C" } {
append distext ", C = $inp(C)"
incr i
}
if { $item == "ALFA" } {
append distext ",\nALPHA = $inp(ALFA)"
incr i
}
if { $item == "BETA" } {
append distext ", BETA = $inp(BETA)"
incr i
}
if { $item == "GAMMA" } {
if { [info exists inp(ALFA)] || \
[info exists inp(BETA)] } {
append distext ", GAMMA = $inp(GAMMA)"
} else {
append distext "GAMMA = $inp(GAMMA)"
}
incr i
}
}
}
append distext "\n\n"
}
}
append distext "--------------------------------------------------\n\n"
}
|