[Dda-cvs] ntdda/src mohrcoulomb.c,1.4,1.5
Status: Beta
Brought to you by:
doolin
From: David M. D. <do...@us...> - 2006-07-02 23:18:43
|
Update of /cvsroot/dda/ntdda/src In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv1478 Modified Files: mohrcoulomb.c Log Message: Added more white space for readability, fully braced around if anf for statements. Index: mohrcoulomb.c =================================================================== RCS file: /cvsroot/dda/ntdda/src/mohrcoulomb.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** mohrcoulomb.c 2 Jul 2006 23:16:02 -0000 1.4 --- mohrcoulomb.c 2 Jul 2006 23:18:40 -0000 1.5 *************** *** 46,53 **** xj3 = dx * dy * dz - dz * pow (txy, 2); sine = -13.5 * xj3 / pow (dsbar, 3); ! if (sine > 1) sine = 1; ! if (sine < -1) sine = -1; theta = asin (sine) / 3; } --- 46,55 ---- xj3 = dx * dy * dz - dz * pow (txy, 2); sine = -13.5 * xj3 / pow (dsbar, 3); ! if (sine > 1) { sine = 1; ! } ! if (sine < -1) { sine = -1; + } theta = asin (sine) / 3; } *************** *** 103,116 **** d3 = dx * dy * dz - dz * txy * txy; th = -3 * sq3 * d3 / (2 * pow (d2, 3)); ! if (th > 1) th = 1; ! if (th < -1) th = -1; th = asin (th) / 3; snth = sin (th); if (fabs (snth) > 0.49) { sig = -1; ! if (snth < 0) sig = 1; rph = snph * (1 + nu) / 3; rps = snps * (1. + nu) / 3; --- 105,121 ---- d3 = dx * dy * dz - dz * txy * txy; th = -3 * sq3 * d3 / (2 * pow (d2, 3)); ! if (th > 1) { th = 1; ! } ! if (th < -1) { th = -1; + } th = asin (th) / 3; snth = sin (th); if (fabs (snth) > 0.49) { sig = -1; ! if (snth < 0) { sig = 1; + } rph = snph * (1 + nu) / 3; rps = snps * (1. + nu) / 3; *************** *** 171,178 **** double fnew; ! for (i = 1; i <= 4; i++) elso[i] = 0; ! for (i = 1; i <= 4; i++) cs[i] = stress[i + 3] + sigma[i]; invar (); --- 176,186 ---- double fnew; ! for (i = 1; i <= 4; i++) { elso[i] = 0; ! } ! ! for (i = 1; i <= 4; i++) { cs[i] = stress[i + 3] + sigma[i]; + } invar (); *************** *** 188,192 **** } ! for (i = 1; i <= 4; i++) stress[i + 3] = stress[i + 3] + sigma[i] - elso[i]; } --- 196,202 ---- } ! for (i = 1; i <= 4; i++) { stress[i + 3] = stress[i + 3] + sigma[i] - elso[i]; + } + } |