Skip to content

Commit

Permalink
Make is_rearranged compatible with by constructed arranged harmonic…
Browse files Browse the repository at this point in the history
… equations
  • Loading branch information
oameye committed Aug 8, 2023
1 parent de483f7 commit 000407a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/HarmonicEquation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,16 @@ $(TYPEDSIGNATURES)
Check if `eom` is rearranged to the standard form, such that the derivatives of the variables are on one side.
"""
function is_rearranged(eom::HarmonicEquation)
tvar = get_independent_variables(eom)[1]
tvar = get_independent_variables(eom)[1]; dvar = d(get_variables(eom), tvar);
lhs = getfield.(eom.equations, :lhs); rhs = getfield.(eom.equations, :rhs);

# Hopf-containing equations are arranged by construstion (impossible to check)
isequal(getfield.(eom.equations, :rhs), d(get_variables(eom), tvar)) || in("Hopf", getfield.(eom.variables, :type))
end
HB_bool = isequal(rhs, dvar)
hopf_bool = in("Hopf", getfield.(eom.variables, :type))
MF_bool = !any([occursin(str1,str2) for str1 in string.(dvar) for str2 in string.(lhs)])

# Hopf-containing equations or MF equation are arranged by construstion
HB_bool || hopf_bool || MF_bool
end

"""
$(TYPEDSIGNATURES)
Expand Down

0 comments on commit 000407a

Please sign in to comment.