Commit d2d8b1ed authored by Christoph Junghans's avatar Christoph Junghans Committed by GitHub

Merge pull request #417 from votca/imc_regularization_fix

imc: make regularization group based
parents 9737f819 c8952eee
Pipeline #84542204 passed with stages
in 232 minutes and 38 seconds
......@@ -885,6 +885,7 @@ check_for_obsolete_xml_options() { #check xml file for obsolete options
cg.non-bonded.inverse.espresso.index1 cg.non-bonded.inverse.espresso.index2 cg.inverse.espresso.success \
cg.inverse.espresso.scriptdir cg.non-bonded.inverse.post_update_options.kbibi.type \
cg.inverse.imc.numpy.bin cg.inverse.imc.octave.bin cg.inverse.imc.matlab.bin cg.inverse.imc.solver \
cg.non-bonded.inverse.imc.reg \
; do
[[ -z "$(csg_get_property --allow-empty $i)" ]] && continue #filter me away
new=""
......@@ -909,6 +910,8 @@ check_for_obsolete_xml_options() { #check xml file for obsolete options
new="${i}.type";;
cg.inverse.convergence_check_options.limit)
new="cg.inverse.convergence_check.limit";;
cg.non-bonded.inverse.imc.reg)
new="cg.inverse.imc.<group>.reg";;
esac
[[ -n $new ]] && new="has been renamed to $new" || new="has been removed"
die "${FUNCNAME[0]}: The xml option $i $new\nPlease remove the obsolete options from the xmlfile"
......
......@@ -29,13 +29,17 @@ fi
sim_prog="$(csg_get_property cg.inverse.program)"
do_external imc_stat $sim_prog
default_reg=$(csg_get_property cg.inverse.imc.default_reg)
is_num "${default_reg}" || die "${0##*/}: value of cg.inverse.imc.default_reg should be a number"
imc_groups=$(csg_get_interaction_property --all inverse.imc.group)
imc_groups=$(remove_duplicate $imc_groups)
[[ -z ${imc_groups} ]] && die "${0##*/}: No imc groups defined"
reg="$(csg_get_interaction_property --all inverse.imc.reg)"
for group in $imc_groups; do
# currently this is a hack! need to create combined array
msg "solving linear equations for imc group '$group'"
reg="$(csg_get_property cg.inverse.imc.${group}.reg ${default_reg})" #filter me away
is_num "${reg}" || die "${0##*/}: value of cg.inverse.imc.${group}.reg should be a number"
msg "solving linear equations for imc group '$group' (regularization ${reg})"
critical csg_imcrepack --in ${group} --out ${group}.packed
critical csg_imc_solve --imcfile "${group}.packed.imc" --gmcfile "${group}.packed.gmc" --regularization "${reg}" --outputfile "${group}.packed.sol"
critical csg_imcrepack --in ${group}.packed --unpack ${group}.packed.sol
......
......@@ -260,6 +260,9 @@
</hoomd-blue>
<imc>
<DESC> general imc specific options </DESC>
<default_reg>0
<DESC> default magnitude for regularization parameter if not given for the group explicitly, default =0</DESC>
</default_reg>
</imc>
<lammps>
<DESC> general lammps specific options </DESC>
......@@ -538,9 +541,6 @@
<group>
<DESC>Group of interaction. Cross-correlations of all members of a group are taken into account for calculating the update. If no cross correlations should be calculated, interactions have to be put into different groups.</DESC>
</group>
<reg>0
<DESC> magnitude for regularization parameter, default =0</DESC>
</reg>
</imc>
<lammps>
<DESC>lammps specific options for this interations</DESC>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment