-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add :diagonal option to test_approx_equal #73
Conversation
Added option `:diagonal` to AtomsBaseTesting `test_approx_equal`. The current options are not compatible with Molly.jl (triclinic & DirichletZero) and I would like to test against a valid system. Also is `DirhichletZero` supposed to be a hard wall or infinite domain or something else? Doesn't really make a difference for Molly but its not really clear from docs and not something I've ever seen in a molecular simulation context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm.
Could you also use it one of the tests to ensure it's covered?
The dirichletzero is meant to be a zero bc at the end of the simulation cell. Makes sense for isolated systems. Potentially the cell is infinite, but might not be (e.g. finite element cases).
Add :diagonal to tests
Update runtests.jl
In that case, DirichletZero is not supported by Molly at all. For now I could add an option to make the test system purely periodic, but I'm also a little confused as to why |
What you can always do is warn the user about this and simply ignore the boundary condition (BC). Thus it will effectively always be periodic. The other option is to error out. I don't think it is a good idea to add an option to Molly to change the BC. Rather we should have a generic way in AtomsBase to change BCs.
Because the size of the simulation box and the BC are two different concepts. You can have periodic, dirichlet, neumann, ... BCs also for infinite cells. |
Tests should pass now. Sounds good, that shouldn't be too crazy to add right? I can make a different PR, but just to outline what I'm thinking:
|
Yes please do. I would not use a different function for this. We have "update constructors". Take a look at the atom implementation for example. We should do the same with systems. |
@mfherbst Turns out that constructor exists already, is there something else you were referring to than the code below? https://github.com/JuliaMolSim/AtomsBase.jl/blob/master/src/flexible_system.jl#L87 |
Indeed. Perfect. It seems all that's missing is a nice example in the documentation. @ejmeitz Would you mind adding one plus a bit of explanation? |
Already there in the tutorial guess I'm just blind. |
Added option
:diagonal
to AtomsBaseTestingtest_approx_equal
. The current options are not compatible with Molly.jl (triclinic & DirichletZero) and I would like to test against a valid system.Also is
DirhichletZero
supposed to be a hard wall or infinite domain or something else? Doesn't really make a difference for Molly but its not really clear from docs and not something I've ever seen in a molecular simulation context.