From aaa8130e1f88b65d87551aae60f1748e3fb5681c Mon Sep 17 00:00:00 2001 From: CedricTravelletti Date: Thu, 11 Jan 2024 10:50:30 +0100 Subject: [PATCH] Cosmetic fixes. --- examples/H2.jl | 2 -- examples/H2_LJ.jl | 1 - examples/TiAl_EmpiricalPotentials.jl | 4 ++-- src/atomsbase_interface.jl | 1 - src/optimization.jl | 7 +++---- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/examples/H2.jl b/examples/H2.jl index fde1a51..4e97f41 100644 --- a/examples/H2.jl +++ b/examples/H2.jl @@ -1,5 +1,3 @@ -#= Test Geometry Optimization on an aluminium supercell. -=# using Printf using LinearAlgebra using DFTK diff --git a/examples/H2_LJ.jl b/examples/H2_LJ.jl index 30589db..594f05d 100644 --- a/examples/H2_LJ.jl +++ b/examples/H2_LJ.jl @@ -10,7 +10,6 @@ using AtomsBase using GeometryOptimization - bounding_box = 10.0u"angstrom" .* [[1, 0, 0.], [0., 1, 0], [0., 0, 1]] atoms = [:H => [0, 0, 0.0]u"bohr", :H => [0, 0, 1.9]u"bohr"] system = periodic_system(atoms, bounding_box) diff --git a/examples/TiAl_EmpiricalPotentials.jl b/examples/TiAl_EmpiricalPotentials.jl index 4fbef2c..0aa3a85 100644 --- a/examples/TiAl_EmpiricalPotentials.jl +++ b/examples/TiAl_EmpiricalPotentials.jl @@ -16,11 +16,11 @@ lj = LennardJones(-1.0u"meV", 3.1u"Å", 13, 13, 6.0u"Å") # Convert to AbstractSystem, so we have the `particles` attribute. particles = map(data) do atom Atom(; pairs(atom)...) - end +end system = AbstractSystem(data; particles) solver = OptimizationOptimJL.LBFGS() optim_options = (f_tol=1e-8, g_tol=1e-8, iterations=10, show_trace=true) -results = minimize_energy!(system, lj; solver=solver, optim_options...) +results = minimize_energy!(system, lj; solver, optim_options...) println(results) diff --git a/src/atomsbase_interface.jl b/src/atomsbase_interface.jl index 4af4859..83b5e25 100644 --- a/src/atomsbase_interface.jl +++ b/src/atomsbase_interface.jl @@ -35,7 +35,6 @@ end @doc raw""" Creates a new system based on ``system`` where the non clamped positions are updated to the ones provided (in the order in which they appear in the system). - """ function update_not_clamped_positions(system, positions::AbstractVector{<:Unitful.Length}) mask = not_clamped_mask(system) diff --git a/src/optimization.jl b/src/optimization.jl index 15ae57d..87f79af 100644 --- a/src/optimization.jl +++ b/src/optimization.jl @@ -7,10 +7,9 @@ export minimize_energy! """ - By default we work in cartesian coordinaes. - Note that internally, when optimizing the cartesian positions, atomic units - are used. - +By default we work in cartesian coordinaes. +Note that internally, when optimizing the cartesian positions, atomic units +are used. """ function Optimization.OptimizationFunction(system, calculator; kwargs...) mask = not_clamped_mask(system) # mask is assumed not to change during optim.