Skip to content
This repository has been archived by the owner on Sep 27, 2021. It is now read-only.

Commit

Permalink
Dropped thermforce iteration method (fixes #172)
Browse files Browse the repository at this point in the history
  • Loading branch information
junghans committed Nov 16, 2015
1 parent ac8117d commit e120bcf
Show file tree
Hide file tree
Showing 14 changed files with 21 additions and 277 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ env:
- CSG_MDRUN_STEPS=500 TEST=spce/simplex/density J=4
- CSG_MDRUN_STEPS=500 TEST=spce/simplex/pressure J=4
- CSG_MDRUN_STEPS=500 TEST=spce/simplex/simple J=4
- CSG_MDRUN_STEPS=500 TEST=spce/tf J=4
- CSG_MDRUN_STEPS=500 TEST=urea-water/ibi J=4
- CSG_MDRUN_STEPS=500 TEST=urea-water/kb-ibi J=4

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ For more detailed information about the changes see the history of the [reposito
## Version 1.4-dev
* dropped support for gromacs-4 and clean up
* dropped multi_g_rdf script
* dropped thermforce iteration method

## Version 1.3_rc1 _SuperUzma_ (released 23.09.15)

Expand Down
98 changes: 0 additions & 98 deletions share/scripts/inverse/calc_thermforce.sh

This file was deleted.

14 changes: 1 addition & 13 deletions share/scripts/inverse/csg_table
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2009-2011 The VOTCA Development Team (http://www.votca.org)
# Copyright 2009-2015 The VOTCA Development Team (http://www.votca.org)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -27,16 +27,13 @@ csg master inverse.sh
prepare ibi prepare_generic.sh
prepare imc prepare_imc.sh
prepare generic prepare_generic.sh
prepare tf prepare_generic.sh
prepare optimizer prepare_optimizer.sh
prepare re prepare_re.sh
prepare_single ibi prepare_generic_single.sh
prepare_single imc prepare_generic_single.sh
prepare_single tf prepare_generic_single.sh
prepare_single optimizer prepare_optimizer_single.sh
initstep ibi initialize_step_generic.sh
initstep imc initialize_step_generic.sh
initstep tf initialize_step_generic.sh
initstep optimizer initialize_step_optimizer.sh
initstep re initialize_step_re.sh

Expand All @@ -50,7 +47,6 @@ update ibm update_ibm.sh
# TODO: think about name add_pot, is other name maybe better
add_pot ibi add_pot_generic.sh
add_pot imc add_pot_generic.sh
add_pot tf add_pot_generic.sh
add_pot optimizer dummy.sh
add_pot re dummy.sh

Expand All @@ -59,19 +55,16 @@ add_pot re dummy.sh
# pre update
pre_update ibi dummy.sh
pre_update imc dummy.sh
pre_update tf dummy.sh
pre_update optimizer dummy.sh
pre_update re pre_update_re.sh

# post update
post_update ibi post_update_generic.sh
post_update imc post_update_generic.sh
post_update tf post_update_generic.sh
post_update optimizer dummy.sh
post_update re post_update_generic.sh
post_update_single ibi post_update_generic_single.sh
post_update_single imc post_update_generic_single.sh
post_update_single tf post_update_generic_single.sh
post_update_single re post_update_re_single.sh

#post update scripts
Expand Down Expand Up @@ -124,11 +117,6 @@ solve numpy linsolve.py

imc purify imc_purify.sh

# tf specific stuff
update tf update_tf.sh
update tf_single update_tf_single.sh
calc thermforce calc_thermforce.sh

# optimzer(generic) stuff
optimizer prepare_state optimizer_prepare_state.sh
optimizer parameters_to_potential optimizer_parameters_to_potential.sh
Expand Down
4 changes: 1 addition & 3 deletions share/scripts/inverse/functions_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,6 @@ csg_get_interaction_property () { #gets an interaction property from the xml fil
done
[[ -z $ret ]] && die "${FUNCNAME[0]}: Could not find a bonded definition with name '$bondname' in the mapping file(s) '$mapping'. Make sure to use the same name in the settings file (or --ia-name when calling from csg_call) and the mapping file."
echo "$ret"
elif [[ -n $CSGXMLFILE && $(csg_get_property --allow-empty cg.inverse.method) = "tf" ]]; then
echo "thermforce"
else
echo "$bondtype"
fi
Expand All @@ -294,7 +292,7 @@ csg_get_interaction_property () { #gets an interaction property from the xml fil

#map bondtype back to tags in xml file (for csg_call)
case "$bondtype" in
"non-bonded"|"thermforce")
"non-bonded")
xmltype="non-bonded";;
"bonded"|"bond"|"angle"|"dihedral")
xmltype="bonded";;
Expand Down
2 changes: 0 additions & 2 deletions share/scripts/inverse/postupd_pressure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ fi

[[ -f $2 ]] && die "${0##*/}: $2 is already there"

[[ $(csg_get_interaction_property bondtype) = "thermforce" ]] && die "${0##*/}: pressure correction for thermforce makes no sense!"

step_nr="$(get_current_step_nr)"
sim_prog="$(csg_get_property cg.inverse.program)"
[[ $sim_prog != gromacs ]] && die "${0##*/}: pressure correction for ${sim_prog} is not implemented yet!"
Expand Down
4 changes: 1 addition & 3 deletions share/scripts/inverse/potential_extrapolate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ EOF

clean="no"
pot_type="$2"
pot_types="non-bonded bond thermforce angle dihedral"
pot_types="non-bonded bond angle dihedral"
avg_points=3

### begin parsing options
Expand Down Expand Up @@ -77,8 +77,6 @@ if [[ $pot_type = "non-bonded" ]]; then
intermediate="$(critical mktemp "${input}.onlyleft.XXXXX")"
do_external table extrapolate --function exponential --avgpoints $avg_points --region left "${input}" "${intermediate}"
do_external table extrapolate --function constant --avgpoints 1 --region right "${intermediate}" "${output}"
elif [[ $pot_type = "thermforce" ]]; then
do_external table extrapolate --function constant --avgpoints $avg_points --region leftright "${input}" "${output}"
elif [[ $pot_type = "bond" || $pot_type = "angle" || $pot_type = "dihedral" ]]; then
do_external table extrapolate --function linear --avgpoints $avg_points --region leftright "${input}" "${output}"
else
Expand Down
2 changes: 1 addition & 1 deletion share/scripts/inverse/potential_shift.pl
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
(readin_table($infile,@r,@dpot,@flag,$comments)) || die "$progname: error at readin_table\n";

my $zero=undef;
if (( "$type" eq "non-bonded" ) or ("$type" eq "thermforce" )) {
if ( "$type" eq "non-bonded" ) {
$zero=$dpot[$#r];
}
elsif (( "$type" eq "bond" ) or ("$type" eq "dihedral") or ("$type" eq "angle") or ("$type" eq "bonded")) {
Expand Down
2 changes: 1 addition & 1 deletion share/scripts/inverse/potential_to_gromacs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ if [[ $tabtype = "non-bonded" ]]; then
elif [[ -z $tablend ]]; then
die "${0##*/}: cg.inverse.gromacs.table_end was not defined in xml seeting file"
fi
elif [[ $tabtype = "bond" || $tabtype = "thermforce" ]]; then
elif [[ $tabtype = "bond" ]]; then
tablend="$(csg_get_property cg.inverse.gromacs.table_end)"
elif [[ $tabtype = "angle" ]]; then
tablend=180
Expand Down
37 changes: 14 additions & 23 deletions share/scripts/inverse/prepare_generic_single.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,28 +47,19 @@ if [[ -f ${main_dir}/${name}.pot.in ]]; then
else
target=$(csg_get_interaction_property inverse.target)
msg "Using initial guess from dist ${target} for ${name}"
if [[ $bondtype = "thermforce" ]]; then
#therm force is resampled later and as one want to symetrize 1d density
cp_from_main_dir --rename "$(csg_get_interaction_property inverse.target)" "${name}.dist.tgt"
#initial guess from density
raw="$(critical mktemp -u ${name}.pot.new.raw.XXX)"
do_external calc thermforce ${name}.dist.tgt ${raw}
do_external table change_flag "${raw}" "${output}"
else
#resample target dist
do_external resample target "$(csg_get_interaction_property inverse.target)" "${name}.dist.tgt"
# initial guess from rdf
raw="$(critical mktemp ${name}.pot.new.raw.XXX)"
kbt="$(csg_get_property cg.inverse.kBT)"
dist_min="$(csg_get_property cg.inverse.dist_min)"
do_external dist invert --type "${bondtype}" --kbT "${kbt}" --min "${dist_min}" ${name}.dist.tgt ${raw}
smooth="$(critical mktemp ${name}.pot.new.smooth.XXX)"
critical csg_resample --in ${raw} --out ${smooth} --grid ${min}:${step}:${max} --comment "${comment}"
extrapolate="$(critical mktemp ${name}.pot.new.extrapolate.XXX)"
do_external potential extrapolate --type "$bondtype" "${smooth}" "${extrapolate}"
shifted="$(critical mktemp ${name}.pot.new.shifted.XXX)"
do_external potential shift --type "${bondtype}" ${extrapolate} ${shifted}
do_external table change_flag "${shifted}" "${output}"
fi
#resample target dist
do_external resample target "$(csg_get_interaction_property inverse.target)" "${name}.dist.tgt"
# initial guess from rdf
raw="$(critical mktemp ${name}.pot.new.raw.XXX)"
kbt="$(csg_get_property cg.inverse.kBT)"
dist_min="$(csg_get_property cg.inverse.dist_min)"
do_external dist invert --type "${bondtype}" --kbT "${kbt}" --min "${dist_min}" ${name}.dist.tgt ${raw}
smooth="$(critical mktemp ${name}.pot.new.smooth.XXX)"
critical csg_resample --in ${raw} --out ${smooth} --grid ${min}:${step}:${max} --comment "${comment}"
extrapolate="$(critical mktemp ${name}.pot.new.extrapolate.XXX)"
do_external potential extrapolate --type "$bondtype" "${smooth}" "${extrapolate}"
shifted="$(critical mktemp ${name}.pot.new.shifted.XXX)"
do_external potential shift --type "${bondtype}" ${extrapolate} ${shifted}
do_external table change_flag "${shifted}" "${output}"
fi

5 changes: 1 addition & 4 deletions share/scripts/inverse/table_to_xvg.pl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
--max MAX Replace all pot value bigger MAX by MAX
Possible types: non-bonded (=C12), bond, thermforce, C12, C6, CB, angle, dihedral
Possible types: non-bonded (=C12), bond, C12, C6, CB, angle, dihedral
Examples:
* $progname --type bond table.in table_b0.xvg
Expand Down Expand Up @@ -130,9 +130,6 @@
$begin=-180;
$end=180;
}
elsif ( "$type" eq "thermforce" ){
$fmt="%15.10e %15.10e %15.10e\n";
}
else{
die "$progname: Unsupported type of interatction: $type -> go and implement it\n";
}
Expand Down
28 changes: 0 additions & 28 deletions share/scripts/inverse/update_tf.sh

This file was deleted.

Loading

0 comments on commit e120bcf

Please sign in to comment.