|
1 | 1 | import numpy as np, sys |
2 | | -from numba import njit |
3 | 2 | import equilipy.variables as var |
4 | 3 | import equilipy.equilifort as fort |
5 | 4 |
|
@@ -59,13 +58,6 @@ def system_check(cElementSys): |
59 | 58 | j+=1 |
60 | 59 | var.iElementSys=var.iElementSys[var.iElementSysIndex] |
61 | 60 |
|
62 | | - # #Identify species that can pass for the system |
63 | | - # lSpeciesPass = _get_species_pass(iElementPass) |
64 | | - # if sum(lSpeciesPass) == 0: |
65 | | - # lSpeciesPass = _get_endmembers(iElementPass) |
66 | | - # fort.moduleparsecs.lendmembers2species= True |
67 | | - # else: |
68 | | - # fort.moduleparsecs.lendmembers2species= False |
69 | 61 |
|
70 | 62 | lSpeciesPass = _get_endmembers(iElementPass) |
71 | 63 | fort.moduleparsecs.lendmembers2species= True |
@@ -108,56 +100,7 @@ def system_check(cElementSys): |
108 | 100 |
|
109 | 101 | return None |
110 | 102 |
|
111 | | -@njit |
112 | | -def _get_species_pass(iElementPass): |
113 | | - #This function identifies which species to be considered for a given system |
114 | | - |
115 | | - #Get elements not considered in the system |
116 | | - iElementNotPass= iElementPass.nonzero()[0] |
117 | | - |
118 | | - #First guess the species that need to be considered |
119 | | - res=np.sum(var.dStoichSpeciesCS[:,iElementNotPass],axis=1)<1E-15 |
120 | | - |
121 | | - # Refine the species based on solution phases |
122 | | - # Note that solution phase should have more than one endmember, otherwise remove the endmembers |
123 | | - |
124 | | - #Get solution index |
125 | | - IndexSoln=var.iPhaseCS[res] |
126 | | - n=len(res) |
127 | | - m = len(IndexSoln) |
128 | | - k=0 |
129 | | - |
130 | | - for i in range(n): |
131 | | - # Among the species that need to be passed in database |
132 | | - if res[i]: |
133 | | - if (k==0): |
134 | | - # Condition for the first endmembers |
135 | | - |
136 | | - if (IndexSoln[k]>0) and (IndexSoln[k]==IndexSoln[k+1]): |
137 | | - #If more than two endmembers are involved add the phase |
138 | | - res[i] = True |
139 | | - else: |
140 | | - res[i] = False |
141 | | - k+=1 |
142 | | - elif k==m-1: |
143 | | - # Condition for the last endmembers |
144 | | - if ((IndexSoln[k]>0) and (IndexSoln[k]==IndexSoln[k-1])): |
145 | | - # If more than two endmembers are involved add the phase |
146 | | - res[i] = True |
147 | | - else: |
148 | | - res[i] = False |
149 | | - k+=1 |
150 | | - elif k<m-1: |
151 | | - # Condition for endmembers that are inbetween |
152 | | - if (IndexSoln[k]!=IndexSoln[k-1]) and (IndexSoln[k]!=IndexSoln[k+1]) and (IndexSoln[k]>0): |
153 | | - res[i]=False |
154 | | - elif IndexSoln[k]==-1: |
155 | | - res[i]=False |
156 | | - k+=1 |
157 | | - |
158 | | - return res |
159 | 103 |
|
160 | | -@njit |
161 | 104 | def _get_endmembers(iElementPass): |
162 | 105 | #This function identifies which species to be considered for a given system |
163 | 106 |
|
|
0 commit comments