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

walter at geodynamics.org walter at geodynamics.org
Wed Apr 30 15:36:46 PDT 2008


Author: walter
Date: 2008-04-30 15:36:46 -0700 (Wed, 30 Apr 2008)
New Revision: 11871

Modified:
   long/3D/Gale/trunk/
   long/3D/Gale/trunk/input/benchmarks/shortening.xml
   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:
 r2118 at earth:  boo | 2008-04-29 15:21:34 -0700
 Rough, hacked version that works for KineticFriction with benchmark



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

Modified: long/3D/Gale/trunk/input/benchmarks/shortening.xml
===================================================================
--- long/3D/Gale/trunk/input/benchmarks/shortening.xml	2008-04-30 22:36:40 UTC (rev 11870)
+++ long/3D/Gale/trunk/input/benchmarks/shortening.xml	2008-04-30 22:36:46 UTC (rev 11871)
@@ -284,7 +284,7 @@
       <param name="Type">Stokes_SLE_UzawaSolver</param>
       <param name="Preconditioner">preconditioner</param>
       <param name="tolerance">1.0e-5</param>
-      <param name="maxIterations">5000</param>
+      <param name="maxIterations">maxUzawaIterations</param>
     </struct>
     <struct name="stokesEqn">
       <param name="Type">Stokes_SLE</param>
@@ -337,7 +337,7 @@
       <list name="shapes">
         <param>backgroundShape</param>
         <param>!beadsShape</param>
-        <param>!cornerShape</param>
+<!--         <param>!cornerShape</param> -->
       </list>
     </struct>
 
@@ -368,7 +368,7 @@
 
     <struct name="sandViscosity">
       <param name="Type">MaterialViscosity</param>
-      <param name="eta0">100000.0</param>
+      <param name="eta0">1.0e12</param>
     </struct>
     <struct name="beadsStrainWeakening">
       <param name="Type">StrainWeakening</param>
@@ -399,7 +399,7 @@
     </struct>
     <struct name="cornerViscosity">
       <param name="Type">MaterialViscosity</param>
-      <param name="eta0">1.0</param>
+      <param name="eta0">1.0e12</param>
     </struct>
     <struct name="storeViscosity">
       <param name="Type">StoreVisc</param>
@@ -431,16 +431,17 @@
         <param>storeStress</param>
       </list>
     </struct>
-    <struct name="corner">
-      <param name="Type">RheologyMaterial</param>
-      <param name="Shape">cornerShape</param>
-      <param name="density">1560</param>
-      <list name="Rheology">
-        <param>cornerViscosity</param>
-        <param>storeViscosity</param>
-        <param>storeStress</param>
-      </list>
-    </struct>
+<!--     <struct name="corner"> -->
+<!--       <param name="Type">RheologyMaterial</param> -->
+<!--       <param name="Shape">cornerShape</param> -->
+<!--       <param name="density">1560</param> -->
+<!--       <list name="Rheology"> -->
+<!--         <param>sandViscosity</param> -->
+<!--         <param>sandYielding</param> -->
+<!--         <param>storeViscosity</param> -->
+<!--         <param>storeStress</param> -->
+<!--       </list> -->
+<!--     </struct> -->
     <struct name="surfaceAdaptor">
       <param name="Type">SurfaceAdaptor</param>
       <param name="mesh">mesh-linear</param>
@@ -492,7 +493,7 @@
   </struct>
   <list name="plugins">
     <param>Underworld_EulerDeform</param>
-    <param>Underworld_DumpSwarm</param>
+<!--     <param>Underworld_DumpSwarm</param> -->
     <param>Underworld_VTKOutput</param>
   </list>
   <param name="maxTimeSteps">500</param>
@@ -589,7 +590,7 @@
           <struct>
             <param name="name">vx</param>
             <param name="type">double</param>
-            <param name="value">-1.0</param>
+            <param name="value">-6.94444444444e-6</param>
           </struct>
         </list>
       </struct>
@@ -604,21 +605,21 @@
           </struct>
         </list>
       </struct>
