Skip to content

Commit

Permalink
let add_harmonic! return nothing (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
oameye authored Sep 15, 2024
1 parent 659d177 commit 75c8d73
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/DifferentialEquation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Harmonic ansatz: x(t) => ω;
"""
function add_harmonic!(diff_eom::DifferentialEquation, var::Num, ω)
push!.(Ref(diff_eom.harmonics[var]), ω)
return diff_eom
return nothing
end

"""
Expand Down
9 changes: 7 additions & 2 deletions src/modules/LimitCycles/gauge_fixing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ function add_pairs!(eom::DifferentialEquation, ω_lc::Num)
add_harmonic!(eom, var, ω + ω_lc)
add_harmonic!(eom, var, ω - ω_lc)
end
return nothing
end

"""
Expand All @@ -11,8 +12,12 @@ end
Add a limit cycle harmonic `ω_lc` to the system
Equivalent to adding `n` pairs of harmonics ω +- ω_lc for each existing ω.
"""
add_pairs!(eom::DifferentialEquation; ω_lc::Num, n::Int) =
[add_pairs!(eom, ω_lc) for k in 1:n]
function add_pairs!(eom::DifferentialEquation; ω_lc::Num, n::Int)
foreach(1:n) do k
add_pairs!(eom, ω_lc)
end
return nothing
end

"""
$(TYPEDSIGNATURES)
Expand Down

0 comments on commit 75c8d73

Please sign in to comment.