Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
yomichi committed Jun 10, 2024
1 parent edd3bc5 commit 26c0184
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/lattice/generate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ function generatelattice_std(param)
for site in usites
id = numsites_in_cell * icell + site.id
coord = latvec * (cellcoord .+ site.coord)
s = Site(id, ifelse(use_index_as_sitetype, id, site.sitetype), Int[], Int[], coord, site.id, cellcoord)
s = Site(id, ifelse(use_index_as_sitetype, id, site.sitetype), Int[], Int[],
coord, site.id, cellcoord)
push!(sites, s)
end
for bond in ubonds
Expand All @@ -124,12 +125,14 @@ function generatelattice_std(param)
target_coord = cellcoord .+ bond.target.offset
if all((0 .<= target_coord .< L) .|| bc)
source = numsites_in_cell * cellcoord + bond.source.id
target = numsites_in_cell * coord2index(cellcoord .+ bond.target.offset, L) + bond.target.id
target = numsites_in_cell *
coord2index(cellcoord .+ bond.target.offset, L) + bond.target.id
dir = latvec * ((bond.target.offset .+ usites[bond.target.id].coord)
.-
(bond.source.offset .+ usites[bond.source.id].coord))
ib += 1
b = Bond(ib, ifelse(use_index_as_bondtype, ib, bond.bondtype), source, target, dir)
b = Bond(ib, ifelse(use_index_as_bondtype, ib, bond.bondtype), source,
target, dir)
push!(bonds, b)
end
end
Expand Down

0 comments on commit 26c0184

Please sign in to comment.