Commit f32819dd authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

added tweak to write out the command line used for the conversion to the...

added tweak to write out the command line used for the conversion to the beginning of the LAMMPS input
parent c07a01c6
Loading
Loading
Loading
Loading
+657 −650
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@
#    20161001   Added 'CMAP crossterms' section at the end of the data file
#    20161001   Added instructions in CMAP section to fix problem if 'ter'
#                 is not designated in the .pdb file to identify last amino acid
#    20161005   Added tweak to embed command line in generated LAMMPS input
#
#    General    Many thanks to Paul S. Crozier for checking script validity
#               against his projects.
@@ -85,7 +86,7 @@
    my $notes;

    $program            = "charmm2lammps";
    $version		= "1.9.0";
    $version            = "1.9.1";
    $year               = "2016";
    $add                = 1;
    $water_dens         = 0;
@@ -120,6 +121,9 @@
    $notes .= "      - project.in            suggested LAMMPS input script\n";
    $notes .= "      - project_ctrl.pdb      control file when requested\n";

    # record full command line for later use
    $cmdline = "$program.pl " . join(" ",@ARGV);

    foreach (@ARGV)
    {
      if (substr($_, 0, 1) eq "-")
@@ -1437,7 +1441,8 @@
  sub WriteLAMMPSInput
  {
    open(LAMMPS, ">$project.in");                       # input file
    printf(LAMMPS "# Created by $program v$version on %s\n", `date`);
    printf(LAMMPS "# Created by $program v$version on %s", `date`);
    printf(LAMMPS "# Command: %s\n\n", $cmdline);
    printf(LAMMPS "units           real\n");            # general
    printf(LAMMPS "neigh_modify    delay 2 every 1\n\n");
    printf(LAMMPS "atom_style      full\n");            # styles
@@ -1467,20 +1472,22 @@
      printf(LAMMPS "\n");
    }
    printf(LAMMPS "special_bonds   charmm\n");          # invoke charmm
    printf(LAMMPS "thermo          1\n");		# set thermo style
    printf(LAMMPS "thermo          10\n");              # set thermo style
    printf(LAMMPS "thermo_style    multi\n");
    printf(LAMMPS "timestep        0.5\n\n");		# 0.5 ps time step
    printf(LAMMPS "minimize 0.0 0.0 1000 10000\n\n");   # take off the edge
    printf(LAMMPS "timestep        1.0\n\n");           # 1.0 ps time step
    printf(LAMMPS "minimize 0.0 0.0 50 200\n\n");       # take of the edge
    printf(LAMMPS "reset_timestep  0\n");
    printf(LAMMPS "fix             1 all nve\n");
    printf(LAMMPS "fix             2 all shake 1e-6 500 0 m 1.0\n")
      if ($shake eq "");                                # shake all H-bonds
    printf(LAMMPS "fix             2 all shake 1e-6 500 0 m 1.0 a %s\n",$shake)
      if ($shake ne "");                                # add water if present
    printf(LAMMPS "velocity        all create 0.0 12345678 dist uniform\n\n");
    printf(LAMMPS "restart         10 $project.restart1 $project.restart2\n");
    printf(LAMMPS "dump            1 all atom 10 $project.dump\n");
    printf(LAMMPS "restart         500 $project.restart1 $project.restart2\n");
    printf(LAMMPS "dump            1 all atom 100 $project.dump\n");
    printf(LAMMPS "dump_modify     1 image yes scale yes\n\n");
    printf(LAMMPS "run             20\n");		# run for 20 time steps
    printf(LAMMPS "thermo          100\n");		# set thermo style
    printf(LAMMPS "run             1000\n");		# run for 1000 time steps
    close(LAMMPS);
  }