From ed0d30f88dd2059d99eeac0d13b9447866dbac47 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Tue, 31 Oct 2006 22:16:12 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@99 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/GRANULAR/fix_wall_gran.cpp | 9 +++--- src/MAKE/Makefile.tbird | 6 +++- src/Make.csh | 8 +++--- src/Makefile.lib | 4 +-- src/Makefile.list | 4 +-- src/dump_custom.cpp | 16 +++++++++++ src/fix_nve.h | 2 +- src/library.cpp | 2 +- src/region.cpp | 52 +++++++++++----------------------- src/region.h | 2 +- src/region_block.cpp | 2 ++ src/region_cylinder.cpp | 2 ++ src/region_intersect.cpp | 6 +++- src/region_prism.cpp | 2 ++ src/region_sphere.cpp | 2 ++ src/region_union.cpp | 6 +++- 16 files changed, 72 insertions(+), 53 deletions(-) diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp index 8c1012f14a..7a90f023bd 100644 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -400,7 +400,7 @@ void FixWallGran::history(double rsq, double dx, double dy, double dz, double r,vr1,vr2,vr3,vnnr,vn1,vn2,vn3,vt1,vt2,vt3; double wr1,wr2,wr3,xmeff,damp,ccel,vtr1,vtr2,vtr3,vrel; double fn,fs,fs1,fs2,fs3,ccelx,ccely,ccelz,tor1,tor2,tor3; - double shrmag,rsht; + double shrmag,rsht,rinv; r = sqrt(rsq); @@ -507,9 +507,10 @@ void FixWallGran::history(double rsq, double dx, double dy, double dz, // torques - tor1 = dy*fs3 - dz*fs2; - tor2 = dz*fs1 - dx*fs3; - tor3 = dx*fs2 - dy*fs1; + rinv = 1/r; + tor1 = rinv * (dy*fs3 - dz*fs2); + tor2 = rinv * (dz*fs1 - dx*fs3); + tor3 = rinv * (dx*fs2 - dy*fs1); phia[0] -= radius*tor1; phia[1] -= radius*tor2; phia[2] -= radius*tor3; diff --git a/src/MAKE/Makefile.tbird b/src/MAKE/Makefile.tbird index 1331062624..2642db468e 100644 --- a/src/MAKE/Makefile.tbird +++ b/src/MAKE/Makefile.tbird @@ -5,7 +5,11 @@ SHELL = /bin/sh # System-specific settings -FFTW = /apps/libraries/fftw +# NOTE: you may need to invoke (by typing or in your .cshrc) +# module load libraries/fftw-2.1.5-openmpi-1.1.2_rc4-ofed-intel-9.1 +# before building LAMMPS + +FFTW = /apps/x86_64/libraries/fftw/openmpi-1.1.2_rc4-ofed-intel-9.1/fftw-2.1.5 CC = mpicxx CCFLAGS = -O -DFFT_FFTW -I${FFTW}/include diff --git a/src/Make.csh b/src/Make.csh index d5dda6e40d..640bd47d2b 100644 --- a/src/Make.csh +++ b/src/Make.csh @@ -3,16 +3,16 @@ if ($1 == "Makefile.lib") then - set list = `ls --width=10000 *.cpp | sed s/main\.cpp//` + set list = `ls *.cpp | sed s/^main\.cpp//` sed -i -e "s/SRC =\t.*/SRC =\t$list/" Makefile.lib - set list = `ls --width=10000 *.h` + set list = `ls *.h` sed -i -e "s/INC =\t.*/INC =\t$list/" Makefile.lib else if ($1 == "Makefile.list") then - set list = `ls --width=10000 *.cpp` + set list = `ls *.cpp` sed -i -e "s/SRC =\t.*/SRC =\t$list/" Makefile.list - set list = `ls --width=10000 *.h` + set list = `ls *.h` sed -i -e "s/INC =\t.*/INC =\t$list/" Makefile.list endif diff --git a/src/Makefile.lib b/src/Makefile.lib index 4c38138e18..9c3e453263 100644 --- a/src/Makefile.lib +++ b/src/Makefile.lib @@ -7,9 +7,9 @@ SHELL = /bin/sh ROOT = lmp EXE = lib$(ROOT)_$@.a -SRC = angle.cpp angle_charmm.cpp angle_cosine.cpp angle_cosine_squared.cpp angle_harmonic.cpp angle_hybrid.cpp atom.cpp atom_angle.cpp atom_atomic.cpp atom_bond.cpp atom_charge.cpp atom_full.cpp atom_hybrid.cpp atom_molecular.cpp bond.cpp bond_fene.cpp bond_fene_expand.cpp bond_harmonic.cpp bond_hybrid.cpp bond_morse.cpp bond_nonlinear.cpp bond_quartic.cpp comm.cpp create_atoms.cpp create_box.cpp delete_atoms.cpp delete_bonds.cpp dihedral.cpp dihedral_charmm.cpp dihedral_harmonic.cpp dihedral_helix.cpp dihedral_hybrid.cpp dihedral_multi_harmonic.cpp dihedral_opls.cpp displace_atoms.cpp do dump.cpp dump_atom.cpp dump_bond.cpp dump_custom.cpp dump_dcd.cpp dump_xyz.cpp error.cpp ewald.cpp fft3d.cpp fft3d_wrap.cpp finish.cpp fix.cpp fix_add_force.cpp fix_ave_force.cpp fix_centro.cpp fix_com.cpp fix_drag.cpp fix_efield.cpp fix_energy.cpp fix_enforce2d.cpp fix_gravity.cpp fix_gyration.cpp fix_indent.cpp fix_langevin.cpp fix_line_force.cpp fix_minimize.cpp fix_momentum.cpp fix_msd.cpp fix_nph.cpp fix_npt.cpp fix_nve.cpp fix_nvt.cpp fix_orient_fcc.cpp fix_plane_force.cpp fix_print.cpp fix_rdf.cpp fix_recenter.cpp fix_respa.cpp fix_rigid.cpp fix_set_force.cpp fix_shake.cpp fix_spring.cpp fix_spring_rg.cpp fix_spring_self.cpp fix_stress.cpp fix_temp_rescale.cpp fix_tmd.cpp fix_uniaxial.cpp fix_viscous.cpp fix_volume_rescale.cpp fix_wall_lj93.cpp fix_wall_reflect.cpp fix_wiggle.cpp force.cpp group.cpp improper.cpp improper_cvff.cpp improper_harmonic.cpp improper_hybrid.cpp input.cpp kspace.cpp lammps.cpp library.cpp memory.cpp min.cpp min_cg.cpp min_cg_fr.cpp min_sd.cpp minimize.cpp modify.cpp neigh_bond.cpp neigh_full.cpp neigh_gran.cpp neigh_half.cpp neigh_respa.cpp neighbor.cpp output.cpp pack.cpp pair.cpp pair_buck.cpp pair_buck_coul_cut.cpp pair_buck_coul_long.cpp pair_eam.cpp pair_eam_alloy.cpp pair_eam_fs.cpp pair_hybrid.cpp pair_lj_charmm_coul_charmm.cpp pair_lj_charmm_coul_charmm_implicit.cpp pair_lj_charmm_coul_long.cpp pair_lj_cut.cpp pair_lj_cut_coul_cut.cpp pair_lj_cut_coul_debye.cpp pair_lj_cut_coul_long.cpp pair_lj_cut_coul_long_tip4p.cpp pair_lj_expand.cpp pair_lj_smooth.cpp pair_morse.cpp pair_soft.cpp pair_table.cpp pair_yukawa.cpp pppm.cpp pppm_tip4p.cpp pressure.cpp random_mars.cpp random_park.cpp read_data.cpp read_restart.cpp region.cpp region_block.cpp region_cylinder.cpp region_intersect.cpp region_sphere.cpp region_union.cpp remap.cpp remap_wrap.cpp replicate.cpp respa.cpp run.cpp set.cpp shell.cpp special.cpp system.cpp temp_full.cpp temp_partial.cpp temp_ramp.cpp temp_region.cpp temper.cpp temperature.cpp thermo.cpp timer.cpp universe.cpp update.cpp variable.cpp velocity.cpp verlet.cpp write_restart.cpp +SRC = angle.cpp angle_charmm.cpp angle_class2.cpp angle_cosine.cpp angle_cosine_squared.cpp angle_harmonic.cpp angle_hybrid.cpp atom.cpp atom_angle.cpp atom_atomic.cpp atom_bond.cpp atom_charge.cpp atom_dpd.cpp atom_full.cpp atom_granular.cpp atom_hybrid.cpp atom_molecular.cpp bond.cpp bond_class2.cpp bond_fene.cpp bond_fene_expand.cpp bond_harmonic.cpp bond_hybrid.cpp bond_morse.cpp bond_nonlinear.cpp bond_quartic.cpp comm.cpp create_atoms.cpp create_box.cpp delete_atoms.cpp delete_bonds.cpp dihedral.cpp dihedral_charmm.cpp dihedral_class2.cpp dihedral_harmonic.cpp dihedral_helix.cpp dihedral_hybrid.cpp dihedral_multi_harmonic.cpp dihedral_opls.cpp displace_atoms.cpp domain.cpp dump.cpp dump_atom.cpp dump_bond.cpp dump_custom.cpp dump_dcd.cpp dump_xyz.cpp error.cpp ewald.cpp fft3d.cpp fft3d_wrap.cpp finish.cpp fix.cpp fix_add_force.cpp fix_ave_force.cpp fix_centro.cpp fix_com.cpp fix_drag.cpp fix_efield.cpp fix_energy.cpp fix_enforce2d.cpp fix_freeze.cpp fix_gran_diag.cpp fix_gravity.cpp fix_gyration.cpp fix_indent.cpp fix_insert.cpp fix_langevin.cpp fix_line_force.cpp fix_minimize.cpp fix_momentum.cpp fix_msd.cpp fix_nph.cpp fix_npt.cpp fix_nve.cpp fix_nve_gran.cpp fix_nvt.cpp fix_orient_fcc.cpp fix_plane_force.cpp fix_print.cpp fix_rdf.cpp fix_recenter.cpp fix_respa.cpp fix_rigid.cpp fix_set_force.cpp fix_shake.cpp fix_shear_history.cpp fix_spring.cpp fix_spring_rg.cpp fix_spring_self.cpp fix_stress.cpp fix_temp_rescale.cpp fix_tmd.cpp fix_uniaxial.cpp fix_viscous.cpp fix_volume_rescale.cpp fix_wall_gran.cpp fix_wall_lj93.cpp fix_wall_reflect.cpp fix_wiggle.cpp force.cpp group.cpp improper.cpp improper_class2.cpp improper_cvff.cpp improper_harmonic.cpp improper_hybrid.cpp input.cpp kspace.cpp lammps.cpp library.cpp memory.cpp min.cpp min_cg.cpp min_cg_fr.cpp min_sd.cpp minimize.cpp modify.cpp neigh_bond.cpp neigh_full.cpp neigh_gran.cpp neigh_half.cpp neigh_respa.cpp neighbor.cpp output.cpp pack.cpp pair.cpp pair_buck.cpp pair_buck_coul_cut.cpp pair_buck_coul_long.cpp pair_dpd.cpp pair_eam.cpp pair_eam_alloy.cpp pair_eam_fs.cpp pair_gran_hertzian.cpp pair_gran_history.cpp pair_gran_no_history.cpp pair_hybrid.cpp pair_lj_charmm_coul_charmm.cpp pair_lj_charmm_coul_charmm_implicit.cpp pair_lj_charmm_coul_long.cpp pair_lj_class2.cpp pair_lj_class2_coul_cut.cpp pair_lj_class2_coul_long.cpp pair_lj_cut.cpp pair_lj_cut_coul_cut.cpp pair_lj_cut_coul_debye.cpp pair_lj_cut_coul_long.cpp pair_lj_cut_coul_long_tip4p.cpp pair_lj_cut_fast.cpp pair_lj_expand.cpp pair_lj_smooth.cpp pair_morse.cpp pair_soft.cpp pair_sw.cpp pair_table.cpp pair_tersoff.cpp pair_yukawa.cpp pppm.cpp pppm_tip4p.cpp pressure.cpp random_mars.cpp random_park.cpp read_data.cpp read_restart.cpp region.cpp region_block.cpp region_cylinder.cpp region_intersect.cpp region_prism.cpp region_sphere.cpp region_union.cpp remap.cpp remap_wrap.cpp replicate.cpp respa.cpp run.cpp set.cpp shell.cpp special.cpp system.cpp temp_full.cpp temp_partial.cpp temp_ramp.cpp temp_region.cpp temper.cpp temperature.cpp thermo.cpp timer.cpp universe.cpp update.cpp variable.cpp velocity.cpp verlet.cpp write_restart.cpp -INC = angle.h angle_charmm.h angle_cosine.h angle_cosine_squared.h angle_harmonic.h angle_hybrid.h atom.h atom_angle.h atom_atomic.h atom_bond.h atom_charge.h atom_full.h atom_hybrid.h atom_molecular.h bond.h bond_fene.h bond_fene_expand.h bond_harmonic.h bond_hybrid.h bond_morse.h bond_nonlinear.h bond_quartic.h comm.h create_atoms.h create_box.h delete_atoms.h delete_bonds.h dihedral.h dihedral_charmm.h dihedral_harmonic.h dihedral_helix.h dihedral_hybrid.h dihedral_multi_harmonic.h dihedral_opls.h displace_atoms.h domain.h dump.h dump_atom.h dump_bond.h dump_custom.h dump_dcd.h dump_xyz.h error.h ewald.h fft3d.h fft3d_wrap.h finish.h fix.h fix_add_force.h fix_ave_force.h fix_centro.h fix_com.h fix_drag.h fix_efield.h fix_energy.h fix_enforce2d.h fix_gravity.h fix_gyration.h fix_indent.h fix_langevin.h fix_line_force.h fix_minimize.h fix_momentum.h fix_msd.h fix_nph.h fix_npt.h fix_nve.h fix_nvt.h fix_orient_fcc.h fix_plane_force.h fix_print.h fix_rdf.h fix_recenter.h fix_respa.h fix_rigid.h fix_set_force.h fix_shake.h fix_shear_history.h fix_spring.h fix_spring_rg.h fix_spring_self.h fix_stress.h fix_temp_rescale.h fix_tmd.h fix_uniaxial.h fix_viscous.h fix_volume_rescale.h fix_wall_lj93.h fix_wall_reflect.h fix_wiggle.h force.h group.h improper.h improper_cvff.h improper_harmonic.h improper_hybrid.h input.h integrate.h kspace.h lammps.h library.h memory.h memory.hold.h min.h min_cg.h min_cg_fr.h min_sd.h minimize.h modify.h neighbor.h output.h pack.h pair.h pair_buck.h pair_buck_coul_cut.h pair_buck_coul_long.h pair_eam.h pair_eam_alloy.h pair_eam_fs.h pair_hybrid.h pair_lj_charmm_coul_charmm.h pair_lj_charmm_coul_charmm_implicit.h pair_lj_charmm_coul_long.h pair_lj_class2_coul_long.h pair_lj_cut.h pair_lj_cut_coul_cut.h pair_lj_cut_coul_debye.h pair_lj_cut_coul_long.h pair_lj_cut_coul_long_tip4p.h pair_lj_expand.h pair_lj_smooth.h pair_morse.h pair_soft.h pair_table.h pair_yukawa.h pppm.h pppm_tip4p.h pressure.h random_mars.h random_park.h read_data.h read_restart.h region.h region_block.h region_cylinder.h region_intersect.h region_sphere.h region_union.h remap.h remap_wrap.h replicate.h respa.h run.h set.h shell.h special.h style.h style_class2.h style_dpd.h style_granular.h style_kspace.h style_manybody.h style_molecule.h style_poems.h style_user.h style_xtc.h system.h temp_full.h temp_partial.h temp_ramp.h temp_region.h temper.h temperature.h thermo.h timer.h universe.h update.h variable.h velocity.h verlet.h write_restart.h +INC = angle.h angle_charmm.h angle_class2.h angle_cosine.h angle_cosine_squared.h angle_harmonic.h angle_hybrid.h atom.h atom_angle.h atom_atomic.h atom_bond.h atom_charge.h atom_dpd.h atom_full.h atom_granular.h atom_hybrid.h atom_molecular.h bond.h bond_class2.h bond_fene.h bond_fene_expand.h bond_harmonic.h bond_hybrid.h bond_morse.h bond_nonlinear.h bond_quartic.h comm.h create_atoms.h create_box.h delete_atoms.h delete_bonds.h dihedral.h dihedral_charmm.h dihedral_class2.h dihedral_harmonic.h dihedral_helix.h dihedral_hybrid.h dihedral_multi_harmonic.h dihedral_opls.h displace_atoms.h domain.h dump.h dump_atom.h dump_bond.h dump_custom.h dump_dcd.h dump_xyz.h error.h ewald.h fft3d.h fft3d_wrap.h finish.h fix.h fix_add_force.h fix_ave_force.h fix_centro.h fix_com.h fix_drag.h fix_efield.h fix_energy.h fix_enforce2d.h fix_freeze.h fix_gran_diag.h fix_gravity.h fix_gyration.h fix_indent.h fix_insert.h fix_langevin.h fix_line_force.h fix_minimize.h fix_momentum.h fix_msd.h fix_nph.h fix_npt.h fix_nve.h fix_nve_gran.h fix_nvt.h fix_orient_fcc.h fix_plane_force.h fix_print.h fix_rdf.h fix_recenter.h fix_respa.h fix_rigid.h fix_set_force.h fix_shake.h fix_shear_history.h fix_spring.h fix_spring_rg.h fix_spring_self.h fix_stress.h fix_temp_rescale.h fix_tmd.h fix_uniaxial.h fix_viscous.h fix_volume_rescale.h fix_wall_gran.h fix_wall_lj93.h fix_wall_reflect.h fix_wiggle.h force.h group.h improper.h improper_class2.h improper_cvff.h improper_harmonic.h improper_hybrid.h input.h integrate.h kspace.h lammps.h library.h memory.h memory.hold.h min.h min_cg.h min_cg_fr.h min_sd.h minimize.h modify.h neighbor.h output.h pack.h pair.h pair_buck.h pair_buck_coul_cut.h pair_buck_coul_long.h pair_dpd.h pair_eam.h pair_eam_alloy.h pair_eam_fs.h pair_gran_hertzian.h pair_gran_history.h pair_gran_no_history.h pair_hybrid.h pair_lj_charmm_coul_charmm.h pair_lj_charmm_coul_charmm_implicit.h pair_lj_charmm_coul_long.h pair_lj_class2.h pair_lj_class2_coul_cut.h pair_lj_class2_coul_long.h pair_lj_cut.h pair_lj_cut_coul_cut.h pair_lj_cut_coul_debye.h pair_lj_cut_coul_long.h pair_lj_cut_coul_long_tip4p.h pair_lj_cut_fast.h pair_lj_expand.h pair_lj_smooth.h pair_morse.h pair_soft.h pair_sw.h pair_table.h pair_tersoff.h pair_yukawa.h pppm.h pppm_tip4p.h pressure.h random_mars.h random_park.h read_data.h read_restart.h region.h region_block.h region_cylinder.h region_intersect.h region_prism.h region_sphere.h region_union.h remap.h remap_wrap.h replicate.h respa.h run.h set.h shell.h special.h style.h style_class2.h style_dpd.h style_granular.h style_kspace.h style_manybody.h style_molecule.h style_poems.h style_user.h style_xtc.h system.h temp_full.h temp_partial.h temp_ramp.h temp_region.h temper.h temperature.h thermo.h timer.h universe.h update.h variable.h velocity.h verlet.h write_restart.h OBJ = $(SRC:.cpp=.o) diff --git a/src/Makefile.list b/src/Makefile.list index 719c5bf981..d534564514 100644 --- a/src/Makefile.list +++ b/src/Makefile.list @@ -7,9 +7,9 @@ SHELL = /bin/sh ROOT = lmp EXE = $(ROOT)_$@ -SRC = angle.cpp angle_charmm.cpp angle_cosine.cpp angle_cosine_squared.cpp angle_harmonic.cpp angle_hybrid.cpp atom.cpp atom_angle.cpp atom_atomic.cpp atom_bond.cpp atom_charge.cpp atom_full.cpp atom_hybrid.cpp atom_molecular.cpp bond.cpp bond_fene.cpp bond_fene_expand.cpp bond_harmonic.cpp bond_hybrid.cpp bond_morse.cpp bond_nonlinear.cpp bond_quartic.cpp comm.cpp create_atoms.cpp create_box.cpp delete_atoms.cpp delete_bonds.cpp dihedral.cpp dihedral_charmm.cpp dihedral_harmonic.cpp dihedral_helix.cpp dihedral_hybrid.cpp dihedral_multi_harmonic.cpp dihedral_opls.cpp displace_atoms.cpp domain.cpp dump.cpp dump_atom.cpp dump_bond.cpp dump_custom.cpp dump_dcd.cpp dump_xyz.cpp error.cpp ewald.cpp fft3d.cpp fft3d_wrap.cpp finish.cpp fix.cpp fix_add_force.cpp fix_ave_force.cpp fix_centro.cpp fix_com.cpp fix_drag.cpp fix_efield.cpp fix_energy.cpp fix_enforce2d.cpp fix_gravity.cpp fix_gyration.cpp fix_indent.cpp fix_langevin.cpp fix_line_force.cpp fix_minimize.cpp fix_momentum.cpp fix_msd.cpp fix_nph.cpp fix_npt.cpp fix_nve.cpp fix_nvt.cpp fix_orient_fcc.cpp fix_plane_force.cpp fix_print.cpp fix_rdf.cpp fix_recenter.cpp fix_respa.cpp fix_rigid.cpp fix_set_force.cpp fix_shake.cpp fix_spring.cpp fix_spring_rg.cpp fix_spring_self.cpp fix_stress.cpp fix_temp_rescale.cpp fix_tmd.cpp fix_uniaxial.cpp fix_viscous.cpp fix_volume_rescale.cpp fix_wall_lj93.cpp fix_wall_reflect.cpp fix_wiggle.cpp force.cpp group.cpp improper.cpp improper_cvff.cpp improper_harmonic.cpp improper_hybrid.cpp input.cpp kspace.cpp lammps.cpp library.cpp main.cpp memory.cpp min.cpp min_cg.cpp min_cg_fr.cpp min_sd.cpp minimize.cpp modify.cpp neigh_bond.cpp neigh_full.cpp neigh_gran.cpp neigh_half.cpp neigh_respa.cpp neighbor.cpp output.cpp pack.cpp pair.cpp pair_buck.cpp pair_buck_coul_cut.cpp pair_buck_coul_long.cpp pair_eam.cpp pair_eam_alloy.cpp pair_eam_fs.cpp pair_hybrid.cpp pair_lj_charmm_coul_charmm.cpp pair_lj_charmm_coul_charmm_implicit.cpp pair_lj_charmm_coul_long.cpp pair_lj_cut.cpp pair_lj_cut_coul_cut.cpp pair_lj_cut_coul_debye.cpp pair_lj_cut_coul_long.cpp pair_lj_cut_coul_long_tip4p.cpp pair_lj_expand.cpp pair_lj_smooth.cpp pair_morse.cpp pair_soft.cpp pair_table.cpp pair_yukawa.cpp pppm.cpp pppm_tip4p.cpp pressure.cpp random_mars.cpp random_park.cpp read_data.cpp read_restart.cpp region.cpp region_block.cpp region_cylinder.cpp region_intersect.cpp region_sphere.cpp region_union.cpp remap.cpp remap_wrap.cpp replicate.cpp respa.cpp run.cpp set.cpp shell.cpp special.cpp system.cpp temp_full.cpp temp_partial.cpp temp_ramp.cpp temp_region.cpp temper.cpp temperature.cpp thermo.cpp timer.cpp universe.cpp update.cpp variable.cpp velocity.cpp verlet.cpp write_restart.cpp +SRC = angle.cpp angle_charmm.cpp angle_class2.cpp angle_cosine.cpp angle_cosine_squared.cpp angle_harmonic.cpp angle_hybrid.cpp atom.cpp atom_angle.cpp atom_atomic.cpp atom_bond.cpp atom_charge.cpp atom_dpd.cpp atom_full.cpp atom_granular.cpp atom_hybrid.cpp atom_molecular.cpp bond.cpp bond_class2.cpp bond_fene.cpp bond_fene_expand.cpp bond_harmonic.cpp bond_hybrid.cpp bond_morse.cpp bond_nonlinear.cpp bond_quartic.cpp comm.cpp create_atoms.cpp create_box.cpp delete_atoms.cpp delete_bonds.cpp dihedral.cpp dihedral_charmm.cpp dihedral_class2.cpp dihedral_harmonic.cpp dihedral_helix.cpp dihedral_hybrid.cpp dihedral_multi_harmonic.cpp dihedral_opls.cpp displace_atoms.cpp domain.cpp dump.cpp dump_atom.cpp dump_bond.cpp dump_custom.cpp dump_dcd.cpp dump_xyz.cpp error.cpp ewald.cpp fft3d.cpp fft3d_wrap.cpp finish.cpp fix.cpp fix_add_force.cpp fix_ave_force.cpp fix_centro.cpp fix_com.cpp fix_drag.cpp fix_efield.cpp fix_energy.cpp fix_enforce2d.cpp fix_freeze.cpp fix_gran_diag.cpp fix_gravity.cpp fix_gyration.cpp fix_indent.cpp fix_insert.cpp fix_langevin.cpp fix_line_force.cpp fix_minimize.cpp fix_momentum.cpp fix_msd.cpp fix_nph.cpp fix_npt.cpp fix_nve.cpp fix_nve_gran.cpp fix_nvt.cpp fix_orient_fcc.cpp fix_plane_force.cpp fix_print.cpp fix_rdf.cpp fix_recenter.cpp fix_respa.cpp fix_rigid.cpp fix_set_force.cpp fix_shake.cpp fix_shear_history.cpp fix_spring.cpp fix_spring_rg.cpp fix_spring_self.cpp fix_stress.cpp fix_temp_rescale.cpp fix_tmd.cpp fix_uniaxial.cpp fix_viscous.cpp fix_volume_rescale.cpp fix_wall_gran.cpp fix_wall_lj93.cpp fix_wall_reflect.cpp fix_wiggle.cpp force.cpp group.cpp improper.cpp improper_class2.cpp improper_cvff.cpp improper_harmonic.cpp improper_hybrid.cpp input.cpp kspace.cpp lammps.cpp library.cpp main.cpp memory.cpp min.cpp min_cg.cpp min_cg_fr.cpp min_sd.cpp minimize.cpp modify.cpp neigh_bond.cpp neigh_full.cpp neigh_gran.cpp neigh_half.cpp neigh_respa.cpp neighbor.cpp output.cpp pack.cpp pair.cpp pair_buck.cpp pair_buck_coul_cut.cpp pair_buck_coul_long.cpp pair_dpd.cpp pair_eam.cpp pair_eam_alloy.cpp pair_eam_fs.cpp pair_gran_hertzian.cpp pair_gran_history.cpp pair_gran_no_history.cpp pair_hybrid.cpp pair_lj_charmm_coul_charmm.cpp pair_lj_charmm_coul_charmm_implicit.cpp pair_lj_charmm_coul_long.cpp pair_lj_class2.cpp pair_lj_class2_coul_cut.cpp pair_lj_class2_coul_long.cpp pair_lj_cut.cpp pair_lj_cut_coul_cut.cpp pair_lj_cut_coul_debye.cpp pair_lj_cut_coul_long.cpp pair_lj_cut_coul_long_tip4p.cpp pair_lj_cut_fast.cpp pair_lj_expand.cpp pair_lj_smooth.cpp pair_morse.cpp pair_soft.cpp pair_sw.cpp pair_table.cpp pair_tersoff.cpp pair_yukawa.cpp pppm.cpp pppm_tip4p.cpp pressure.cpp random_mars.cpp random_park.cpp read_data.cpp read_restart.cpp region.cpp region_block.cpp region_cylinder.cpp region_intersect.cpp region_prism.cpp region_sphere.cpp region_union.cpp remap.cpp remap_wrap.cpp replicate.cpp respa.cpp run.cpp set.cpp shell.cpp special.cpp system.cpp temp_full.cpp temp_partial.cpp temp_ramp.cpp temp_region.cpp temper.cpp temperature.cpp thermo.cpp timer.cpp universe.cpp update.cpp variable.cpp velocity.cpp verlet.cpp write_restart.cpp -INC = angle.h angle_charmm.h angle_cosine.h angle_cosine_squared.h angle_harmonic.h angle_hybrid.h atom.h atom_angle.h atom_atomic.h atom_bond.h atom_charge.h atom_full.h atom_hybrid.h atom_molecular.h bond.h bond_fene.h bond_fene_expand.h bond_harmonic.h bond_hybrid.h bond_morse.h bond_nonlinear.h bond_quartic.h comm.h create_atoms.h create_box.h delete_atoms.h delete_bonds.h dihedral.h dihedral_charmm.h dihedral_harmonic.h dihedral_helix.h dihedral_hybrid.h dihedral_multi_harmonic.h dihedral_opls.h displace_atoms.h domain.h dump.h dump_atom.h dump_bond.h dump_custom.h dump_dcd.h dump_xyz.h error.h ewald.h fft3d.h fft3d_wrap.h finish.h fix.h fix_add_force.h fix_ave_force.h fix_centro.h fix_com.h fix_drag.h fix_efield.h fix_energy.h fix_enforce2d.h fix_gravity.h fix_gyration.h fix_indent.h fix_langevin.h fix_line_force.h fix_minimize.h fix_momentum.h fix_msd.h fix_nph.h fix_npt.h fix_nve.h fix_nvt.h fix_orient_fcc.h fix_plane_force.h fix_print.h fix_rdf.h fix_recenter.h fix_respa.h fix_rigid.h fix_set_force.h fix_shake.h fix_shear_history.h fix_spring.h fix_spring_rg.h fix_spring_self.h fix_stress.h fix_temp_rescale.h fix_tmd.h fix_uniaxial.h fix_viscous.h fix_volume_rescale.h fix_wall_lj93.h fix_wall_reflect.h fix_wiggle.h force.h group.h improper.h improper_cvff.h improper_harmonic.h improper_hybrid.h input.h integrate.h kspace.h lammps.h library.h memory.h memory.hold.h min.h min_cg.h min_cg_fr.h min_sd.h minimize.h modify.h neighbor.h output.h pack.h pair.h pair_buck.h pair_buck_coul_cut.h pair_buck_coul_long.h pair_eam.h pair_eam_alloy.h pair_eam_fs.h pair_hybrid.h pair_lj_charmm_coul_charmm.h pair_lj_charmm_coul_charmm_implicit.h pair_lj_charmm_coul_long.h pair_lj_class2_coul_long.h pair_lj_cut.h pair_lj_cut_coul_cut.h pair_lj_cut_coul_debye.h pair_lj_cut_coul_long.h pair_lj_cut_coul_long_tip4p.h pair_lj_expand.h pair_lj_smooth.h pair_morse.h pair_soft.h pair_table.h pair_yukawa.h pppm.h pppm_tip4p.h pressure.h random_mars.h random_park.h read_data.h read_restart.h region.h region_block.h region_cylinder.h region_intersect.h region_sphere.h region_union.h remap.h remap_wrap.h replicate.h respa.h run.h set.h shell.h special.h style.h style_class2.h style_dpd.h style_granular.h style_kspace.h style_manybody.h style_molecule.h style_poems.h style_user.h style_xtc.h system.h temp_full.h temp_partial.h temp_ramp.h temp_region.h temper.h temperature.h thermo.h timer.h universe.h update.h variable.h velocity.h verlet.h write_restart.h +INC = angle.h angle_charmm.h angle_class2.h angle_cosine.h angle_cosine_squared.h angle_harmonic.h angle_hybrid.h atom.h atom_angle.h atom_atomic.h atom_bond.h atom_charge.h atom_dpd.h atom_full.h atom_granular.h atom_hybrid.h atom_molecular.h bond.h bond_class2.h bond_fene.h bond_fene_expand.h bond_harmonic.h bond_hybrid.h bond_morse.h bond_nonlinear.h bond_quartic.h comm.h create_atoms.h create_box.h delete_atoms.h delete_bonds.h dihedral.h dihedral_charmm.h dihedral_class2.h dihedral_harmonic.h dihedral_helix.h dihedral_hybrid.h dihedral_multi_harmonic.h dihedral_opls.h displace_atoms.h domain.h dump.h dump_atom.h dump_bond.h dump_custom.h dump_dcd.h dump_xyz.h error.h ewald.h fft3d.h fft3d_wrap.h finish.h fix.h fix_add_force.h fix_ave_force.h fix_centro.h fix_com.h fix_drag.h fix_efield.h fix_energy.h fix_enforce2d.h fix_freeze.h fix_gran_diag.h fix_gravity.h fix_gyration.h fix_indent.h fix_insert.h fix_langevin.h fix_line_force.h fix_minimize.h fix_momentum.h fix_msd.h fix_nph.h fix_npt.h fix_nve.h fix_nve_gran.h fix_nvt.h fix_orient_fcc.h fix_plane_force.h fix_print.h fix_rdf.h fix_recenter.h fix_respa.h fix_rigid.h fix_set_force.h fix_shake.h fix_shear_history.h fix_spring.h fix_spring_rg.h fix_spring_self.h fix_stress.h fix_temp_rescale.h fix_tmd.h fix_uniaxial.h fix_viscous.h fix_volume_rescale.h fix_wall_gran.h fix_wall_lj93.h fix_wall_reflect.h fix_wiggle.h force.h group.h improper.h improper_class2.h improper_cvff.h improper_harmonic.h improper_hybrid.h input.h integrate.h kspace.h lammps.h library.h memory.h memory.hold.h min.h min_cg.h min_cg_fr.h min_sd.h minimize.h modify.h neighbor.h output.h pack.h pair.h pair_buck.h pair_buck_coul_cut.h pair_buck_coul_long.h pair_dpd.h pair_eam.h pair_eam_alloy.h pair_eam_fs.h pair_gran_hertzian.h pair_gran_history.h pair_gran_no_history.h pair_hybrid.h pair_lj_charmm_coul_charmm.h pair_lj_charmm_coul_charmm_implicit.h pair_lj_charmm_coul_long.h pair_lj_class2.h pair_lj_class2_coul_cut.h pair_lj_class2_coul_long.h pair_lj_cut.h pair_lj_cut_coul_cut.h pair_lj_cut_coul_debye.h pair_lj_cut_coul_long.h pair_lj_cut_coul_long_tip4p.h pair_lj_cut_fast.h pair_lj_expand.h pair_lj_smooth.h pair_morse.h pair_soft.h pair_sw.h pair_table.h pair_tersoff.h pair_yukawa.h pppm.h pppm_tip4p.h pressure.h random_mars.h random_park.h read_data.h read_restart.h region.h region_block.h region_cylinder.h region_intersect.h region_prism.h region_sphere.h region_union.h remap.h remap_wrap.h replicate.h respa.h run.h set.h shell.h special.h style.h style_class2.h style_dpd.h style_granular.h style_kspace.h style_manybody.h style_molecule.h style_poems.h style_user.h style_xtc.h system.h temp_full.h temp_partial.h temp_ramp.h temp_region.h temper.h temperature.h thermo.h timer.h universe.h update.h variable.h velocity.h verlet.h write_restart.h OBJ = $(SRC:.cpp=.o) diff --git a/src/dump_custom.cpp b/src/dump_custom.cpp index c7d3c75365..6bea3257f7 100644 --- a/src/dump_custom.cpp +++ b/src/dump_custom.cpp @@ -65,6 +65,8 @@ DumpCustom::DumpCustom(int narg, char **arg) : Dump(narg, arg) pack_choice[i] = &DumpCustom::pack_tag; vtype[i] = INT; } else if (strcmp(arg[iarg],"mol") == 0) { + if (atom->molecule == NULL) + error->all("Dumping an atom quantity that isn't allocated"); pack_choice[i] = &DumpCustom::pack_molecule; vtype[i] = INT; } else if (strcmp(arg[iarg],"type") == 0) { @@ -125,24 +127,38 @@ DumpCustom::DumpCustom(int narg, char **arg) : Dump(narg, arg) pack_choice[i] = &DumpCustom::pack_fz; vtype[i] = DOUBLE; } else if (strcmp(arg[iarg],"q") == 0) { + if (atom->q == NULL) + error->all("Dumping an atom quantity that isn't allocated"); pack_choice[i] = &DumpCustom::pack_q; vtype[i] = DOUBLE; } else if (strcmp(arg[iarg],"mux") == 0) { + if (atom->mu == NULL) + error->all("Dumping an atom quantity that isn't allocated"); pack_choice[i] = &DumpCustom::pack_mux; vtype[i] = DOUBLE; } else if (strcmp(arg[iarg],"muy") == 0) { + if (atom->mu == NULL) + error->all("Dumping an atom quantity that isn't allocated"); pack_choice[i] = &DumpCustom::pack_muy; vtype[i] = DOUBLE; } else if (strcmp(arg[iarg],"muz") == 0) { + if (atom->mu == NULL) + error->all("Dumping an atom quantity that isn't allocated"); pack_choice[i] = &DumpCustom::pack_muz; vtype[i] = DOUBLE; } else if (strcmp(arg[iarg],"tqx") == 0) { + if (atom->torque == NULL) + error->all("Dumping an atom quantity that isn't allocated"); pack_choice[i] = &DumpCustom::pack_tqx; vtype[i] = DOUBLE; } else if (strcmp(arg[iarg],"tqy") == 0) { + if (atom->torque == NULL) + error->all("Dumping an atom quantity that isn't allocated"); pack_choice[i] = &DumpCustom::pack_tqy; vtype[i] = DOUBLE; } else if (strcmp(arg[iarg],"tqz") == 0) { + if (atom->torque == NULL) + error->all("Dumping an atom quantity that isn't allocated"); pack_choice[i] = &DumpCustom::pack_tqz; vtype[i] = DOUBLE; } else if (strcmp(arg[iarg],"centro") == 0) { diff --git a/src/fix_nve.h b/src/fix_nve.h index 3e0f512ef3..cdde4c65b4 100644 --- a/src/fix_nve.h +++ b/src/fix_nve.h @@ -27,7 +27,7 @@ class FixNVE : public Fix { void initial_integrate_respa(int, int); void final_integrate_respa(int); - protected: + private: double dtv,dtf; double *step_respa; int mass_require; diff --git a/src/library.cpp b/src/library.cpp index 6203ae94da..586dfef482 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -93,7 +93,7 @@ void lammps_get_coords(double *coords) /* ---------------------------------------------------------------------- */ -void lammps_put_coords(const double *coords) +void lammps_put_coords(double *coords) { int natoms = static_cast (lammps->atom->natoms); diff --git a/src/region.cpp b/src/region.cpp index 1790b56af5..49b3c2ce4e 100644 --- a/src/region.cpp +++ b/src/region.cpp @@ -21,48 +21,13 @@ Region::Region(int narg, char **arg) { - // region ID - int n = strlen(arg[0]) + 1; id = new char[n]; strcpy(id,arg[0]); - // set option defaults - - interior = 1; - scaleflag = 1; - - // read style and options from end of input line - n = strlen(arg[1]) + 1; style = new char[n]; strcpy(style,arg[1]); - - if (strcmp(style,"block") == 0) options(narg-8,&arg[8]); - else if (strcmp(style,"sphere") == 0) options(narg-6,&arg[6]); - else if (strcmp(arg[1],"cylinder") == 0) options(narg-8,&arg[8]); - else if (strcmp(style,"prism") == 0) options(narg-11,&arg[11]); - else if (strcmp(arg[1],"union") == 0) { - if (narg < 5) error->all("Illegal region command"); - n = atoi(arg[2]); - options(narg-(n+3),&arg[n+3]); - } else if (strcmp(arg[1],"intersect") == 0) { - if (narg < 5) error->all("Illegal region command"); - n = atoi(arg[2]); - options(narg-(n+3),&arg[n+3]); - } else error->all("Illegal region command"); - - // setup scaling - - if (scaleflag && strcmp(domain->lattice_style,"none") == 0) - error->all("Use of region with undefined lattice"); - - if (scaleflag) { - xscale = domain->xlattice; - yscale = domain->ylattice; - zscale = domain->zlattice; - } - else xscale = yscale = zscale = 1.0; } /* ---------------------------------------------------------------------- */ @@ -81,6 +46,11 @@ void Region::options(int narg, char **arg) { if (narg < 0) error->all("Illegal region command"); + // option defaults + + interior = 1; + scaleflag = 1; + int iarg = 0; while (iarg < narg) { if (strcmp(arg[iarg],"units") == 0) { @@ -97,4 +67,16 @@ void Region::options(int narg, char **arg) iarg += 2; } else error->all("Illegal region command"); } + + // setup scaling + + if (scaleflag && strcmp(domain->lattice_style,"none") == 0) + error->all("Use of region with undefined lattice"); + + if (scaleflag) { + xscale = domain->xlattice; + yscale = domain->ylattice; + zscale = domain->zlattice; + } + else xscale = yscale = zscale = 1.0; } diff --git a/src/region.h b/src/region.h index 38e68c6189..d491b7088d 100644 --- a/src/region.h +++ b/src/region.h @@ -30,7 +30,7 @@ class Region : public LAMMPS { virtual ~Region(); virtual int match(double, double, double) = 0; - private: + protected: void options(int, char **); }; diff --git a/src/region_block.cpp b/src/region_block.cpp index 017c8d3b17..8138aacfb4 100644 --- a/src/region_block.cpp +++ b/src/region_block.cpp @@ -21,6 +21,8 @@ RegBlock::RegBlock(int narg, char **arg) : Region(narg, arg) { + options(narg-8,&arg[8]); + if (strcmp(arg[2],"INF") == 0) { if (domain->box_exist == 0) error->all("Cannot use region INF when box does not exist"); diff --git a/src/region_cylinder.cpp b/src/region_cylinder.cpp index 5fbc6bef44..76f98e0c58 100644 --- a/src/region_cylinder.cpp +++ b/src/region_cylinder.cpp @@ -22,6 +22,8 @@ RegCylinder::RegCylinder(int narg, char **arg) : Region(narg, arg) { + options(narg-8,&arg[8]); + if (strcmp(arg[2],"x") && strcmp(arg[2],"y") && strcmp(arg[2],"z")) error->all("Illegal region cylinder command"); axis = arg[2][0]; diff --git a/src/region_intersect.cpp b/src/region_intersect.cpp index f8de6c909b..6bf355d176 100644 --- a/src/region_intersect.cpp +++ b/src/region_intersect.cpp @@ -24,9 +24,13 @@ RegIntersect::RegIntersect(int narg, char **arg) : Region(narg, arg) { + if (narg < 5) error->all("Illegal region command"); + int n = atoi(arg[2]); + if (n < 2) error->all("Illegal region command"); + options(narg-(n+3),&arg[n+3]); + // build list of regions to intersect - int n = atoi(arg[2]); list = new int[n]; nregion = 0; diff --git a/src/region_prism.cpp b/src/region_prism.cpp index 99863bf0f5..f9650d83ae 100644 --- a/src/region_prism.cpp +++ b/src/region_prism.cpp @@ -29,6 +29,8 @@ RegPrism::RegPrism(int narg, char **arg) : Region(narg, arg) { + options(narg-11,&arg[11]); + if (strcmp(arg[2],"INF") == 0) { if (domain->box_exist == 0) error->all("Cannot use region INF when box does not exist"); diff --git a/src/region_sphere.cpp b/src/region_sphere.cpp index 91fcb1460a..c1a7eceacd 100644 --- a/src/region_sphere.cpp +++ b/src/region_sphere.cpp @@ -21,6 +21,8 @@ RegSphere::RegSphere(int narg, char **arg) : Region(narg, arg) { + options(narg-6,&arg[6]); + xc = xscale*atof(arg[2]); yc = yscale*atof(arg[3]); zc = zscale*atof(arg[4]); diff --git a/src/region_union.cpp b/src/region_union.cpp index 03f0e83e41..aac4be08bb 100644 --- a/src/region_union.cpp +++ b/src/region_union.cpp @@ -26,9 +26,13 @@ RegUnion::RegUnion(int narg, char **arg) : Region(narg, arg) { + if (narg < 5) error->all("Illegal region command"); + int n = atoi(arg[2]); + if (n < 2) error->all("Illegal region command"); + options(narg-(n+3),&arg[n+3]); + // build list of regions to union - int n = atoi(arg[2]); list = new int[n]; nregion = 0;