Skip to content

Commit

Permalink
Rename EquationOfStateForm to EquationForm in src/
Browse files Browse the repository at this point in the history
  • Loading branch information
singularitti committed Sep 25, 2019
1 parent 0d36d79 commit 4b4536b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/FindVolume.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ using Roots: find_zero,
Newton,
ConvergenceFailed

import ..EquationOfStateForm
import ..EquationForm
using ..Collections: EquationOfState, apply

export findvolume

function findvolume(
form::EquationOfStateForm,
form::EquationForm,
eos::EquationOfState,
y::Real,
domain::Union{AbstractVector,Tuple},
Expand All @@ -42,7 +42,7 @@ function findvolume(
return find_zero(f, (minimum(domain), maximum(domain)), method)
end # function findvolume
function findvolume(
form::EquationOfStateForm,
form::EquationForm,
eos::EquationOfState,
y::Real,
domain::Union{AbstractVector,Tuple},
Expand All @@ -52,7 +52,7 @@ function findvolume(
return find_zero(f, median(domain), method)
end # function findvolume
function findvolume(
form::EquationOfStateForm,
form::EquationForm,
eos::EquationOfState,
y::Real,
domain::Union{AbstractVector,Tuple},
Expand Down
6 changes: 3 additions & 3 deletions src/NonlinearFitting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module NonlinearFitting

using LsqFit: curve_fit

import ..EquationOfStateForm
import ..EquationForm
using ..Collections

export lsqfit
Expand All @@ -24,15 +24,15 @@ export lsqfit
Fit an equation of state using least-squares fitting method (with the Levenberg-Marquardt algorithm).
# Arguments
- `form::EquationOfStateForm`: an `EquationOfStateForm` instance. If `EnergyForm`, fit ``E(V)``; if `PressureForm`, fit ``P(V)``; if `BulkModulusForm`, fit ``B(V)``.
- `form::EquationForm`: an `EquationForm` instance. If `EnergyForm`, fit ``E(V)``; if `PressureForm`, fit ``P(V)``; if `BulkModulusForm`, fit ``B(V)``.
- `eos::EquationOfState`: a trial equation of state.
- `xdata::AbstractVector`: a vector of volumes.
- `ydata::AbstractVector`: a vector of energies, pressures, or bulk moduli.
- `debug::Bool=false`: if `true`, then an `LsqFit.LsqFitResult` is returned, containing estimated Jacobian, residuals, etc.; if `false`, a fitted `EquationOfState` is returned. The default value is `false`.
- `kwargs`: the rest keyword arguments that will be sent to `LsqFit.curve_fit`. See its [documentation](https://github.com/JuliaNLSolvers/LsqFit.jl/blob/master/README.md).
"""
function lsqfit(
form::EquationOfStateForm,
form::EquationForm,
eos::E,
xdata::AbstractVector,
ydata::AbstractVector;
Expand Down
10 changes: 5 additions & 5 deletions src/prelude.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export EquationOfStateForm, EnergyForm, PressureForm, BulkModulusForm
export EquationForm, EnergyForm, PressureForm, BulkModulusForm

abstract type EquationOfStateForm end
struct EnergyForm <: EquationOfStateForm end
struct PressureForm <: EquationOfStateForm end
struct BulkModulusForm <: EquationOfStateForm end
abstract type EquationForm end
struct EnergyForm <: EquationForm end
struct PressureForm <: EquationForm end
struct BulkModulusForm <: EquationForm end

0 comments on commit 4b4536b

Please sign in to comment.