diff --git a/examples/misc_examples/explicit_electrons/eff_CH4/README.txt b/examples/misc_examples/explicit_electrons/eff_CH4/README.txt index 5f5fd61b..c587ec78 100644 --- a/examples/misc_examples/explicit_electrons/eff_CH4/README.txt +++ b/examples/misc_examples/explicit_electrons/eff_CH4/README.txt @@ -1,6 +1,6 @@ This example using the electron Force Field (eFF) was created by Andres Jaramillo-Botero and distributed with LAMMPS in the -"examples/USERS/eff/CH4" subdirectory. +"examples/USER/eff/CH4" subdirectory. The files from that example were converted into moltemplate format using "ltemplify.py" and then edited by hand (to rename the atom types, and replace all of the "pair_coeff ..." commands with "pair_coeff * *") diff --git a/moltemplate/dump2data.py b/moltemplate/dump2data.py index 0e815799..6269483e 100755 --- a/moltemplate/dump2data.py +++ b/moltemplate/dump2data.py @@ -24,8 +24,8 @@ #g_program_name = 'dump2data.py' g_program_name = __file__.split('/')[-1] -g_date_str = '2020-3-22' -g_version_str = '0.57.0' +g_date_str = '2020-7-26' +g_version_str = '0.58.0' import sys from collections import defaultdict @@ -99,7 +99,7 @@ def __init__(self): 'dipole': ['atom-ID', 'atom-type', 'q', 'x', 'y', 'z', 'mux', 'muy', 'muz'], 'dpd': ['atom-ID', 'atom-type', 'theta', 'x', 'y', 'z'], 'electron': ['atom-ID', 'atom-type', 'q', 'spin', 'eradius', 'x', 'y', 'z'], - 'ellipsoid': ['atom-ID', 'atom-type', 'x', 'y', 'z', 'quatw', 'quati', 'quatj', 'quatk'], + 'ellipsoid': ['atom-ID', 'atom-type', 'ellipsoidflag', 'density', 'x', 'y', 'z'], 'full': ['atom-ID', 'molecule-ID', 'atom-type', 'q', 'x', 'y', 'z'], 'line': ['atom-ID', 'molecule-ID', 'atom-type', 'lineflag', 'density', 'x', 'y', 'z'], 'meso': ['atom-ID', 'atom-type', 'rho', 'e', 'cv', 'x', 'y', 'z'], @@ -725,7 +725,7 @@ def WriteFrameToData(out_file, tokens[1] = xz_str tokens[2] = yz_str line = ' '.join(tokens) - if (line in set(['Masses', 'Velocities', 'Atoms','Ellipsoids', + if (line in set(['Masses', 'Velocities', 'Atoms', 'Ellipsoids', 'Bond Coeffs', 'Angle Coeffs', 'Dihedral Coeffs', 'Improper Coeffs', 'Bonds', 'Angles', 'Dihedrals', 'Impropers'])): @@ -1162,7 +1162,7 @@ def main(): if (i_ix != -1) and (not x_already_unwrapped): ix = int(tokens[i_ix]) if (misc_settings.center_frame or - (misc_settings.output_format != 'data')): + (misc_settings.output_format != 'data')): #sys.stderr.write('atomid='+str(atomid)+', ix = '+str(ix)+', avec='+str(avec)+'\n') x += ix * avec[0] y += ix * avec[1] @@ -1175,7 +1175,7 @@ def main(): if (i_iy != -1) and (not y_already_unwrapped): iy = int(tokens[i_iy]) if (misc_settings.center_frame or - (misc_settings.output_format != 'data')): + (misc_settings.output_format != 'data')): #sys.stderr.write('atomid='+str(atomid)+', iy = '+str(iy)+', bvec='+str(bvec)+'\n') x += iy * bvec[0] y += iy * bvec[1] @@ -1188,7 +1188,7 @@ def main(): if (i_iz != -1) and (not z_already_unwrapped): iz = int(tokens[i_iz]) if (misc_settings.center_frame or - (misc_settings.output_format != 'data')): + (misc_settings.output_format != 'data')): #sys.stderr.write('atomid='+str(atomid)+', iz = '+str(iz)+', cvec='+str(cvec)+'\n') x += iz * cvec[0] y += iz * cvec[1] @@ -1240,18 +1240,22 @@ def main(): name_vz = dump_column_names[i_vz] i_vx_data = 0 I_data = -1 - # This code is ugly and inneficient. + # This code is dreadful and inneficient. # I never want to touch this code again. (Hope it # works) while i_vx_data < len(data_settings.column_names): if name_vx == data_settings.column_names[i_vx_data]: I_data = 0 while I_data < len(data_settings.ii_vects): - if ii_vects[I] == data_settings.ii_vects[I_data]: + if (dump_column_names[ii_vects[I][0]] == + data_settings.column_names[data_settings.ii_vects[I_data][0]]): + # (This checks the first component, ([0]) I should also + # check [1] and [2], but the code is slow enough already. + # THIS IS TERRIBLE CODE. break I_data += 1 - if (0 < I_data) and (I_data < len(data_settings.ii_vects)): + if (0 <= I_data) and (I_data < len(data_settings.ii_vects)): break i_vx_data += 1 @@ -1310,10 +1314,10 @@ def main(): write_this_frame = True if (misc_settings.tstart and - (int(frame_timestep_str) < misc_settings.tstart)): + (int(frame_timestep_str) < misc_settings.tstart)): write_this_frame = False if (misc_settings.tstop and - (int(frame_timestep_str) > misc_settings.tstop)): + (int(frame_timestep_str) > misc_settings.tstop)): write_this_frame = False read_last_frame = True @@ -1334,7 +1338,7 @@ def main(): else: assert(misc_settings.timestep_str) if (int(frame_timestep_str) >= - int(misc_settings.timestep_str)): + int(misc_settings.timestep_str)): write_this_frame = True read_last_frame = True diff --git a/moltemplate/scripts/moltemplate.sh b/moltemplate/scripts/moltemplate.sh index ec915d10..2aa757c9 100755 --- a/moltemplate/scripts/moltemplate.sh +++ b/moltemplate/scripts/moltemplate.sh @@ -6,8 +6,8 @@ # Copyright (c) 2013 G_PROGRAM_NAME="moltemplate.sh" -G_VERSION="2.18.2" -G_DATE="2020-7-25" +G_VERSION="2.18.3" +G_DATE="2020-7-26" echo "${G_PROGRAM_NAME} v${G_VERSION} ${G_DATE}" >&2 echo "" >&2 @@ -606,10 +606,9 @@ while [ "$i" -lt "$ARGC" ]; do BOXSIZE_XY=`awk -v PI="$PI" -v BOXSIZE_B="$BOXSIZE_B" -v GAMMA="$GAMMA" 'BEGIN{print BOXSIZE_B*cos(GAMMA*PI/180.0)}'` BOXSIZE_XZ=`awk -v PI="$PI" -v BOXSIZE_C="$BOXSIZE_C" -v BETA="$BETA" 'BEGIN{print BOXSIZE_C*cos(BETA*PI/180.0)}'` BOXSIZE_YZ=`awk -v PI="$PI" -v BOXSIZE_C="$BOXSIZE_C" -v ALPHA="$ALPHA" -v BETA="$BETA" -v GAMMA="$GAMMA" 'BEGIN{ca=cos(ALPHA*PI/180.0); cb=cos(BETA*PI/180.0); cg=cos(GAMMA*PI/180.0); sg=sin(GAMMA*PI/180.0); print BOXSIZE_C*(ca-(cg*cb))/sg}'` - BOXSIZE_Z=`awk -v PI="$PI" -v BOXSIZE_C="$BOXSIZE_C" -v ALPHA="$ALPHA" -v BETA="$BETA" -v GAMMA="$GAMMA" 'BEGIN{ca=cos(ALPHA*PI/180.0); cb=cos(BETA*PI/180.0); cg=cos(GAMMA*PI/180.0); sg=sin(GAMMA*PI/180.0); print BOXSIZE_C*sqrt(1.+2*ca*cb*cg-ca**2-cb**2-cg**2)/sg}'` - #BOXSIZE_Z=`awk -v BOXSIZE_C="$BOXSIZE_C" -v BOXSIZE_XZ="$BOXSIZE_XZ" -v BOXSIZE_YZ="$BOXSIZE_YZ" 'BEGIN{print sqrt((BOXSIZE_C**2)-((BOXSIZE_XZ**2)+(BOXSIZE_YZ**2)))}'` - # The two expressions for "BOXSIZE_Z" should be algebraically equivalent, but I - # might have made a mistake. Thanks, Otello for fixing this code. -A 2020-7-25. + BOXSIZE_Z=`awk -v PI="$PI" -v BOXSIZE_C="$BOXSIZE_C" -v ALPHA="$ALPHA" -v BETA="$BETA" -v GAMMA="$GAMMA" 'BEGIN{ca=cos(ALPHA*PI/180.0); cb=cos(BETA*PI/180.0); cg=cos(GAMMA*PI/180.0); sg=sin(GAMMA*PI/180.0); print BOXSIZE_C*sqrt(1.0+2*ca*cb*cg-ca*ca-cb*cb-cg*cg)/sg}'` + #BOXSIZE_Z=`awk -v BOXSIZE_C="$BOXSIZE_C" -v BOXSIZE_XZ="$BOXSIZE_XZ" -v BOXSIZE_YZ="$BOXSIZE_YZ" 'BEGIN{print sqrt((BOXSIZE_C*BOXSIZE_C)-((BOXSIZE_XZ*BOXSIZE_XZ)+(BOXSIZE_YZ*BOXSIZE_YZ)))}'` + # Note: The two expressions for "BOXSIZE_Z" are algebraically equivalent. else BOXSIZE_X=$BOXSIZE_A BOXSIZE_Y=$BOXSIZE_B diff --git a/setup.py b/setup.py index 7d681a76..ea424880 100644 --- a/setup.py +++ b/setup.py @@ -45,9 +45,9 @@ url='https://github.com/jewettaij/moltemplate', - download_url='https://github.com/jewettaij/moltemplate/archive/v2.18.2.zip', + download_url='https://github.com/jewettaij/moltemplate/archive/v2.18.3.zip', - version='2.18.2', + version='2.18.3', keywords=['simulation', 'LAMMPS', 'molecule editor', 'molecule builder', 'ESPResSo'],