Skip to content

Commit

Permalink
Extend Base.getproperty for :b′0 & :b′′0
Browse files Browse the repository at this point in the history
  • Loading branch information
singularitti committed Apr 12, 2020
1 parent de4667b commit 1d733e2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Collections.jl
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,16 @@ function Base.:(==)(x::T, y::T) where {T<:EquationOfState}
return all(getfield(x, i) == getfield(y, i) for i in 1:fieldcount(T))
end

function Base.getproperty(eos::EquationOfState, name::Symbol)
if name (:bp0, :bd0)
return getfield(eos, :b′0)
elseif name (:bpp0, :bdd0)
return getfield(eos, :b′′0)
else
return getfield(eos, name)
end
end

Unitful.upreferred(::typeof(dimension(u"J"))) = u"eV"
Unitful.upreferred(::typeof(dimension(u"m^3"))) = u"angstrom^3"
Unitful.upreferred(::typeof(dimension(u"Pa"))) = u"eV/angstrom^3"
Expand Down

0 comments on commit 1d733e2

Please sign in to comment.