Skip to content

Commit

Permalink
Merge pull request #78 from MineralsCloud/apply
Browse files Browse the repository at this point in the history
Use function-like object to apply EOS, deprecate `apply` methods
  • Loading branch information
singularitti authored Apr 12, 2020
2 parents 56fac57 + 4c5b2f0 commit e91d7ca
Show file tree
Hide file tree
Showing 13 changed files with 107 additions and 113 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "EquationsOfState"
uuid = "0438fec6-b81c-52d9-9651-d286848f50a8"
authors = ["Qi Zhang <[email protected]>"]
version = "2.0.0"
version = "3.0.0"

[deps]
ConstructionBase = "187b0558-2788-49d3-abe0-74a17ed4e7c9"
Expand Down
8 changes: 4 additions & 4 deletions docs/src/Collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ Vinet
## Public interfaces

```@docs
apply(::EnergyForm, eos::EquationOfState)
apply(::EnergyForm, eos::Murnaghan, v)
apply(::PressureForm, eos::Murnaghan, v)
apply(::BulkModulusForm, eos::BirchMurnaghan2nd, v)
(eos::EquationOfState)(eq::EquationForm)
(f::EquationOfStateOnVolume{<:Murnaghan,EnergyForm})(v)
(f::EquationOfStateOnVolume{<:Murnaghan,PressureForm})(v)
(f::EquationOfStateOnVolume{<:BirchMurnaghan2nd,BulkModulusForm})(v)
```
2 changes: 1 addition & 1 deletion docs/src/Find.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ experience, `P(V)` relation is usually a monotonic function. So we suggest using
## Usage

```julia
julia> using EquationsOfState, EquationsOfState.Collections, EquationsOfState.Find, Unitful, UnitfulAtomic
julia> using EquationsOfState.Collections, EquationsOfState.Find, Unitful, UnitfulAtomic

julia> pressures = collect(0:20:200) .* u"GPa";

Expand Down
2 changes: 1 addition & 1 deletion docs/src/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ platform to explain the following steps:
3. Run

```julia
julia> using EquationsOfState, EquationsOfState.Collections, EquationsOfState.Find, EquationsOfState.NonlinearFitting, Unitful, UnitfulAtomic
julia> using EquationsOfState.Collections, EquationsOfState.Find, EquationsOfState.NonlinearFitting, Unitful, UnitfulAtomic
```

and have fun!
Expand Down
1 change: 0 additions & 1 deletion docs/src/NonlinearFitting.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ for more information.
We provide API `lsqfit` currently.

```julia
using EquationsOfState
using EquationsOfState.Collections
using EquationsOfState.NonlinearFitting

Expand Down
4 changes: 2 additions & 2 deletions scripts/findvolume.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file plots the `findvolume.png` in docs
using Unitful, UnitfulAtomic, Plots
using EquationsOfState, EquationsOfState.Collections, EquationsOfState.Find
using EquationsOfState.Collections, EquationsOfState.Find

plotlyjs()

Expand All @@ -13,7 +13,7 @@ volumes = map(
plot(ustrip.(volumes), ustrip.(pressures), label = "pressures")
scatter!(
ustrip.(volumes),
ustrip.(u"GPa", apply(PressureForm(), eos).(volumes)),
ustrip.(u"GPa", eos(PressureForm()).(volumes)),
label = "P(V)",
dpi = 400,
)
Expand Down
Loading

0 comments on commit e91d7ca

Please sign in to comment.