-      <struct>
-        <param name="type">StaticFrictionVC</param>
-        <param name="wall">bottom</param>
-        <param name="StaticFriction">0.34432761329</param>
-        <param name="includeUpperX">False</param>
-        <param name="StressField">StressField</param>
-        <param name="PressureField">PressureField</param>
-        <list name="variables">
-          <struct>
-            <param name="name">vx</param>
-            <param name="type">double</param>
-            <param name="value">0.0</param>
-          </struct>
-        </list>
-      </struct>
+<!--       <struct> -->
+<!--         <param name="type">StaticFrictionVC</param> -->
+<!--         <param name="wall">bottom</param> -->
+<!--         <param name="StaticFriction">0.34432761329</param> -->
+<!--         <param name="includeUpperX">False</param> -->
+<!--         <param name="StressField">StressField</param> -->
+<!--         <param name="PressureField">PressureField</param> -->
+<!--         <list name="variables"> -->
+<!--           <struct> -->
+<!--             <param name="name">vx</param> -->
+<!--             <param name="type">double</param> -->
+<!--             <param name="value">0.0</param> -->
+<!--           </struct> -->
+<!--         </list> -->
+<!--       </struct> -->
     </list>
   </struct>
 
@@ -646,8 +647,12 @@
 
   <param name="checkpointEvery">1</param>
   <param name="dtFactor">1.0</param>
-<!--   <param name="journal.info">True</param> -->
-<!--   <param name="journal.debug">True</param> -->
-<!--   <param name="journal-level.info">2</param> -->
-<!--   <param name="journal-level.debug">2</param> -->
+
+  <param name="maxUzawaIterations">20000</param>
+
+
+  <param name="journal.info">True</param>
+  <param name="journal.debug">True</param>
+  <param name="journal-level.info">2</param>
+  <param name="journal-level.debug">2</param>
 </StGermainData>

Modified: long/3D/Gale/trunk/src/Gale/Utils/src/KineticFriction.c
===================================================================
--- long/3D/Gale/trunk/src/Gale/Utils/src/KineticFriction.c	2008-04-30 22:36:40 UTC (rev 11870)
+++ long/3D/Gale/trunk/src/Gale/Utils/src/KineticFriction.c	2008-04-30 22:36:46 UTC (rev 11871)
@@ -58,6 +58,7 @@
 #include "PICellerator/Utils/MaterialSwarmVariable.h"
 
 #include "types.h"
+#include "StressBC.h"
 #include "KineticFriction.h"
 #include "StaticFrictionVC.h"
 
@@ -336,7 +337,7 @@
   ElementType* elementType;
   Dof_Index nodeDofCount;
   double stress, area, n[3], v_diff[3], v_boundary[3], v_dot_n,
-    v_perpendicular[3], v_norm, friction_stress;
+    v_perpendicular[3], v_norm, friction_force;
   IJK ijk;
   unsigned direction, boundary, basis[2], d;
   FeVariable *pressure, *deviatoric_stress, *velocity;
@@ -357,7 +358,7 @@
   /* Get the basis vectors for the boundary */
   StaticFrictionVC_get_basis_vectors(self->_wall,grid->sizes,
                                &direction,&boundary,basis);
