File tree Expand file tree Collapse file tree 1 file changed +5
-15
lines changed
Expand file tree Collapse file tree 1 file changed +5
-15
lines changed Original file line number Diff line number Diff line change 11module Inverse
22
33using PolynomialRoots: roots
4- using Roots: find_zero, Order16
4+ using Roots: find_zero, Order2
55using StaticArrays: MVector
66using UnPack: @unpack
77
@@ -144,25 +144,15 @@ function (eos⁻¹::Inverted{<:EnergyEquation{<:PoirierTarantola2nd}})(e)
144144 @assert false " Δ == (e - e0) / v0 / b0 == $Δ . this should never happen!"
145145 end
146146end
147- function (eos⁻¹:: Inverted{<:EquationOfStateOfSolids} )(
148- y;
149- search_interval = (eps (), 2 ),
150- maxiter = 40 ,
151- verbose = false ,
152- )
153- v0 = sum (extrema (search_interval)) / 2 * getparam (eos⁻¹. eos). v0 # v0 can be negative
154- @assert _ispositive (minimum (v0)) # No negative volume
147+ function (eos⁻¹:: Inverted{<:EquationOfStateOfSolids} )(y, x0; maxiter = 40 , verbose = false )
155148 v = find_zero (
156149 guess -> eos⁻¹. eos (guess) - y,
157- v0 ,
158- Order16 ();
150+ x0 ,
151+ Order2 ();
159152 maxevals = maxiter,
160153 verbose = verbose,
161154 )
162- if ! _ispositive (v)
163- @warn " the volume found is negative!"
164- end
165- return v
155+ return MVector (v... )
166156end
167157
168158function _strain2volume (
You can’t perform that action at this time.
0 commit comments