Skip to content

Commit

Permalink
fix syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
albert-de-montserrat committed Sep 20, 2024
1 parent 3e0f29b commit c127d86
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/phases/phases.jl
Original file line number Diff line number Diff line change
Expand Up @@ -131,18 +131,18 @@ end
end

for ip in cellaxes(phases)
p = @index(pxi[1][ip, cell_index...]), @index(pxi[2][ip, cell_index...]), @index(pxi[3][ip, cell_index...])
p = @cell(pxi[1][ip, cell_index...]), @cell(pxi[2][ip, cell_index...]), @cell(pxi[3][ip, cell_index...])
any(isnan, p) && continue
x = @inline bilinear_weight(cell_vertex, p, di)
ph_local = @index phases[ip, cell_index...]
ph_local = @cell phases[ip, cell_index...]
# this is doing sum(w * δij(i, phase)), where δij is the Kronecker delta
w = w .+ x .* ntuple(j -> (ph_local == j), NC)
end
end

w = w .* inv(sum(w))
for ip in cellaxes(ratio_vertices)
@index ratio_vertices[ip, I...] = w[ip]
@cell ratio_vertices[ip, I...] = w[ip]
end

return nothing
Expand All @@ -165,18 +165,18 @@ end
end

for ip in cellaxes(phases)
p = @index(pxi[1][ip, cell_index...]), @index(pxi[2][ip, cell_index...])
p = @cell(pxi[1][ip, cell_index...]), @cell(pxi[2][ip, cell_index...])
any(isnan, p) && continue
x = @inline bilinear_weight(cell_vertex, p, di)
ph_local = @index phases[ip, cell_index...]
ph_local = @cell phases[ip, cell_index...]
# this is doing sum(w * δij(i, phase)), where δij is the Kronecker delta
w = w .+ x .* ntuple(j -> (ph_local == j), NC)
end
end

w = w .* inv(sum(w))
for ip in cellaxes(ratio_vertices)
@index ratio_vertices[ip, I...] = w[ip]
@cell ratio_vertices[ip, I...] = w[ip]
end

return nothing
Expand Down

0 comments on commit c127d86

Please sign in to comment.