Skip to content

Issue with isolated systems #31

@mfherbst

Description

@mfherbst

Empirical potentials does not seem to work with isolated systems. Here is a reproducer. The first example work the second errors out with an InexactError Int(NaN).

using AtomsBase
using AtomsCalculators
using EmpiricalPotentials
using Unitful
using UnitfulAtomic

zH = 1
emins = Dict((zH, zH) => -1.17u"hartree", )
rmins = Dict((zH, zH) => 0.743u"Å", )
calc = LennardJones(emins, rmins, 5.0u"Å")

let
    cell_vectors = ([10.0, 0.0, 0.0]u"Å", [0.0, 10.0, 0.0]u"Å", [0.0, 0.0, 10.0]u"Å")
    periodic = periodic_system([:H => [0, 0, 1.]u"bohr",
                                :H => [0, 0, 3.]u"bohr"],
                               cell_vectors)
    AtomsCalculators.potential_energy(periodic, calc)
end
println("---  ok  ---")

let
    isolated = isolated_system([:H => [0, 0, 0.0]u"bohr",
                                :H => [0, 0, 1.9]u"bohr"])
    AtomsCalculators.potential_energy(isolated, calc)  # issue
end
println("---  this will not be reached  ---")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions