LeMonADE-project / LeMonADE

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

IsValid or IsValidStrongCheck in FeatureBondset #25

Closed tonimueller closed 5 years ago

tonimueller commented 8 years ago

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?

Bondoki commented 8 years ago

We can stay with IsValid(), but we should still provide a more restrictive check as IsValidStrongCheck().

hrabbel commented 8 years ago

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.

tonimueller commented 8 years ago

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!?

hrabbel commented 8 years ago

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.

tonimueller commented 8 years ago

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 ).

tonimueller commented 7 years ago

I am thinking about if it would be a good idea to provide a additional FeatureMoleculesIO.h which uses the modified FeatureBondset.h ?

tonimueller commented 5 years ago

In the pull request #86 there is a feature FeatureMoleculesIOUnsaveCheck.h added which used the FeatureBondsetUnsaveCheck.h.