Skip to content

Commit 226ceb8

Browse files
committed
change tol
1 parent 9f44b23 commit 226ceb8

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

burnman/tools/equilibration.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,10 @@ def set_compositions_and_state_from_parameters(assemblage, parameters):
164164
i += 1
165165

166166
if not np.all(phase_amounts > -1.0e-8):
167+
print(assemblage)
168+
print(parameters)
167169
raise Exception(
168-
f"Phase amounts should be >-1.0e-8 but they are {repr(phase_amounts)}.\n"
169-
f"Parameters: {repr(parameters)}.\n"
170-
f"{repr(assemblage)}."
170+
f"Phase amounts should be >-1.0e-8 but they are {phase_amounts}."
171171
)
172172
phase_amounts = np.abs(phase_amounts)
173173
assemblage.n_moles = sum(phase_amounts)
@@ -218,7 +218,14 @@ def F(
218218
:returns: The vector corresponding to F(x).
219219
:rtype: numpy.array
220220
"""
221-
221+
if any(x == np.nan):
222+
raise Exception(
223+
f"Parameter values include np.nan for \n{assemblage}\n"
224+
f"Equality constraints: {equality_constraints}\n"
225+
f"Compositional vector: {reduced_composition_vector}\n"
226+
"Free compositional vectors: "
227+
f"{reduced_free_composition_vectors}."
228+
)
222229
set_compositions_and_state_from_parameters(assemblage, x)
223230
new_endmember_amounts = get_endmember_amounts(assemblage)
224231

misc/benchmarks/slb_2024_benchmarks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,9 @@ def check_fig_3_fcc_ferric_fper():
190190

191191
composition = {"Fe": 1.0, "O": 1.0}
192192
assemblage = Composite([bcc, fper, mag], [0.5, 0.49, 0.01])
193-
fper.set_composition([0.05, 0.0, 0.95])
193+
fper.set_composition([0.04, 0.01, 0.95])
194194
equality_constraints = [["P", 1.0e5], ["phase_fraction", (mag, 0.0)]]
195-
sol = equilibrate(composition, assemblage, equality_constraints, tol=1.0e-5)
195+
sol = equilibrate(composition, assemblage, equality_constraints)
196196
T_a_wu_mag = sol[0].assemblage.temperature
197197
print(f"BCC-fper-mag triple point at 1 bar: {T_a_wu_mag:.2f} K")
198198

0 commit comments

Comments
 (0)