LeMonADE-project / LeMonADE

Library for Monte Carlo Simulation applying the Bond Fluctuation Model
Other
3 stars 11 forks source link

Bug in FeatureMoleculesIO with add_bonds and remove_bonds #88

Open tonimueller opened 5 years ago

tonimueller commented 5 years ago

After some nasty error messages by the FastBondset, which gives something like

getBondIdentifier doesnt exists for bond X Y Z 

where bond would exist after refolding, the bug comes visible. The issue occurs due to the FeatureMoleculesIOUnsave which uses FeatureBondsetUnsaveCheck and calls IsValid() in the sychronize function instead of IsValidStrongCheck() for the bonds. The Feature and the 'weaker' check is needed for creating networks with bonds between images of monomer in periodic boundaries. In most cases this will not lead to an error, but if two monomers are connected and the resulting bond vector is only valid after refolding and the monomer ids differ only by one, then the function WriteMCS called by AnalyzerWriteBFM try to linearize the system and uses the unrefolded vector to find the BondIdentifier. Hence the thing to be changed is the write class?!