From 93f1a35b431303eb42cf335d9ddd9d34a114d6b9 Mon Sep 17 00:00:00 2001 From: Leandro Martinez Date: Mon, 30 Sep 2024 17:03:47 -0300 Subject: [PATCH] small changes --- Project.toml | 1 - src/constraints/boxes.jl | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Project.toml b/Project.toml index e7900a7..b7458d8 100644 --- a/Project.toml +++ b/Project.toml @@ -23,7 +23,6 @@ ForwardDiff = "0.10" NativeFileDialog = "0.2.1" PDBTools = "1.5.1" Packmol_jll = "20" -Parameters = "0.12" Random = "1.9" SPGBox = "0.5, 0.6, 0.7" StaticArrays = "1" diff --git a/src/constraints/boxes.jl b/src/constraints/boxes.jl index 4735828..2729801 100644 --- a/src/constraints/boxes.jl +++ b/src/constraints/boxes.jl @@ -12,16 +12,16 @@ weight_default[:box] = 5.0 # function orthogonal_wall(::Type{Inside}, center, side, weight, x) xc = x - center - if xc > side / 2 || xc < -side / 2 - return weight * (xc - side / 2)^2 - else + if -side / 2 < xc < side / 2 return zero(x) + else + return weight * (xc - side / 2)^2 end end function orthogonal_wall(::Type{Outside}, center, side, weight, x) xc = x - center - if xc < side / 2 && xc > -side / 2 + if -side / 2 < xc < side / 2 return weight * (xc - side / 2)^2 else return zero(x)