Commit b241294e authored by Anne Gunn's avatar Anne Gunn
Browse files

Corrected two issues in code identified by valgrind:

1) memory leaks (the subject of the original #1109) and
2) an invalid memory access (reading from beyond the end of an array).

Also:
- replaced several dynamically-allocated (calloc and free) local arrays with std::vector.
- reorganized include statements per new conventions, and
- updated messages to use strings and fmt.

Added folders and files used in manual testing and verification to examples folder.

No changes in analysis results are expected or intended. This is pure refactoring except for a bit of error message cleanup.
parent 3be06474
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
This folder contains a variety of input/output files for the
USER-BOCS code that exercises both error handling and all three
analysis modes (analytic, linear spline, and cubic spline).

In the absence of automated testing, the bash script, runTests.sh
may be used to generate a folder of log files which can be
compared to the baseline file set in logsCompareFileSet to
look for material changes.
+45 −0
Original line number Diff line number Diff line
## Parameters initialization

units 		real
atom_style 	full

pair_style	table linear 1000
bond_style      table linear 1000
angle_style     table linear 1000
dihedral_style  none
improper_style  none
kspace_style    none

boundary 	p p p
dimension 	3
newton 		on

read_data	data.cgheptane

pair_coeff 1 1 lammps_CT_CT.table LJLJ 12.0
pair_coeff 1 2 lammps_CT_CM.table LJLJ 12.0
pair_coeff 2 2 lammps_CM_CM.table LJLJ 12.0

## Parameters initialization
velocity 	all create 303.0 123456 dist gaussian

## Neighbor list settings
neigh_modify 	delay 0 every 1 check yes one 10000
neighbor 	12.0 bin

## Integrator
timestep 	1.0
run_style 	verlet

## Thermodynamics output
thermo 		100
thermo_style    custom step temp pe etotal press vol

## Set various fixes
#fix 		1 all bocs temp 303.0 303.0 100.0 cgiso 0.986 0.986 1000.0 analytic 296811.5 3600 2 84177.42 -101579.68 0.0
fix             1 all bocs temp 303.0 303.0 100.0 cgiso 0.986 0.986 1000.0 analytic delta_Fv.dat
# This makes lammps print the CG-P pressure rather than the raw pressure
thermo_modify press 1_press

## Run
run 1000
+45 −0
Original line number Diff line number Diff line
## Parameters initialization

units 		real
atom_style 	full

pair_style	table linear 1000
bond_style      table linear 1000
angle_style     table linear 1000
dihedral_style  none
improper_style  none
kspace_style    none

boundary 	p p p
dimension 	3
newton 		on

read_data	data.cgheptane

pair_coeff 1 1 lammps_CT_CT.table LJLJ 12.0
pair_coeff 1 2 lammps_CT_CM.table LJLJ 12.0
pair_coeff 2 2 lammps_CM_CM.table LJLJ 12.0

## Parameters initialization
velocity 	all create 303.0 123456 dist gaussian

## Neighbor list settings
neigh_modify 	delay 0 every 1 check yes one 10000
neighbor 	12.0 bin

## Integrator
timestep 	1.0
run_style 	verlet

## Thermodynamics output
thermo 		100
thermo_style    custom step temp pe etotal press vol

## Set various fixes
#fix 		1 all bocs temp 303.0 303.0 100.0 cgiso 0.986 0.986 1000.0 analytic 296811.5 3600 2 84177.42 -101579.68 0.0
fix             1 all bocs temp 303.0 303.0 100.0 cgiso 0.986 0.986 1000.0 cubic_spline delta_Fv_badbad.dat
# This makes lammps print the CG-P pressure rather than the raw pressure
thermo_modify press 1_press

## Run
run 1000
+45 −0
Original line number Diff line number Diff line
## Parameters initialization

units 		real
atom_style 	full

pair_style	table linear 1000
bond_style      table linear 1000
angle_style     table linear 1000
dihedral_style  none
improper_style  none
kspace_style    none

boundary 	p p p
dimension 	3
newton 		on

read_data	data.cgheptane

pair_coeff 1 1 lammps_CT_CT.table LJLJ 12.0
pair_coeff 1 2 lammps_CT_CM.table LJLJ 12.0
pair_coeff 2 2 lammps_CM_CM.table LJLJ 12.0

## Parameters initialization
velocity 	all create 303.0 123456 dist gaussian

## Neighbor list settings
neigh_modify 	delay 0 every 1 check yes one 10000
neighbor 	12.0 bin

## Integrator
timestep 	1.0
run_style 	verlet

## Thermodynamics output
thermo 		100
thermo_style    custom step temp pe etotal press vol

## Set various fixes
#fix 		1 all bocs temp 303.0 303.0 100.0 cgiso 0.986 0.986 1000.0 analytic 296811.5 3600 2 84177.42 -101579.68 0.0
fix             1 all bocs temp 303.0 303.0 100.0 cgiso 0.986 0.986 1000.0 cubic_spline bad_file_name.dat
# This makes lammps print the CG-P pressure rather than the raw pressure
thermo_modify press 1_press

## Run
run 1000
+45 −0
Original line number Diff line number Diff line
## Parameters initialization

units 		real
atom_style 	full

pair_style	table linear 1000
bond_style      table linear 1000
angle_style     table linear 1000
dihedral_style  none
improper_style  none
kspace_style    none

boundary 	p p p
dimension 	3
newton 		on

read_data	data.cgheptane

pair_coeff 1 1 lammps_CT_CT.table LJLJ 12.0
pair_coeff 1 2 lammps_CT_CM.table LJLJ 12.0
pair_coeff 2 2 lammps_CM_CM.table LJLJ 12.0

## Parameters initialization
velocity 	all create 303.0 123456 dist gaussian

## Neighbor list settings
neigh_modify 	delay 0 every 1 check yes one 10000
neighbor 	12.0 bin

## Integrator
timestep 	1.0
run_style 	verlet

## Thermodynamics output
thermo 		100
thermo_style    custom step temp pe etotal press vol

## Set various fixes
#fix 		1 all bocs temp 303.0 303.0 100.0 cgiso 0.986 0.986 1000.0 analytic 296811.5 3600 2 84177.42 -101579.68 0.0
fix             1 all bocs temp 303.0 303.0 100.0 cgiso 0.986 0.986 1000.0 cubic_spline delta_Fv.dat
# This makes lammps print the CG-P pressure rather than the raw pressure
thermo_modify press 1_press

## Run
run 200
Loading