[cig-commits] r11881 - in long/3D/Gale/trunk: . src/Gale/Utils/src

walter at geodynamics.org walter at geodynamics.org
Thu May 1 10:37:39 PDT 2008


Author: walter
Date: 2008-05-01 10:37:39 -0700 (Thu, 01 May 2008)
New Revision: 11881

Modified:
   long/3D/Gale/trunk/
   long/3D/Gale/trunk/src/Gale/Utils/src/KineticFriction.c
   long/3D/Gale/trunk/src/Gale/Utils/src/StaticFrictionVC.c
   long/3D/Gale/trunk/src/Gale/Utils/src/StaticFrictionVC.h
Log:
 r2127 at earth:  boo | 2008-05-01 10:35:43 -0700
 Make StaticFriction_get_interface_stresses not include the pressure, since the Kinetic and Static friction components want to use the pressure from different places



Property changes on: long/3D/Gale/trunk
___________________________________________________________________
Name: svk:merge
   - 3a629746-de10-0410-b17b-fd6ecaaa963e:/cig:2121
   + 3a629746-de10-0410-b17b-fd6ecaaa963e:/cig:2127

Modified: long/3D/Gale/trunk/src/Gale/Utils/src/KineticFriction.c
===================================================================
--- long/3D/Gale/trunk/src/Gale/Utils/src/KineticFriction.c	2008-05-01 14:21:15 UTC (rev 11880)
+++ long/3D/Gale/trunk/src/Gale/Utils/src/KineticFriction.c	2008-05-01 17:37:39 UTC (rev 11881)
@@ -427,9 +427,15 @@
         for(d=0;d<dim;d++)
           include_boundary[d]=True;
         StaticFrictionVC_get_interface_stresses
-          (pressure,deviatoric_stress,mesh,grid->sizes,elementNodes[eNode_I],
-           lElement_I,ijk,dim,basis,include_boundary,
+          (deviatoric_stress,mesh,grid->sizes,elementNodes[eNode_I],
+           ijk,dim,basis,include_boundary,
            include_boundary,&normal_stress,&tangential_norm,n);
+
+        {
+          double p;
+          FeVariable_GetValueAtNode(pressure,lElement_I,&p);
+          normal_stress+=p;
+        }
         
         velocity = (FeVariable*)FieldVariable_Register_GetByName
           ( self->context->fieldVariable_Register,

Modified: long/3D/Gale/trunk/src/Gale/Utils/src/StaticFrictionVC.c
===================================================================
--- long/3D/Gale/trunk/src/Gale/Utils/src/StaticFrictionVC.c	2008-05-01 14:21:15 UTC (rev 11880)
+++ long/3D/Gale/trunk/src/Gale/Utils/src/StaticFrictionVC.c	2008-05-01 17:37:39 UTC (rev 11881)
@@ -634,6 +634,7 @@
         /* If this is the first time this routine is called, the
            stress may not have been initialized yet.  In that case,
            make everything stick. */
+
         if(deviatoric_stress!=NULL && deviatoric_stress->dofLayout!=NULL)
           {
             Node_LocalIndex n_i;
@@ -650,18 +651,31 @@
                   ( self->_mesh, MT_VERTEX, n_i ), ijk );
               if(ijk[direction]==boundary)
                 {
-                  double normal_stress, tangential_norm, n[3];
+                  double normal_stress, tangential_norm, n[3], p, temp;
 
+                  /* Average the pressure over neighboring cells to
+                     get the pressure at the node. */
+                  unsigned nInc;
+                  unsigned *inc;
+                  unsigned nn;
+                  Mesh_GetIncidence(self->_mesh, MT_VERTEX, n_i, nDims, &nInc, &inc);
+                  p=0;
+                  for(nn=0; nn<nInc; ++nn)
+                    {
+                      FeVariable_GetValueAtNode(pressure,inc[nn],&temp);
+                      p+=temp;
+                    }
+                  p/=nInc;
+
                   /* Finally, add in the point if the frictional force
                      keeps the material pinned to the boundary. */
-/*                   if(StaticFrictionVC_get_interface_stresses */
-/*                      (pressure,deviatoric_stress,self->_mesh, */
-/*                       grid->sizes, n_i, ijk, nDims, basis, */
-/*                       self->include_lower_boundary, */
-/*                       self->include_upper_boundary, */
-/*                       &normal_stress,&tangential_norm,n) */
-/*                      && (self->friction*normal_stress>=tangential_norm */
-/*                          || normal_stress==0)) */
+                  if(StaticFrictionVC_get_interface_stresses
+                     (deviatoric_stress,self->_mesh,
+                      grid->sizes, n_i, ijk, nDims, basis,
+                      self->include_lower_boundary,
+                      self->include_upper_boundary,
+                      &normal_stress,&tangential_norm,n)
+                     && (self->friction*(p+normal_stress)>=tangential_norm))
                     {
                       IndexSet_Add(set,n_i);
                     }
@@ -861,12 +875,10 @@
    of the normal and tangential stresses.  The exit status tells if
    the point is on a non-included boundary. */
 
-Bool StaticFrictionVC_get_interface_stresses(FeVariable *pressure,
-                                     FeVariable *deviatoric_stress,
+Bool StaticFrictionVC_get_interface_stresses(FeVariable *deviatoric_stress,
                                      FeMesh *mesh,
                                      unsigned sizes[],
                                      Node_LocalIndex n_i,
-                                     Element_LocalIndex lElement_I,
                                      IJK ijk,
                                      unsigned nDims,
                                      unsigned basis[],
@@ -876,11 +888,13 @@
                                      double *tangential_norm,
                                      double n[])
 {
-  double str[6], p;
+  double str[6];
   /* Most things are defined on nodes, but the pressure is only
      defined on the element. */
   FeVariable_GetValueAtNode(deviatoric_stress,n_i,str);
-  FeVariable_GetValueAtNode(pressure,lElement_I,&p);
+
+  *normal_stress=0;
+  *tangential_norm=0;
   
   if(nDims==2)
     {
@@ -960,6 +974,7 @@
         - n[1]*(*normal_stress);
 
       *tangential_norm=Vec_Mag2D(tangential_stress);
+
     }
   else
     {
@@ -1077,9 +1092,9 @@
 
       *tangential_norm=Vec_Mag3D(tangential_stress);
     }
-  /* Add in the pressure.  The sign convention switches the direction
-     of stress from the deviatoric stress. */
+  /* The sign convention switches the direction of stress from the
+     deviatoric stress. */
 
-  *normal_stress=p-(*normal_stress);
+  *normal_stress=-(*normal_stress);
   return True;
 }

Modified: long/3D/Gale/trunk/src/Gale/Utils/src/StaticFrictionVC.h
===================================================================
--- long/3D/Gale/trunk/src/Gale/Utils/src/StaticFrictionVC.h	2008-05-01 14:21:15 UTC (rev 11880)
+++ long/3D/Gale/trunk/src/Gale/Utils/src/StaticFrictionVC.h	2008-05-01 17:37:39 UTC (rev 11881)
@@ -196,12 +196,10 @@
 	** Functions
 	*/
 
-Bool StaticFrictionVC_get_interface_stresses(FeVariable *pressure,
-                                       FeVariable *deviatoric_stress,
+Bool StaticFrictionVC_get_interface_stresses(FeVariable *deviatoric_stress,
                                        FeMesh *mesh,
                                        unsigned sizes[],
                                        Node_LocalIndex n_i,
-                                       Element_LocalIndex lElement_I,
                                        IJK ijk,
                                        unsigned nDims,
                                        unsigned basis[],



More information about the cig-commits mailing list