1#!/usr/local/bin/bash
2#
3# Copyright 2009-2011 The VOTCA Development Team (http://www.votca.org)
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9#     http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16#
17
18if [ "$1" = "--help" ]; then
19cat <<EOF
20${0##*/}, version %version%
21This script implements the initialization for every step in a generic way
22
23Usage: ${0##*/}
24EOF
25   exit 0
26fi
27
28sim_prog="$(csg_get_property cg.inverse.program)"
29otype="$(csg_get_property cg.inverse.optimizer.type)"
30
31#get new pot from last step and make it current potential
32for_all "non-bonded bonded" 'cp_from_last_step --rename $(csg_get_interaction_property name).pot.new $(csg_get_interaction_property name).pot.cur'
33
34cp_from_last_step --rename "${otype}.state.new" "${otype}.state.cur"
35if [[ $otype = cma ]]; then
36  cp_from_last_step --rename "${otype}.internal_state.new" "${otype}.internal_state.cur"
37fi
38
39#initialize sim_prog
40do_external initstep $sim_prog
41