Closed ejmeitz closed 1 year ago
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 Infinite
is not just another boundary option? I see there is some support but its in a different part of the interface.
In that case, DirichletZero is not supported by Molly at all.
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.
I'm also a little confused as to why Infinite is not just another boundary option
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:
update_boundary_condition(sys::AbstractSystem, new_bc::Vector{Union{Periodic,DirichletZero})
and it just copies over the data from sys into a new AbstractSystem with the bc passed.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.