Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusion Regarding Volume Transfer for GEMC #528

Closed
ruyeli opened this issue Aug 2, 2024 · 3 comments
Closed

Confusion Regarding Volume Transfer for GEMC #528

ruyeli opened this issue Aug 2, 2024 · 3 comments

Comments

@ruyeli
Copy link

ruyeli commented Aug 2, 2024

Hello,

I am currently integrating a machine learning potential from my group with GOMC to evaluate its performance for GEMC simulations. While adapting the code to interface with our MLP, I've encountered an issue with the volume change mechanism in the VolumeTransfer::Transform() function defined in Volumetransfer.h.

The core of my issue lies in understanding how the max variable is calculated:

  if (GEMC_KIND == mv::GEMC_NVT) {
    double max = std::min(moveSetRef.Scale(bPick[0], mv::VOL_TRANSFER),
                          moveSetRef.Scale(bPick[1], mv::VOL_TRANSFER));
    if(isOrth) {
      coordCurrRef.VolumeTransferTranslate(state, newMolsPos, newCOMs, newDim,
                                           comCurrRef, max, bPick);
    } else {
      coordCurrRef.VolumeTransferTranslate(state, newMolsPos, newCOMs,
                                           newDimNonOrth, comCurrRef, max, bPick);
    }
  }

From what I gather, max serves as the control parameter for the volume change, dictating the range (-max, max) for random volume adjustments of one box while the other box scales correspondingly. However, I am unable to locate the moveSetRef.Scale() function within the source code. My current understanding, based on the code snippet moveSetRef.scale = chkObj.scaleVec; found in CheckpointSetup.cpp, suggests that max might be derived from previous volume change data stored in a checkpoint file, influencing the new volume change range.

Could you clarify how max is determined? Any insights or documentation regarding this would be greatly appreciated.

Thank you.

@LSchwiebert
Copy link
Collaborator

Your research project sounds very interesting. If you can share your results with us once you complete your work, that would be greatly appreciated.

Your understanding is correct for the case where we are restarting from a checkpoint file. In that case, we have some information about a good choice of a maximum volume transfer. In general, however, we adjust the maximum volume transfer based on the AdjSteps parameter in the configuration file. Every "AdjSteps" moves, we check the ratio of accepted Volume Transfers based on the number of attempted volume moves during that interval. If the ratio of accepted moves is greater than 50%, then we increase the maximum -- if the ratio is less than 50%, then we decrease the maximum.

If you take a look at issue #525 and the corresponding pull request #526, you can see that we recently changed the maximum volume transfer to avoid some rare cases where we could try to transfer too much volume. The simulation would terminate with an error message -- it would not produce incorrect results. If you look at pull request #526, you will see exactly where in the code the maximum volume transfer amount is computed.

This patch is not yet in the code, but I expect that we will merge it soon into the development branch, and hopefully in the near future release a new version of GOMC.

If you have further questions about this or other aspects of the code, please feel free to ask. (For questions about other aspects of the code, please open a new issue. You may close this issue once you decide that it has been fully answered.)

@ruyeli
Copy link
Author

ruyeli commented Aug 3, 2024

Thank you for your insights and for taking the time to explain the code! I totally understand now. I appreciate your interest in our project and will certainly share our findings with you once our research is complete.

@ruyeli ruyeli closed this as completed Aug 3, 2024
@LSchwiebert
Copy link
Collaborator

Glad that explanation was sufficient.

Thanks. Looking forward to seeing the results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants