File: bs.awk

package info (click to toggle)
espresso 6.7-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 311,068 kB
  • sloc: f90: 447,429; ansic: 52,566; sh: 40,631; xml: 37,561; tcl: 20,077; lisp: 5,923; makefile: 4,503; python: 4,379; perl: 1,219; cpp: 761; fortran: 618; java: 568; awk: 128
file content (54 lines) | stat: -rw-r--r-- 2,036 bytes parent folder | download | duplicates (3)
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
BEGIN {nr=0; nrs=0; nat=0; nstep=0; 
       print "* XBS file created by pawk.bs "; print "";

print ""
print "* the following are AUXILIARY lines defining the bonds as "
print "* bonds spec1 spec2 dmin dmax bondthickness grayscale (white==1.0)"
print "* "
print "* bonds S H 0.1 0.6  0.0500     1.0"
print ""

       }
{ if ($3=="atoms/cell" && nr==0) {nat=$5};
  if ($1=="lattice" && $2=="parameter" && nr==0 ) {alat= $5*0.52917720859}
  if ($1=="a(1)" && nr==0) \
                 {print"* it might be useful to duplicate as follows" ;
                  print "* dup ",$4*alat,$5*alat,$6*alat}
  if ($1=="a(2)" && nr==0) {print "* dup ",$4*alat,$5*alat,$6*alat}
  if ($1=="a(3)" && nr==0) {print "* dup ",$4*alat,$5*alat,$6*alat;
                            print " "}
  if ($1=="atomic" && $2=="species" && nrs==0 ) \
     {nrs=NR+nat+1
      print "* the following are MANDATORY lines defining the atomic species as"
      print "* spec  name   radius grayscale (white==1.0) "
      print "* "}
  if (NR<=nrs) {if (NF==0) {print ""; nrs=-1}
                if (NF>0 && $1!="atomic") \
                   printf ( "spec %2s %6.2f %4.2f \n", \
                            $1, 0.4, 1.0/$2 ) }
  if ($1=="site" && nr==0 ) \
     {nr=NR
      print "* the following are MANDATORY lines defining the atomic positions"
      print "* atom  name  x y z  dummyinteger"
      print "* "}
  if (NR-nr>0 && NR-nr<=nat && nr>0) \
     printf ( "atom %2s %10.7f %10.7f %10.7f %3d \n", \
                    $2,  $(NF-3)*alat, $(NF-2)*alat, $(NF-1)*alat, $1) 
 }
END{
print ""
#print "* the following are AUXILIARY lines defining the bonds as "
#print "* bonds spec1 spec2 dmin dmax bondthickness grayscale (white==1.0)"
#print "* "
#print "* bonds S H 0.1 0.6  0.0500     1.0"
print ""
print "tmat  0.000  1.000  0.000 0.000  0.000  1.000 1.000  0.000  0.000"
print ""
print "dist    50.000"
print "inc      1.000"
print "scale   50.000"
print "rfac 1.00"
print "bfac 1.00"
print "pos    -10.000    -100.00"
print "switches 1 0 1 0 0 1 1 0 0"
}