[cig-commits] [commit] rajesh-petsc-schur: removed the unused element_gauss_seidel method; results dont match master (7217dae)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Tue Sep 9 16:19:05 PDT 2014


Repository : https://github.com/geodynamics/citcoms

On branch  : rajesh-petsc-schur
Link       : https://github.com/geodynamics/citcoms/compare/4b74abccd7fd878fe02e254c4bcc60f3ad79afcc...7217daed18fa112656d9a8d5d7d860292f08a6de

>---------------------------------------------------------------

commit 7217daed18fa112656d9a8d5d7d860292f08a6de
Author: Rajesh Kommu <rajesh.kommu at gmail.com>
Date:   Tue Sep 9 16:15:21 2014 -0700

    removed the unused element_gauss_seidel method; results dont match master


>---------------------------------------------------------------

7217daed18fa112656d9a8d5d7d860292f08a6de
 lib/General_matrix_functions.c | 171 -----------------------------------------
 lib/prototypes.h               |   1 -
 2 files changed, 172 deletions(-)

diff --git a/lib/General_matrix_functions.c b/lib/General_matrix_functions.c
index 944dba9..c233863 100644
--- a/lib/General_matrix_functions.c
+++ b/lib/General_matrix_functions.c
@@ -162,7 +162,6 @@ double multi_grid(E,d1,F,acc,hl)
     int m,i,j,Vn,Vnmax,cycles;
     double alpha,beta;
     void gauss_seidel();
-    void element_gauss_seidel();
     void e_assemble_del2_u();
     void strip_bcs_from_residual();
     void n_assemble_del2_u();
@@ -424,176 +423,6 @@ double conj_grad(E,d0,F,acc,cycles,level)
     return(residual);   }
 #endif /* !USE_CUDA */
 
