~ubuntu-branches/debian/sid/lammps/sid

« back to all changes in this revision

Viewing changes to tools/moltemplate/src/nbody_reorder_atoms.py

  • Committer: Package Import Robot
  • Author(s): Anton Gladky
  • Date: 2015-04-29 23:44:49 UTC
  • mfrom: (5.1.3 experimental)
  • Revision ID: package-import@ubuntu.com-20150429234449-mbhy9utku6hp6oq8
Tags: 0~20150313.gitfa668e1-1
Upload into unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
 
19
19
section_name = ''
20
 
if len(sys.argv) == 2:
 
20
if len(sys.argv) == 3:
21
21
    section_name = sys.argv[1]
 
22
    module_name = sys.argv[2].rstrip('.py')
22
23
else:
23
24
    sys.stderr.write('Usage Example:\n\n'
24
 
                     '      '+g_program_name+' Angles < angles.txt > new_angles.txt\n\n'
 
25
                     '      '+g_program_name+' Angles nbody_angles.py < angles.txt > new_angles.txt\n\n'
25
26
                     '      In this example \"angles.txt\" contains only the \"Angles\" section of\n'
26
27
                     '      a LAMMPS DATA file.  (Either a text-editor, or the \n'
27
28
                     '      \"extract_lammps_data.py\" script can be used to select a section from\n'
31
32
    exit(-1)
32
33
 
33
34
# Ordering rules are defined in a seperate module named
34
 
# nbody_Angles.py, nbody_Dihedrals.py, nbody_Impropers.py
 
35
# nbody_angles.py, nbody_dihedrals.py, nbody_impropers.py
35
36
# Load that now.
36
37
 
37
 
module_name = 'nbody_'+section_name
38
38
g = __import__(module_name)  #defines g.bond_pattern, g.canonical_order
39
39
 
40
40
# This module defines the graph representing the bond pattern for this type