ISLEC  Version 4.2
test_load.c
Go to the documentation of this file.
1 /* src/test_load.c
2  *
3  * Copyright (C) 2011-2018 Dongdong Li
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundataion; either version 3 of the License, or (at
8  * your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABLITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  */
19 
31 extern bool test_load ()
32 {
33  if (phases.aqueous == NULL || phases.solidsolution == NULL)
34  {
35  printf ("There is no PHASES defined\n");
36  return false;
37  }
38 
39  int i;
40 
41  printf ("COMPONENTS %d\n", total_comp_num);
42 
43  for (i = 0; i < total_comp_num; i++)
44  {
45  printf (" %s\t%d\t%0.3lf\n", components[i].element_symbol,
46  components[i].element_number,
47  components[i].element_mass);
48  }
49 
50  printf ("PHASES %d %d %d %d\n", gas_phase_num, aqueous_phase_num,
52 
53  for (i = 0; i < gas_phase_num; i++)
54  {
55  printf ("GAS %d\n", phases.gas[i].species_num);
56 
57  int j;
58 
59  for (j = 0; j < phases.gas[i].species_num; j++)
60  {
61  printf (" %s %d\n", phases.gas[i].gas_species[j].species_symbol,
63 
64  int k;
65  for (k = 0; k < total_comp_num; k++)
66  {
67  printf (" %0.0lf", phases.gas[i].gas_species[j].elements[k]);
68  }
69  printf ("\n");
70  printf (" %0.6lf %0.6lf %0.6lf %0.6lf %0.6lf %0.6lf %0.6lf\n",
78  }
79  }
80 
81  for (i = 0; i < aqueous_phase_num; i++)
82  {
83  printf ("AQUEOUS %d\n", phases.aqueous[i].species_num);
84 
85  int j;
86 
87  for (j = 0; j < phases.aqueous[i].species_num; j++)
88  {
89  printf (" %s %d\n", phases.aqueous[i].aqueous_species[j].species_symbol,
91 
92  int k;
93  for (k = 0; k < total_comp_num; k++)
94  {
95  printf (" %0.0lf", phases.aqueous[i].aqueous_species[j].elements[k]);
96  }
97  printf ("\n");
98  printf (" %0.6lf %0.6lf %0.6lf %0.6lf %0.6lf %0.6lf %0.6lf\n",
106  }
107 
108  printf (" %d\n", phases.aqueous[i].ii_bin_param_num);
109  for (j = 0; j < phases.aqueous[i].ii_bin_param_num; j++)
110  {
111  printf (" %s %s %0.1lf %0.1lf\n", phases.aqueous[i].ii_bin_params[j].species_s1,
115 
116  printf (" %0.6lf %0.6lf %0.6lf %0.6lf %0.6lf %0.6lf\n",
117  phases.aqueous[i].ii_bin_params[j].B0ss[0],
118  phases.aqueous[i].ii_bin_params[j].B0ss[1],
119  phases.aqueous[i].ii_bin_params[j].B0ss[2],
120  phases.aqueous[i].ii_bin_params[j].B0ss[3],
121  phases.aqueous[i].ii_bin_params[j].B0ss[4],
122  phases.aqueous[i].ii_bin_params[j].B0ss[5]);
123 
124  printf (" %0.6lf %0.6lf %0.6lf %0.6lf %0.6lf %0.6lf\n",
125  phases.aqueous[i].ii_bin_params[j].B1ss[0],
126  phases.aqueous[i].ii_bin_params[j].B1ss[1],
127  phases.aqueous[i].ii_bin_params[j].B1ss[2],
128  phases.aqueous[i].ii_bin_params[j].B1ss[3],
129  phases.aqueous[i].ii_bin_params[j].B1ss[4],
130  phases.aqueous[i].ii_bin_params[j].B1ss[5]);
131  }
132 
133  printf (" %d\n", phases.aqueous[i].nn_bin_param_num);
134  for (j = 0; j < phases.aqueous[i].nn_bin_param_num; j++)
135  {
136  printf (" %s %s\n", phases.aqueous[i].nn_bin_params[j].species_s1,
138 
139  printf (" %0.6lf %0.6lf %0.6lf %0.6lf %0.6lf %0.6lf\n",
140  phases.aqueous[i].nn_bin_params[j].Wss[0],
141  phases.aqueous[i].nn_bin_params[j].Wss[1],
142  phases.aqueous[i].nn_bin_params[j].Wss[2],
143  phases.aqueous[i].nn_bin_params[j].Wss[3],
144  phases.aqueous[i].nn_bin_params[j].Wss[4],
145  phases.aqueous[i].nn_bin_params[j].Wss[5]);
146 
147  printf (" %0.6lf %0.6lf %0.6lf %0.6lf %0.6lf %0.6lf\n",
148  phases.aqueous[i].nn_bin_params[j].Uss[0],
149  phases.aqueous[i].nn_bin_params[j].Uss[1],
150  phases.aqueous[i].nn_bin_params[j].Uss[2],
151  phases.aqueous[i].nn_bin_params[j].Uss[3],
152  phases.aqueous[i].nn_bin_params[j].Uss[4],
153  phases.aqueous[i].nn_bin_params[j].Uss[5]);
154  }
155 
156  printf (" %d\n", phases.aqueous[i].nii_ter_param_num);
157  for (j = 0; j < phases.aqueous[i].nii_ter_param_num; j++)
158  {
159  printf (" %s %s %s\n", phases.aqueous[i].nii_ter_params[j].species_s1,
162 
163  printf (" %0.6lf %0.6lf %0.6lf %0.6lf %0.6lf %0.6lf\n",
169  phases.aqueous[i].nii_ter_params[j].Wsss[5]);
170 
171  printf (" %0.6lf %0.6lf %0.6lf %0.6lf %0.6lf %0.6lf\n",
177  phases.aqueous[i].nii_ter_params[j].Usss[5]);
178 
179  printf (" %0.6lf %0.6lf %0.6lf %0.6lf %0.6lf %0.6lf\n",
185  phases.aqueous[i].nii_ter_params[j].Vsss[5]);
186  }
187 
188  printf (" %d\n", phases.aqueous[i].iii_ter_param_num);
189  for (j = 0; j < phases.aqueous[i].iii_ter_param_num; j++)
190  {
191  printf (" %s %s %s\n", phases.aqueous[i].iii_ter_params[j].species_s1,
194 
195  printf (" %0.6lf %0.6lf %0.6lf %0.6lf %0.6lf %0.6lf\n",
201  phases.aqueous[i].iii_ter_params[j].Wsss[5]);
202  }
203 
204  printf (" %d\n", phases.aqueous[i].niii_qua_param_num);
205  for (j = 0; j < phases.aqueous[i].niii_qua_param_num; j++)
206  {
207  printf (" %s %s %s %s\n", phases.aqueous[i].niii_qua_params[j].species_s1,
211 
212  printf (" %0.6lf %0.6lf %0.6lf %0.6lf %0.6lf %0.6lf\n",
219 
220  printf (" %0.6lf %0.6lf %0.6lf %0.6lf %0.6lf %0.6lf\n",
227  }
228  }
229 
230  for (i = 0; i < solid_phase_num; i++)
231  {
232  printf ("SOLID %d\n", phases.solids[i].species_num);
233 
234  int j;
235 
236  for (j = 0; j < phases.solids[i].species_num; j++)
237  {
238  printf (" %s %d\n", phases.solids[i].solid_species[j].species_symbol,
240 
241  int k;
242  for (k = 0; k < total_comp_num; k++)
243  {
244  printf (" %0.0lf", phases.solids[i].solid_species[j].elements[k]);
245  }
246  printf ("\n");
247  printf (" %0.6lf %0.6lf %0.6lf %0.6lf %0.6lf %0.6lf %0.6lf\n",
255  }
256  }
257 
258  for (i = 0; i < solidsolution_phase_num; i++)
259  {
260  printf ("SOLIDSOLUTION %d\n", phases.solidsolution[i].species_num);
261 
262  int j;
263 
264  for (j = 0; j < phases.solidsolution[i].species_num; j++)
265  {
266  printf (" %s %d\n", phases.solidsolution[i].solidsolution_species[j].species_symbol,
268 
269  int k;
270  for (k = 0; k < total_comp_num; k++)
271  {
272  printf (" %0.0lf", phases.solidsolution[i].solidsolution_species[j].elements[k]);
273  }
274  printf ("\n");
275  printf (" %0.6lf %0.6lf %0.6lf %0.6lf %0.6lf %0.6lf %0.6lf\n",
283  }
284 
285  printf (" %d\n", phases.solidsolution[i].param_num);
286 
287  for (j = 0; j < phases.solidsolution[i].param_num; j++)
288  {
289  printf (" %s %s %0.1lf %0.1lf\n",
293  phases.solidsolution[i].params[j].A1);
294  }
295  }
296 
297  return true;
298 }
char species_s1[64]
Definition: islec.h:97
int ii_bin_param_num
Definition: islec.h:158
char species_s3[64]
Definition: islec.h:107
char species_s1[64]
Definition: islec.h:87
char species_s2[64]
Definition: islec.h:116
AQUEOUS_PHASE * aqueous
Definition: islec.h:189
double B0ss[6]
Definition: islec.h:91
int solidsolution_phase_num
Definition: islec.h:198
char species_a[64]
Definition: islec.h:142
char species_s3[64]
Definition: islec.h:117
int species_num
Definition: islec.h:150
IIBINPARAM * ii_bin_params
Definition: islec.h:159
char species_s1[64]
Definition: islec.h:105
double Qssss[6]
Definition: islec.h:127
int species_num
Definition: islec.h:156
SPECIES * gas_species
Definition: islec.h:151
double A0
Definition: islec.h:144
SPECIES * aqueous_species
Definition: islec.h:157
double Usss[6]
Definition: islec.h:109
int species_num
Definition: islec.h:174
int niii_qua_param_num
Definition: islec.h:166
double alpha
Definition: islec.h:89
NNBINPARAM * nn_bin_params
Definition: islec.h:161
int charge
Definition: islec.h:80
double A1
Definition: islec.h:145
NIITERPARAM * nii_ter_params
Definition: islec.h:163
SOLIDSOLUTION_PHASE * solidsolution
Definition: islec.h:191
double Wsss[6]
Definition: islec.h:118
GAS_PHASE * gas
Definition: islec.h:188
int nn_bin_param_num
Definition: islec.h:160
char species_s2[64]
Definition: islec.h:124
double thermo_coeff[7]
Definition: islec.h:82
char species_s2[64]
Definition: islec.h:98
double Wsss[6]
Definition: islec.h:108
int aqueous_phase_num
Definition: islec.h:196
double Vsss[6]
Definition: islec.h:110
SOLID_PHASE * solids
Definition: islec.h:190
SPECIES * solid_species
Definition: islec.h:175
double * elements
Definition: islec.h:81
char species_s4[64]
Definition: islec.h:126
char species_s3[64]
Definition: islec.h:125
char species_b[64]
Definition: islec.h:143
double B1ss[6]
Definition: islec.h:92
double Yssss[6]
Definition: islec.h:128
int nii_ter_param_num
Definition: islec.h:162
char species_s2[64]
Definition: islec.h:106
IIITERPARAM * iii_ter_params
Definition: islec.h:165
SUBRPARAM * params
Definition: islec.h:183
PHASES phases
Definition: islec.h:206
char species_symbol[64]
Definition: islec.h:79
char species_s2[64]
Definition: islec.h:88
int total_comp_num
Definition: islec.h:194
double alpha1
Definition: islec.h:90
char species_s1[64]
Definition: islec.h:123
int solid_phase_num
Definition: islec.h:197
NIIIQUAPARAM * niii_qua_params
Definition: islec.h:167
int iii_ter_param_num
Definition: islec.h:164
bool test_load()
Definition: test_load.c:31
char species_s1[64]
Definition: islec.h:115
int gas_phase_num
Definition: islec.h:195
double Uss[6]
Definition: islec.h:100
double Wss[6]
Definition: islec.h:99
SPECIES * solidsolution_species
Definition: islec.h:181
ELEMENT * components
Definition: islec.h:205