[cig-commits] commit: Make a new copy of zx and zy in dC_dv and set that to zero. Then it

Mercurial hg at geodynamics.org
Thu Mar 22 15:17:50 PDT 2012


changeset:   110:afe687d9bde7
user:        Walter Landry <wlandry at caltech.edu>
date:        Thu Mar 22 15:14:20 2012 -0700
files:       compute_dC_dv.cxx main.cxx
description:
Make a new copy of zx and zy in dC_dv and set that to zero.  Then it
will not mess up the initial conditions.  Also set fx and fy to zero
since it will eventually be needed when calculating jumps.


diff -r 8a00c28704c1 -r afe687d9bde7 compute_dC_dv.cxx
--- a/compute_dC_dv.cxx	Thu Mar 22 11:44:33 2012 -0700
+++ b/compute_dC_dv.cxx	Thu Mar 22 15:14:20 2012 -0700
@@ -1,22 +1,28 @@
+/* Computes the derivative of the correction w/respect to the
+   augumented velocity (z).  This is equal to the correction when
+   z(i.j)=1 and everywhere z=0 and gravity=0, because everything is
+   linear in z. */
+
 #include "constants.hxx"
 #include "compute_Cxyz.hxx"
 
-void compute_dC_dv(double zx[Nx+1][Ny],
-                   double zy[Nx][Ny+1],
-                   const double log_etax[Nx+1][Ny],
+void compute_dC_dv(const double log_etax[Nx+1][Ny],
                    const double log_etay[Nx][Ny+1],
                    const double distx[Nx+1][Ny],
                    const double disty[Nx][Ny+1],
                    double dCx[Nx+1][Ny],
                    double dCy[Nx][Ny+1])
 {
+  double zx[Nx+1][Ny], zy[Nx][Ny+1];
+  double fx[Nx+1][Ny], fy[Nx][Ny+1];
+
   for(int i=0;i<Nx+1;++i)
     for(int j=0;j<Ny;++j)
-      zx[i][j]=0;
+      zx[i][j]=fx[i][j]=0;
 
   for(int i=0;i<Nx;++i)
     for(int j=0;j<Ny+1;++j)
-      zy[i][j]=0;
+      zy[i][j]=fy[i][j]=0;
 
   for(int j=0;j<Ny;++j)
     for(int i=1;i<Nx;++i)
diff -r 8a00c28704c1 -r afe687d9bde7 main.cxx
--- a/main.cxx	Thu Mar 22 11:44:33 2012 -0700
+++ b/main.cxx	Thu Mar 22 15:14:20 2012 -0700
@@ -21,9 +21,7 @@ extern void compute_Cp(const double zx[N
                        const int &i, const int &j,
                        double &Cp);
 
-extern void compute_dC_dv(double zx[Nx+1][Ny],
-                          double zy[Nx][Ny+1],
-                          const double log_etax[Nx+1][Ny],
+extern void compute_dC_dv(const double log_etax[Nx+1][Ny],
                           const double log_etay[Nx][Ny+1],
                           const double distx[Nx+1][Ny],
                           const double disty[Nx][Ny+1],
@@ -58,7 +56,7 @@ int main()
 
   initial(model,zx,zy,log_etax,log_etay,p,fx,fy,distx,disty);
 
-  compute_dC_dv(zx,zy,log_etax,log_etay,distx,disty,dCx,dCy);
+  compute_dC_dv(log_etax,log_etay,distx,disty,dCx,dCy);
 
   double Resid_p[Nx][Ny], Resid_x[Nx+1][Ny], Resid_y[Nx][Ny+1];
 



More information about the CIG-COMMITS mailing list