[cig-commits] commit: Fix uninitialized and boundary problems. Also switch to inclusion.

Mercurial hg at geodynamics.org
Tue May 8 05:50:55 PDT 2012


changeset:   157:fd1ad612f16f
user:        Walter Landry <wlandry at caltech.edu>
date:        Mon May 07 08:50:17 2012 -0700
files:       main.cxx
description:
Fix uninitialized and boundary problems.  Also switch to inclusion.


diff -r 3949c83f0526 -r fd1ad612f16f main.cxx
--- a/main.cxx	Sun May 06 19:00:59 2012 -0700
+++ b/main.cxx	Mon May 07 08:50:17 2012 -0700
@@ -56,7 +56,7 @@ int main()
 
   const int output_interval=1000;
 
-  Model model(Model::solCx);
+  Model model(Model::inclusion);
 
   initial(model,zx,zy,log_etax,log_etay,eta_cell,p,fx,fy,
           distx,disty,dist_cell,dist_edge);
@@ -69,7 +69,7 @@ int main()
   for(int i=0;i<Nx+1;++i)
     for(int j=0;j<Ny;++j)
       {
-        if(!check_initial)
+        if(!check_initial && i!=0 && i!=Nx)
           zx[i][j]=0;
         Resid_x[i][j]=0;
       }
@@ -77,7 +77,7 @@ int main()
   for(int i=0;i<Nx;++i)
     for(int j=0;j<Ny+1;++j)
       {
-        if(!check_initial)
+        if(!check_initial && j!=0 && j!=Ny)
           zy[i][j]=0;
         Resid_y[i][j]=0;
       }
@@ -117,6 +117,11 @@ int main()
                       else
                         zx_new[i][j]=zx[i][j]-theta_mom*Rx/dRx[i][j];
                     }
+                  else
+                    {
+                      if(jacobi)
+                        zx_new[i][j]=zx[i][j];
+                    }
                 }
             }
         }
@@ -152,6 +157,11 @@ int main()
                         zy[i][j]-=theta_mom*Ry/dRy[i][j];
                       else
                         zy_new[i][j]=zy[i][j]-theta_mom*Ry/dRy[i][j];
+                    }
+                  else
+                    {
+                      if(jacobi)
+                        zy_new[i][j]=zy[i][j];
                     }
                 }
             }



More information about the CIG-COMMITS mailing list