Main Page   Data Structures   File List   Data Fields   Globals  

stresses.old.c

Go to the documentation of this file.
00001 #include "utilf.h"
00002 #include "stresses.h"
00003 
00004    
00005 void stresses(real2D S11, real2D S22, real2D S12, real2D cc, 
00006               real2D S11t, real2D S22t, 
00007 #ifdef IMMERSED
00008               real ***isb_sxy,
00009 #endif
00010               real sigma, real tau, 
00011               int nx, int ny)
00012 {
00013   real sigmag25, h, sigmag, sigh, mag, dcx, dcy;
00014   int i, j;
00015   
00016   h = 1.0 / (nx - 2);
00017   sigh =.5 * tau * tau * sigma / h / h / h;
00018   for (i = 2; i <= nx; i++)
00019     for (j = 2; j <= ny; j++)
00020       {
00021 #ifdef IMMERSED
00022         if (isb_sxy[i][j] != NULL) {
00023 #ifdef CA90
00024           /* 90 degrees contact angle */
00025           dcx= 2. * (cc[i][j] - cc[i-1][j]);
00026           dcy= 0.0;
00027 #else
00028           /* 180 degrees contact angle */
00029           dcx = 0.0;
00030           dcy = cc[i][j] + cc[i-1][j];
00031 #endif
00032         }
00033         else {
00034           dcx= cc[i][j] + cc[i][j-1] - cc[i-1][j] - cc[i-1][j-1];
00035           dcy= cc[i][j] + cc[i-1][j] - cc[i][j-1] - cc[i-1][j-1];
00036         }
00037 #else
00038         dcx= cc[i][j] + cc[i][j-1] - cc[i-1][j] - cc[i-1][j-1];
00039         dcy= cc[i][j] + cc[i-1][j] - cc[i][j-1] - cc[i-1][j-1];
00040 #endif
00041         mag = dcx * dcx + dcy * dcy;
00042         if (mag > 0.0) {
00043           sigmag = sigh / sqrt(mag);
00044           sigmag25 = 0.25 * sigmag;
00045           S11t[i][j] = - sigmag25 * dcy * dcy;
00046           S22t[i][j] = - sigmag25 * dcx * dcx;
00047           S12[i][j] =  sigmag * dcx * dcy;
00048         }
00049         else
00050           S11t[i][j] = S22t[i][j] = S12[i][j] = 0.0;
00051       }
00052   for (i = 2; i <= nx-1; i++)
00053     for (j = 2; j <= ny-1; j++)
00054       {
00055         S11[i][j] = S11t[i][j] + S11t[i+1][j] 
00056           + S11t[i][j+1] + S11t[i+1][j+1];
00057         S22[i][j] = S22t[i][j] + S22t[i+1][j] + S22t[i][j+1] 
00058           + S22t[i+1][j+1];
00059       }
00060 }
00061 
00062 
00063 
00064 

Generated on Wed Feb 19 22:26:51 2003 for Markers by doxygen1.2.18