Changeset 471 for trunk/matml
- Timestamp:
- 10/05/2009 07:06:45 PM (3 years ago)
- Location:
- trunk/matml/src/ternary
- Files:
-
- 6 modified
-
ChangeLog (modified) (1 diff)
-
configure.in (modified) (1 diff)
-
freenergy.c (modified) (7 diffs)
-
freenergy.h (modified) (2 diffs)
-
square.c (modified) (1 diff)
-
ternary.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/matml/src/ternary/ChangeLog
r468 r471 1 ternary (0.5.0) unstable; urgency=low 2 3 * New arbitrary polynomial terms in the free energy functions. 4 5 -- 6 1 7 ternary (0.4.0) unstable; urgency=low 2 8 -
trunk/matml/src/ternary/configure.in
r466 r471 3 3 4 4 AM_CONFIG_HEADER(config.h) 5 AM_INIT_AUTOMAKE(ternary, 0. 4.0)6 RELEASE_DATE=" June 18, 2009"5 AM_INIT_AUTOMAKE(ternary, 0.5.0) 6 RELEASE_DATE="when it's ready" 7 7 AC_SUBST(RELEASE_DATE) 8 8 -
trunk/matml/src/ternary/freenergy.c
r464 r471 83 83 + eparams->Omega2345*C2*C3*(1.-C2)*(1.-C3); 84 84 85 /* And this folds in the Gaussians +*/ 85 /* This adds the polynomials */ 86 for (i=0; i<eparams->n_poly; i++) 87 ret += (eparams->poly) [i].coeff * pow (C1, (eparams->poly) [i].n1) * 88 pow (C2, (eparams->poly) [i].n2) * pow (C3, (eparams->poly) [i].n3); 89 90 /* And this folds in the Gaussians */ 86 91 for (i=0; i<eparams->n_gauss; i++) 87 92 ret += (eparams->gauss) [i].G * … … 151 156 + eparams->Omega2345*C3*(1.-2.*C2)*(1.-C3); 152 157 158 for (i=0; i<eparams->n_poly; i++) 159 ret += (eparams->poly) [i].coeff * pow (C1, (eparams->poly) [i].n1-1) * 160 pow (C2, (eparams->poly) [i].n2-1) * pow (C3, (eparams->poly) [i].n3) * 161 ((eparams->poly) [i].n2 * C1 - (eparams->poly) [i].n1 * C2); 162 153 163 for (i=0; i<eparams->n_gauss; i++) 154 164 ret -= 2. * (eparams->gauss) [i].G * (C2-(eparams->gauss) [i].C2) … … 212 222 + eparams->Omega2345*C2*(1.-C2)*(1.-2.*C3); 213 223 224 for (i=0; i<eparams->n_poly; i++) 225 ret += (eparams->poly) [i].coeff * pow (C1, (eparams->poly) [i].n1-1) * 226 pow (C2, (eparams->poly) [i].n2) * pow (C3, (eparams->poly) [i].n3-1) * 227 ((eparams->poly) [i].n3 * C1 - (eparams->poly) [i].n1 * C3); 228 214 229 for (i=0; i<eparams->n_gauss; i++) 215 230 ret -= 2. * (eparams->gauss) [i].G * (C3-(eparams->gauss) [i].C3) … … 271 286 - eparams->Omega2345*2.*C3*(1.-C3); 272 287 288 for (i=0; i<eparams->n_poly; i++) 289 ret += (eparams->poly) [i].coeff * pow (C1, (eparams->poly) [i].n1-2) * 290 pow (C2, (eparams->poly) [i].n2-2) * pow (C3, (eparams->poly) [i].n3) * 291 ((eparams->poly) [i].n2 * ((eparams->poly) [i].n2 - 1) * C1 * C1 292 - 2. * (eparams->poly) [i].n1 * (eparams->poly) [i].n2 * C1 * C2 293 + (eparams->poly) [i].n1 * ((eparams->poly) [i].n1 - 1) * C2 * C2); 273 294 274 295 for (i=0; i<eparams->n_gauss; i++) … … 333 354 - eparams->Omega2345*2.*C2*(1.-C2); 334 355 356 for (i=0; i<eparams->n_poly; i++) 357 ret += (eparams->poly) [i].coeff * pow (C1, (eparams->poly) [i].n1-2) * 358 pow (C2, (eparams->poly) [i].n2) * pow (C3, (eparams->poly) [i].n3-2) * 359 ((eparams->poly) [i].n3 * ((eparams->poly) [i].n3 - 1) * C1 * C1 360 - 2. * (eparams->poly) [i].n1 * (eparams->poly) [i].n3 * C1 * C3 361 + (eparams->poly) [i].n1 * ((eparams->poly) [i].n1 - 1) * C3 * C3); 362 335 363 for (i=0; i<eparams->n_gauss; i++) 336 364 ret += 2. * (eparams->gauss) [i].G … … 393 421 - eparams->Omega245*(1.-2.*C2) - eparams->Omega345*(1.-2.*C3) 394 422 + eparams->Omega2345*(1.-2.*C2)*(1.-2.*C3); 423 424 for (i=0; i<eparams->n_poly; i++) 425 ret += (eparams->poly) [i].coeff * pow (C1, (eparams->poly) [i].n1-2) * 426 pow (C2, (eparams->poly) [i].n2-1) * pow (C3, (eparams->poly) [i].n3-1) * 427 ((eparams->poly) [i].n2 * (eparams->poly) [i].n3 * C1 * C1 428 - (eparams->poly) [i].n1 * (eparams->poly) [i].n3 * C1 * C2 429 - (eparams->poly) [i].n1 * (eparams->poly) [i].n2 * C1 * C3 430 + (eparams->poly) [i].n1 * ((eparams->poly) [i].n1 - 1) * C2 * C3); 395 431 396 432 for (i=0; i<eparams->n_gauss; i++) … … 520 556 points[i].G23=_G23(C1,points[i].C2,points[i].C3, G1,G2,G3, T,P, 521 557 eparams+thefunc, flags); 522 523 558 524 559 /*+ Mark the energy function, temperature and pressure at which these -
trunk/matml/src/ternary/freenergy.h
r470 r471 50 50 51 51 typedef struct { 52 double coeff; /*+ Coefficient +*/ 53 double n1; /*+ C1 exponent +*/ 54 double n2; /*+ C2 exponent +*/ 55 double n3; /*+ C3 exponent +*/ 56 } energy_polynomial; /*+ Polynomial free energy term structure +*/ 57 58 typedef struct { 52 59 char *name; 53 60 double C2; /*+ Composition at center of this Gaussian term +*/ … … 82 89 double Omega345; /*+ Species 3-4-5 regular solution interaction parameter +*/ 83 90 double Omega2345;/*+ Species 2-3-4-5 regular solution interaction parameter+*/ 91 energy_polynomial *poly; /*+ Array of polynomial energy parameter structs +*/ 92 int n_poly; /*+ Number of polynomial energy terms +*/ 84 93 energy_gaussian *gauss; /*+ Array of Gaussian energy parameter structs +*/ 85 94 int n_gauss; /*+ Number of Gaussian energy terms +*/ -
trunk/matml/src/ternary/square.c
r463 r471 40 40 energy_params /* Solid, liquid */ 41 41 eparams0 = {"Solid", 1.,1., 0.,-.1,-.2, -1.,-1.1,-1.2, 0.,1.,1.,1.,1., 42 -.5,2.,.2, 0.,-.1,-.2,.1,.2,-.1, &species,1},42 -.5,2.,.2, 0.,-.1,-.2,.1,.2,-.1, NULL,0, &species,1}, 43 43 eparams1 = {"Liquid", 1.,1., .3,.1,-.1, -2.2,-2.,-1.8, 0.,1.,.67,1.,2., 44 -.3,-.4,-.1, 0.,-.1,-.15,-.05,0.,.3, NULL,0 },44 -.3,-.4,-.1, 0.,-.1,-.15,-.05,0.,.3, NULL,0, NULL,0}, 45 45 allparams[2] = {eparams0, eparams1}; 46 46 -
trunk/matml/src/ternary/ternary.c
r463 r471 36 36 visual_point *tpoints=NULL; 37 37 phase_boundary solid_spinodal, *allbounds=NULL; 38 energy_polynomial squarer = { -2., 1., 3., 2. }; 38 39 /* eparams: name, R,T0, G1@T0,G2,G3, C1,C2,C3, S1,S2,S3,S4,S5, 39 40 O12,O13,O23, O123,O234,O235,O245,O345,O2345 gauss ptr, gauss number */ 40 41 energy_params /* Solid, liquid */ 41 42 eparams0 = {"Solid", 1.,1., 0.,-.1,-.2, -1.,-1.1,-1.2, 1.,.5,.2,0.,0., 42 -.5,2.,.2, 0.,0.,0.,0.,0.,0., NULL,0},43 -.5,2.,.2, 0.,0.,0.,0.,0.,0., &squarer,1, NULL,0}, 43 44 eparams1 = {"Liquid", 1.,1., .3,.1,-.1, -2.2,-2.,-1.8, 1.,1.,.67,0.,0., 44 -.3,-.4,-.1, -.5,0.,0.,0.,0.,0., NULL,0 },45 -.3,-.4,-.1, -.5,0.,0.,0.,0.,0., NULL,0, NULL,0}, 45 46 allparams[2] = {eparams0, eparams1}; 46 47