phase_update_function

The objectives of this function are multiple:

  • remove phase when fraction < 0.0

  • add phase when df < 0.0 and sum_xi > 1.0 (for solution phase only)

  • swap phase when n_phase = n_oxides and df < 0.0

  • make sure pure phase polymorph are correctly accounted for

  • update phase fraction when adding/removing phase using least square optimization

The core of the function revolves around book-keeping and the informations stored in PP_flags and SS_flags arrays

Those arrays store the state of the phases:

PP & SS_flags

SS/PP

IN

CSD

HLD

RMV

CYC

REIN

[0]

0/1

0/1

0/1

0/1

0/n

0/1

[1]

0/1

0/1

0/1

0/1

0/n

0/1

[2]

0/1

0/1

0/1

0/1

0/n

0/1

.

0/1

0/1

0/1

0/1

0/n

0/1

[m/n]

0/1

0/1

0/1

0/1

0/n

0/1

  • IN: allowed phase (satisfying bulk rock constraints)

  • CSD: considered phase (part of the active set of phases)

  • HLD: on hold (not in the active set but still scanned at every iteration)

  • RMV: removed (not considered anymore)

  • CYC: number of cycle

  • REIN: phase reintroduced

NOTES: 22/06/2021 -> This function should be reworked to make it more efficient/readable

int cmp_dbl(const void *a, const void *b)
[source]

compare double function

int cmp_int(const void *a, const void *b)
[source]

compare int function

global_variable check_PC(bulk_info z_b, global_variable gv, PP_ref *PP_ref_db, SS_ref *SS_ref_db, csd_phase_set *cp)
[source]

check PC driving force and add phase if below hyperplane

global_variable check_PC_driving_force(bulk_info z_b, global_variable gv, PP_ref *PP_ref_db, SS_ref *SS_ref_db, csd_phase_set *cp)
[source]

checks if the pseudocompounds generated during the levelling stage yield a negative driving force

global_variable phase_merge_function(bulk_info z_b, global_variable gv, PP_ref *PP_ref_db, SS_ref *SS_ref_db, csd_phase_set *cp)
[source]

Merge solution phase routine

global_variable phase_act2hold(bulk_info z_b, global_variable gv, PP_ref *PP_ref_db, SS_ref *SS_ref_db, csd_phase_set *cp)
[source]

from active to hold function

global_variable phase_hold2rmv(bulk_info z_b, global_variable gv, PP_ref *PP_ref_db, SS_ref *SS_ref_db, csd_phase_set *cp)
[source]

from active to hold function

global_variable phase_hold2act(bulk_info z_b, global_variable gv, PP_ref *PP_ref_db, SS_ref *SS_ref_db, csd_phase_set *cp)
[source]

from active to hold function

global_variable phase_update_function(bulk_info z_b, global_variable gv, PP_ref *PP_ref_db, SS_ref *SS_ref_db, csd_phase_set *cp)
[source]

main phase update routine