From c6e989fd9251fbd5474ac8423e0a7901c8419204 Mon Sep 17 00:00:00 2001 From: Nicolas Riel <50235786+NicolasRiel@users.noreply.github.com> Date: Fri, 27 Dec 2024 17:03:44 +0100 Subject: [PATCH] MAGEMin_C v1.6.8 (#66) - Corrected issue when deactivating solution phase model that was leading to incorrect phase list --- Project.toml | 2 +- julia/MAGEMin_wrappers.jl | 15 ++++++++++++--- src/initialize.c | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/Project.toml b/Project.toml index 8d6a195..820c200 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "MAGEMin_C" uuid = "e5d170eb-415a-4524-987b-12f1bce1ddab" authors = ["Nicolas Riel & Boris Kaus "] -version = "1.6.7" +version = "1.6.8" [deps] CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82" diff --git a/julia/MAGEMin_wrappers.jl b/julia/MAGEMin_wrappers.jl index f9e112a..886bd88 100644 --- a/julia/MAGEMin_wrappers.jl +++ b/julia/MAGEMin_wrappers.jl @@ -1060,6 +1060,16 @@ function point_wise_minimization( P ::Float64, LibMAGEMin.reset_SS(gv,z_b, DB.SS_ref_db) LibMAGEMin.reset_sp(gv, DB.sp) + if ~isnothing(rm_list) + # if the list of phase to be removed is not empty then we first activate all combination + # the following entries are set to 2, as only values of 0 or 1 are considered in the C code + # i.e. that all phases are first set active before removing the ones in the list (with expection of the restricted ones) + gv.mbCpx = 2 + gv.mbIlm = 2 + gv.mpSp = 2 + gv.mpIlm = 2 + end + gv = LibMAGEMin.ComputeG0_point(gv.EM_database, z_b, gv, DB.PP_ref_db,DB.SS_ref_db); @@ -1071,14 +1081,13 @@ function point_wise_minimization( P ::Float64, flags_off = zeros(Int32,5); if i in rm_list unsafe_copyto!(SS_ref_db[i].ss_flags,pointer(flags_off), 5) - else - unsafe_copyto!(SS_ref_db[i].ss_flags,pointer(flags_on), 5) + # else + # unsafe_copyto!(SS_ref_db[i].ss_flags,pointer(flags_on), 5) end end end - # here we can over-ride default W's if ~isnothing(W) if gv.EM_database == W.database # check if the database fit diff --git a/src/initialize.c b/src/initialize.c index 2050e99..3a2f494 100644 --- a/src/initialize.c +++ b/src/initialize.c @@ -122,7 +122,7 @@ global_variable global_variable_alloc( bulk_info *z_b ){ } strcpy(gv.outpath,"./output/"); /** define the outpath to save logs and final results file */ - strcpy(gv.version,"1.6.1 [28/11/2024]"); /** MAGEMin version */ + strcpy(gv.version,"1.6.3 [05/01/2025]"); /** MAGEMin version */ /* generate parameters */ strcpy(gv.buffer,"none");