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

Commit

Permalink
Merge pull request #430 from votca/imc_drop_crop
Browse files Browse the repository at this point in the history
imc: drop crop potential
  • Loading branch information
junghans committed Oct 9, 2019
2 parents 1183a6f + b66d867 commit b9b032f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 167 deletions.
3 changes: 1 addition & 2 deletions share/scripts/inverse/csg_table
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ convergence_check default convergence_check_default.sh

# table preparation
resample target resample_target.sh
dpot crop dpot_crop.pl

# ibi specific stuff
update ibi update_ibi.sh
Expand All @@ -110,7 +109,7 @@ update ibi_pot update_ibi_pot.pl

# imc specific stuff
update imc update_imc.sh
imc purify imc_purify.sh
update imc_single update_imc_single.sh

# optimzer(generic) stuff
optimizer prepare_state optimizer_prepare_state.sh
Expand Down
113 changes: 0 additions & 113 deletions share/scripts/inverse/dpot_crop.pl

This file was deleted.

33 changes: 0 additions & 33 deletions share/scripts/inverse/imcdata_from_blocks.octave

This file was deleted.

2 changes: 1 addition & 1 deletion share/scripts/inverse/update_imc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ for group in $imc_groups; do
critical csg_imc_solve --imcfile "${group}.imc" --gmcfile "${group}.gmc" --idxfile "${group}.idx" --regularization "${reg}"
done

for_all "non-bonded bonded" do_external imc purify
for_all "non-bonded bonded" do_external update imc_single
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
#
# Copyright 2009-2011 The VOTCA Development Team (http://www.votca.org)
# Copyright 2009-2019 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 All @@ -18,37 +18,32 @@
if [ "$1" = "--help" ]; then
cat <<EOF
${0##*/}, version %version%
This scripts cleans up the dpot tables for each interaction when using IMC
This scripts multiplies the dpot tables for each interaction when using IMC by kBT
and handles potential update schemes
Usage: ${0##*/}
EOF
exit 0
fi

name=$(csg_get_interaction_property name)
min=$(csg_get_interaction_property min)
max=$(csg_get_interaction_property max)
step=$(csg_get_interaction_property step)
kBT=$(csg_get_property cg.inverse.kBT)
bondtype="$(csg_get_interaction_property bondtype)"

echo "purifying dpot for $name"

comment="$(get_table_comment)"
critical csg_resample --in ${name}.dpot.imc --out ${name}.dpot.impure --grid ${min}:${step}:${max} --comment "$comment"
step_nr=$(get_current_step_nr)
scheme=( $(csg_get_interaction_property inverse.do_potential) )
scheme_nr=$(( ( $step_nr - 1 ) % ${#scheme[@]} ))
name=$(csg_get_interaction_property name)

if [ "${scheme[$scheme_nr]}" = 1 ]; then
echo "Update potential ${name} : yes"
do_external table linearop --withflag o ${name}.dpot.impure ${name}.dpot.impure 0 0
do_external table linearop --withflag i ${name}.dpot.impure ${name}.dpot.impure $kBT 0
kBT=$(csg_get_property cg.inverse.kBT)
is_num "${kBT}" || die "${0##*/}: cg.inverse.kBT should be a number, but found '$kBT'"
do_external table linearop "${name}.dpot.imc" "${name}.dpot.imc.kBT" "$kBT" 0

do_external dpot crop ${name}.dpot.impure ${name}.dpot.after_crop
do_external potential shift --type "${bondtype}" ${name}.dpot.after_crop ${name}.dpot.new
bondtype="$(csg_get_interaction_property bondtype)"
do_external potential shift --type "${bondtype}" "${name}.dpot.imc.kBT" "${name}.dpot.new"
else
echo "Update potential ${name} : no"
do_external table linearop ${name}.dpot.impure ${name}.dpot.new 0 0
min=$(csg_get_interaction_property min)
max=$(csg_get_interaction_property max)
step=$(csg_get_interaction_property step)
do_external table dummy "${min}:${step}:${max}" "${name}.dpot.new"
fi

0 comments on commit b9b032f

Please sign in to comment.