-
-/* ========================================================================================
-   An element by element version of the gauss-seidel routine. Initially this is a test
-   platform, we want to know if it handles discontinuities any better than the node/equation
-   versions
-   =========================================================================================*/
-
-void element_gauss_seidel(E,d0,F,Ad,acc,cycles,level,guess)
-    struct All_variables *E;
-    double **d0;
-    double **F,**Ad;
-    double acc;
-    int *cycles;
-    int level;
-    int guess;
-{
-    int count,i,j,k,l,m,ns,nc,d,steps,loc;
-    int p1,p2,p3,q1,q2,q3;
-    int e,eq,node,node1;
-    int element,eqn1,eqn2,eqn3,eqn11,eqn12,eqn13;
-
-    void e_assemble_del2_u();
-    void n_assemble_del2_u();
-    void strip_bcs_from_residual();
-
-    double U1[24],AD1[24],F1[24];
-    double w1,w2,w3;
-    double w11,w12,w13;
-    double w[24];
-
-    double *dd[NCS],*elt_k;
-    int *vis[NCS];
-
-    const int dims=E->mesh.nsd;
-    const int ends=enodes[dims];
-    const int n=loc_mat_size[E->mesh.nsd];
-    const int neq=E->lmesh.NEQ[level];
-    const int nel=E->lmesh.NEL[level];
-    const int nno=E->lmesh.NNO[level];
-
-
-    steps=*cycles;
-
-    for (m=1;m<=E->sphere.caps_per_proc;m++) {
-      dd[m] = (double *)malloc(neq*sizeof(double));
-      vis[m] = (int *)malloc((nno+1)*sizeof(int));
-    }
-    elt_k=(double *)malloc((24*24)*sizeof(double));
-
-    if(guess){
-	e_assemble_del2_u(E,d0,Ad,level,1);
-    }
-    else {
-      for (m=1;m<=E->sphere.caps_per_proc;m++)
-	for(i=0;i<neq;i++)
-	     Ad[m][i]=d0[m][i]=0.0;
-    }
-
-   count=0;
-   while (count <= steps)      {
-     for (m=1;m<=E->sphere.caps_per_proc;m++) {
-	for(i=1;i<=nno;i++)
-	    vis[m][i]=0;
-
-	for(e=1;e<=nel;e++) {
-
-	    elt_k = E->elt_k[level][m][e].k;
-
-	    for(i=1;i<=ends;i++)  {
-		node=E->IEN[level][m][e].node[i];
-		p1=(i-1)*dims;
-		w[p1] = w[p1+1] = w[p1+2] = 1.0;
-		if(E->NODE[level][m][node] & VBX)
-		    w[p1] = 0.0;
-		if(E->NODE[level][m][node] & VBY)
-		    w[p1+1] = 0.0;
-		if(E->NODE[level][m][node] & VBZ)
-		    w[p1+2] = 0.0;
-
-	        }
-
-
-	    for(i=1;i<=ends;i++)   {
-		node=E->IEN[level][m][e].node[i];
-		if(!vis[m][node])
-		    continue;
-
-		eqn1=E->ID[level][m][node].doff[1];
-		eqn2=E->ID[level][m][node].doff[2];
-                eqn3=E->ID[level][m][node].doff[3];
-		p1=(i-1)*dims*n;
-		p2=p1+n;
-		p3=p2+n;
-
-
-		/* update Au */
-		for(j=1;j<=ends;j++) {
-		    node1=E->IEN[level][m][e].node[j];
-
-	            eqn11=E->ID[level][m][node1].doff[1];
-		    eqn12=E->ID[level][m][node1].doff[2];
-		    eqn13=E->ID[level][m][node1].doff[3];
-		    q1=(j-1)*3;
-
-                    Ad[m][eqn11] += w[q1]*(elt_k[p1+q1] * dd[m][eqn1] + elt_k[p2+q1] * dd[m][eqn2] + elt_k[p3+q1] * dd[m][eqn3]);
-                    Ad[m][eqn12] += w[q1+1]*(elt_k[p1+q1+1] * dd[m][eqn1] + elt_k[p2+q1+1] * dd[m][eqn2] + elt_k[p3+q1+1] * dd[m][eqn3]);
-	            Ad[m][eqn13] += w[q1+2]*(elt_k[p1+q1+2] * dd[m][eqn1] + elt_k[p2+q1+2] * dd[m][eqn2] + elt_k[p3+q1+2] * dd[m][eqn3]);
-
-		   }
-	        }
-
-
-	    for(i=1;i<=ends;i++)   {
-		node=E->IEN[level][m][e].node[i];
-		if(vis[m][node])
-		    continue;
-
-		eqn1=E->ID[level][m][node].doff[1];
-		eqn2=E->ID[level][m][node].doff[2];
-		eqn3=E->ID[level][m][node].doff[3];
-		p1=(i-1)*dims*n;
-		p2=p1+n;
-		p3=p2+n;
-
-		/* update dd, d0 */
-		d0[m][eqn1] += (dd[m][eqn1] = w[(i-1)*dims]*(F[m][eqn1]-Ad[m][eqn1])*E->BI[level][m][eqn1]);
-		d0[m][eqn2] += (dd[m][eqn2] = w[(i-1)*dims+1]*(F[m][eqn2]-Ad[m][eqn2])*E->BI[level][m][eqn2]);
-		d0[m][eqn3] += (dd[m][eqn3] = w[(i-1)*dims+2]*(F[m][eqn3]-Ad[m][eqn3])*E->BI[level][m][eqn3]);
-
-		vis[m][node]=1;
-
-		/* update Au */
-		for(j=1;j<=ends;j++) {
-		   node1=E->IEN[level][m][e].node[j];
-
-		   eqn11=E->ID[level][m][node1].doff[1];
-		   eqn12=E->ID[level][m][node1].doff[2];
-		   eqn13=E->ID[level][m][node1].doff[3];
-		   q1=(j-1)*3;
-		   q2=q1+1;
-		   q3=q1+2;
-
-		   Ad[m][eqn11] += w[q1]*(elt_k[p1+q1] * dd[m][eqn1] + elt_k[p2+q1] * dd[m][eqn2] + elt_k[p3+q1] * dd[m][eqn3]);
-		   Ad[m][eqn12] += w[q2]*(elt_k[p1+q2] * dd[m][eqn1] + elt_k[p2+q2] * dd[m][eqn2] + elt_k[p3+q2] * dd[m][eqn3]);
-		   Ad[m][eqn13] += w[q3]*(elt_k[p1+q3] * dd[m][eqn1] + elt_k[p2+q3] * dd[m][eqn2] + elt_k[p3+q3] * dd[m][eqn3]);
-		   }
-	       }
-
-	    }          /* end for el  */
-	 }               /* end for m */
-
-        (E->solver.exchange_id_d)(E, Ad, level);
-        (E->solver.exchange_id_d)(E, d0, level);
-
-	/* completed cycle */
-
-	    count++;
-
-    }
-
-    for (m=1;m<=E->sphere.caps_per_proc;m++) {
-      free((double*) dd[m]);
-      free((int*) vis[m]);
-    }
-    free((double*) elt_k);
-
-    return;
-}
-
-
 #ifndef USE_CUDA
 
 /* ============================================================================
diff --git a/lib/prototypes.h b/lib/prototypes.h
index 9559d47..923dd2a 100644
--- a/lib/prototypes.h
+++ b/lib/prototypes.h
@@ -170,7 +170,6 @@ void full_construct_boundary(struct All_variables *);
 int solve_del2_u(struct All_variables *, double **, double **, double, int);
 double multi_grid(struct All_variables *, double **, double **, double, int);
 double conj_grad(struct All_variables *, double **, double **, double, int *, int);
-void element_gauss_seidel(struct All_variables *, double **, double **, double **, double, int *, int, int);
 void gauss_seidel(struct All_variables *, double **, double **, double **, double, int *, int, int);
 double determinant(double [4][4], int);
 double cofactor(double [4][4], int, int, int);



More information about the CIG-COMMITS mailing list