From 88458d40828214fc32900dfad0d1ad348f594470 Mon Sep 17 00:00:00 2001 From: Christoph Ortner Date: Thu, 19 Sep 2024 05:13:24 -0700 Subject: [PATCH] addres mfh's comments --- src/utils/cells.jl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/utils/cells.jl b/src/utils/cells.jl index a0a762f..d246810 100644 --- a/src/utils/cells.jl +++ b/src/utils/cells.jl @@ -39,12 +39,12 @@ Implementation of a computational cell for particle systems """ struct PeriodicCell{D, T} cell_vectors::NTuple{D, SVector{D, T}} - pbc::NTuple{D, Bool} + periodicity::NTuple{D, Bool} end bounding_box(cell::PeriodicCell) = cell.cell_vectors -periodicity(cell::PeriodicCell) = cell.pbc +periodicity(cell::PeriodicCell) = cell.periodicity n_dimensions(::PeriodicCell{D}) where {D} = D @@ -62,7 +62,7 @@ PeriodicCell(cl::Union{AbstractSystem, PeriodicCell}) = function Base.show(io::IO, cϵll::PeriodicCell{D}) where {D} u = unit(first(cϵll.cell_vectors[1][1])) - print(io, "PeriodicCell(", prod(p -> p ? "T" : "F", cϵll.pbc), ", ") + print(io, "PeriodicCell(", prod(p -> p ? "T" : "F", periodicity(cϵll)), ", ") for d = 1:D print(io, ustrip.(cϵll.cell_vectors[d]), u) if d < D; print(io, ", "); end @@ -78,7 +78,7 @@ end # allowed input types that convert automatically to the # intended format for cell vectors, NTuple{D, SVector{D, T}} const AUTOBOX = Union{NTuple{D, <: AbstractVector}, - AbstractVector{<: AbstractVector}} where {D} + AbstractVector{<: AbstractVector}} where {D} # allowed input types that convert automatically to the # intended format for pbc, NTuple{D, Bool} @@ -105,7 +105,7 @@ _auto_cell_vectors(vecs::AbstractVector{<: AbstractVector}) = # different ways to construct PBC -_auto_pbc1(bc::Bool) = bc +_auto_pbc1(pbc::Bool) = pbc _auto_pbc1(::Nothing) = false _auto_pbc(bc::Tuple, cell_vectors = nothing) =