-  
+
   /* Apply the stress */
   for( eNode_I = 0 ; eNode_I < elementNodeCount; eNode_I++ ) {
     /* Make sure that we are on the boundary */
@@ -368,7 +369,7 @@
     
     if(ijk[direction]==boundary)
       {
-        unsigned overcount=StressBC_get_overcount(ijk,grid->sizes);
+        unsigned overcount=StressBC_get_overcount(dim,ijk,grid->sizes);
         double v[3], v_surface[3], v_surface_diff[3], normal_stress,
           tangential_norm, friction_coefficient;
         Bool include_boundary[3];
@@ -427,7 +428,7 @@
           include_boundary[d]=True;
         StaticFrictionVC_get_interface_stresses
           (pressure,deviatoric_stress,mesh,grid->sizes,elementNodes[eNode_I],
-           ijk,dim,basis,include_boundary,
+           lElement_I,ijk,dim,basis,include_boundary,
            include_boundary,&normal_stress,&tangential_norm,n);
         
         velocity = (FeVariable*)FieldVariable_Register_GetByName
@@ -436,7 +437,7 @@
         Journal_Firewall( ( velocity!=NULL ), errorStr,
                           "Error: In KineticFriction, the name provided for the velocity field \"%s\" does not exist\n",
                           self->velocity_name);
-        FeVariable_GetValueAtNode(velocity,eNode_I,v);
+        FeVariable_GetValueAtNode(velocity,elementNodes[eNode_I],v);
         
         /* Get the magnitude of the velocity parallel to the surface. */
         if(dim==2)
@@ -445,7 +446,7 @@
             v_dot_n=Vec_Dot2D(v_diff,n);
             Vec_Scale2D(v_perpendicular,n,v_dot_n);
             Vec_Sub2D(v_surface_diff,v_diff,v_perpendicular);
-            v_norm=Vec_Mag2D(v_surface_diff);
+/*             v_norm=Vec_Mag2D(v_surface_diff); */
           }
         else
           {
@@ -453,11 +454,23 @@
             v_dot_n=Vec_Dot3D(v,n);
             Vec_Scale3D(v_perpendicular,n,v_dot_n);
             Vec_Sub3D(v_surface_diff,v,v_perpendicular);
-            v_norm=Vec_Mag3D(v_surface_diff);
+/*             v_norm=Vec_Mag3D(v_surface_diff); */
           }
-        friction_stress=friction_coefficient*normal_stress*area/overcount;
-        for(d=0;d<dim;++d)
-          elForceVec[ eNode_I*nodeDofCount + d]+=v_norm*friction_stress;
+        friction_force=friction_coefficient*normal_stress*area/overcount;
+
+        if(friction_force<0)
+          friction_force=0;
+        printf("friction %lf %lf %lf %lf %lf %lf %lf %lf %lf %d %d\n",
+               friction_force,
+               v_surface_diff[0], v_surface_diff[1],
+               v_boundary[0], v_boundary[1],
+               v_diff[0], v_diff[1],
+               v_perpendicular[0], v_perpendicular[1],
+               eNode_I,lElement_I);
+
+          elForceVec[ eNode_I*nodeDofCount + I_AXIS]+=-friction_force;
+/*         for(d=0;d<dim;++d) */
+/*           elForceVec[ eNode_I*nodeDofCount + d]+=friction_force; */
       }
   }
 }

Modified: long/3D/Gale/trunk/src/Gale/Utils/src/StaticFrictionVC.c
===================================================================
--- long/3D/Gale/trunk/src/Gale/Utils/src/StaticFrictionVC.c	2008-04-30 22:36:40 UTC (rev 11870)
+++ long/3D/Gale/trunk/src/Gale/Utils/src/StaticFrictionVC.c	2008-04-30 22:36:46 UTC (rev 11871)
@@ -654,14 +654,14 @@
 
                   /* 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 */
+/*                      (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)) */
                     {
                       IndexSet_Add(set,n_i);
                     }
@@ -866,6 +866,7 @@
                                      FeMesh *mesh,
                                      unsigned sizes[],
                                      Node_LocalIndex n_i,
+                                     Element_LocalIndex lElement_I,
                                      IJK ijk,
                                      unsigned nDims,
                                      unsigned basis[],
@@ -876,8 +877,10 @@
                                      double n[])
 {
   double str[6], p;
+  /* 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,n_i,&p);
+  FeVariable_GetValueAtNode(pressure,lElement_I,&p);
   
   if(nDims==2)
     {
@@ -1076,6 +1079,8 @@
     }
   /* Add in the pressure.  The sign convention switches the direction
      of stress from the deviatoric stress. */
+
+  printf("normal %lf %lf\n",p,*normal_stress);
   *normal_stress=p-(*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-04-30 22:36:40 UTC (rev 11870)
+++ long/3D/Gale/trunk/src/Gale/Utils/src/StaticFrictionVC.h	2008-04-30 22:36:46 UTC (rev 11871)
@@ -201,6 +201,7 @@
                                        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