Closed tonimueller closed 5 years ago
We can stay with IsValid(), but we should still provide a more restrictive check as IsValidStrongCheck().
We actually use the strong check for a purpose in synchronize(). The isValid() check works safely only for a transition from a valid state to a new state, using a local move. Otherwise, if you set up something far from valid, and use isValid() to check, you risk segmentation fault or worse.
I get the point, but then new bonds can only be made between monomers which are next to each other. This is the wanted case for most purposes . The mismatch I see is, that refolded monomers influence monomers in the box for turned on periodic boundary conditions. So they see each other, but they can not make a connection!?
That is a valid point. We need to discuss this further. I feel like the issue somewhat delicate, because there is another example where using FastBondset::isValid() fails when bonds across boundaries is allowed, even during the simulation. In the case where the box is not 2**x and bonds across boundaries are allowed, the lookup mechanism gives wrong results.
I wrote another feature, which is a derived class of the FeatureBondset.h. The difference is the check in the synchronize function. In this way we can keep the IsValidStrongCheck and have a nice solution for connections between refolded monomers . The only thing to change in the original feature is that the "Bondsettyp bondset "has to be protected. (see fork #28 ).
I am thinking about if it would be a good idea to provide a additional FeatureMoleculesIO.h which uses the modified FeatureBondset.h ?
In the pull request #86 there is a feature FeatureMoleculesIOUnsaveCheck.h added which used the FeatureBondsetUnsaveCheck.h.
Up to now, the synchronize function in FeatureBondset uses the function IsValidStrongCheck() of FastBondset.h. For my pusposes this does not work and I have to use the IsValid() function.
Can we generally change this function?