Skip to content

Commit

Permalink
addres mfh's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Ortner committed Sep 19, 2024
1 parent e1ec17b commit 88458d4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/utils/cells.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)), ", ")

Check warning on line 65 in src/utils/cells.jl

View check run for this annotation

Codecov / codecov/patch

src/utils/cells.jl#L65

Added line #L65 was not covered by tests
for d = 1:D
print(io, ustrip.(cϵll.cell_vectors[d]), u)
if d < D; print(io, ", "); end
Expand All @@ -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}
Expand All @@ -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) =
Expand Down

0 comments on commit 88458d4

Please sign in to comment.