/[escript]/trunk/paso/src/AMG_Interpolation.c
ViewVC logotype

Diff of /trunk/paso/src/AMG_Interpolation.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4285 by jfenwick, Tue Jan 22 09:30:23 2013 UTC revision 4286 by caltinay, Thu Mar 7 04:28:11 2013 UTC
# Line 30  Line 30 
30    
31  /************************************************************************************  /************************************************************************************
32    
33      Methods nessecary for AMG preconditioner      Methods necessary for AMG preconditioner
34    
35      construct n_C x n_C interpolation operator A_C from matrix A      construct n_C x n_C interpolation operator A_C from matrix A
36      and prolongation matrix P.      and prolongation matrix P.
# Line 39  Line 39 
39    
40  *************************************************************************************/  *************************************************************************************/
41    
42  /* Extend system matrix B with extra two sparse matrixes:  /* Extend system matrix B with extra two sparse matrices:
43      B_ext_main and B_ext_couple      B_ext_main and B_ext_couple
44     The combination of this two sparse matrixes represents       The combination of this two sparse matrices represents  
45     the portion of B that is stored on neighbor procs and     the portion of B that is stored on neighbor procs and
46     needed locally for triple matrix product (B^T) A B.     needed locally for triple matrix product (B^T) A B.
47    
# Line 577  void Paso_Preconditioner_AMG_CopyRemoteD Line 577  void Paso_Preconditioner_AMG_CopyRemoteD
577    #endif    #endif
578    P->mpi_info->msg_tag_counter += size;    P->mpi_info->msg_tag_counter += size;
579    
580    /* Clean up and return with recevied ptr, index and data arrays */    /* Clean up and return with received ptr, index and data arrays */
581    MEMFREE(ptr);    MEMFREE(ptr);
582    MEMFREE(idx);    MEMFREE(idx);
583    MEMFREE(val);    MEMFREE(val);
# Line 631  Paso_SystemMatrix* Paso_Preconditioner_A Line 631  Paso_SystemMatrix* Paso_Preconditioner_A
631  /*   if (!(P->type & MATRIX_FORMAT_DIAGONAL_BLOCK))  /*   if (!(P->type & MATRIX_FORMAT_DIAGONAL_BLOCK))
632       return Paso_Preconditioner_AMG_buildInterpolationOperatorBlock(A, P, R);*/       return Paso_Preconditioner_AMG_buildInterpolationOperatorBlock(A, P, R);*/
633    
634     /* two sparse matrixes R_main and R_couple will be generate, as the     /* two sparse matrices R_main and R_couple will be generate, as the
635        transpose of P_main and P_col_couple, respectively. Note that,        transpose of P_main and P_col_couple, respectively. Note that,
636        R_couple is actually the row_coupleBlock of R (R=P^T) */        R_couple is actually the row_coupleBlock of R (R=P^T) */
637     R_main = Paso_SparseMatrix_getTranspose(P->mainBlock);     R_main = Paso_SparseMatrix_getTranspose(P->mainBlock);
# Line 645  Paso_SystemMatrix* Paso_Preconditioner_A Line 645  Paso_SystemMatrix* Paso_Preconditioner_A
645      A->col_coupler->connector->send->shared[rPtr...]      A->col_coupler->connector->send->shared[rPtr...]
646      rPtr=A->col_coupler->connector->send->OffsetInShared[k]      rPtr=A->col_coupler->connector->send->OffsetInShared[k]
647        on q.        on q.
648        P_ext is represented by two sparse matrixes P_ext_main and        P_ext is represented by two sparse matrices P_ext_main and
649        P_ext_couple */        P_ext_couple */
650     Paso_Preconditioner_AMG_extendB(A, P);     Paso_Preconditioner_AMG_extendB(A, P);
651    
# Line 1080  Paso_SystemMatrix* Paso_Preconditioner_A Line 1080  Paso_SystemMatrix* Paso_Preconditioner_A
1080    
1081     /* Now we have part of RAP[r,c] where row "r" is the list of rows     /* Now we have part of RAP[r,c] where row "r" is the list of rows
1082        which is given by the column list of P->col_coupleBlock, and        which is given by the column list of P->col_coupleBlock, and
1083        column "c" is the list of columns which possiblely covers the        column "c" is the list of columns which possibly covers the
1084        whole column range of systme martris P. This part of data is to        whole column range of system matrix P. This part of data is to
1085        be passed to neighboring processors, and added to corresponding        be passed to neighboring processors, and added to corresponding
1086        RAP[r,c] entries in the neighboring processors */        RAP[r,c] entries in the neighboring processors */
1087     Paso_Preconditioner_AMG_CopyRemoteData(P, &RAP_ext_ptr, &RAP_ext_idx,     Paso_Preconditioner_AMG_CopyRemoteData(P, &RAP_ext_ptr, &RAP_ext_idx,
# Line 1712  Paso_SystemMatrix* Paso_Preconditioner_A Line 1712  Paso_SystemMatrix* Paso_Preconditioner_A
1712     TMPMEMFREE(P_marker);     TMPMEMFREE(P_marker);
1713    
1714     /******************************************************/     /******************************************************/
1715     /* Start to create the coasre level System Matrix A_c */     /* Start to create the coarse level System Matrix A_c */
1716     /******************************************************/     /******************************************************/
1717     /* first, prepare the sender/receiver for the col_connector */     /* first, prepare the sender/receiver for the col_connector */
1718     dist = P->pattern->input_distribution->first_component;     dist = P->pattern->input_distribution->first_component;
# Line 2075  Paso_SystemMatrix* Paso_Preconditioner_A Line 2075  Paso_SystemMatrix* Paso_Preconditioner_A
2075       int *mpi_requests=NULL, *mpi_stati=NULL;       int *mpi_requests=NULL, *mpi_stati=NULL;
2076     #endif     #endif
2077    
2078     /* two sparse matrixes R_main and R_couple will be generate, as the     /* two sparse matrices R_main and R_couple will be generate, as the
2079        transpose of P_main and P_col_couple, respectively. Note that,        transpose of P_main and P_col_couple, respectively. Note that,
2080        R_couple is actually the row_coupleBlock of R (R=P^T) */        R_couple is actually the row_coupleBlock of R (R=P^T) */
2081     R_main = Paso_SparseMatrix_getTranspose(P->mainBlock);     R_main = Paso_SparseMatrix_getTranspose(P->mainBlock);
# Line 2088  Paso_SystemMatrix* Paso_Preconditioner_A Line 2088  Paso_SystemMatrix* Paso_Preconditioner_A
2088      A->col_coupler->connector->send->shared[rPtr...]      A->col_coupler->connector->send->shared[rPtr...]
2089      rPtr=A->col_coupler->connector->send->OffsetInShared[k]      rPtr=A->col_coupler->connector->send->OffsetInShared[k]
2090        on q.        on q.
2091        P_ext is represented by two sparse matrixes P_ext_main and        P_ext is represented by two sparse matrices P_ext_main and
2092        P_ext_couple */        P_ext_couple */
2093     Paso_Preconditioner_AMG_extendB(A, P);     Paso_Preconditioner_AMG_extendB(A, P);
2094    
# Line 2516  Paso_SystemMatrix* Paso_Preconditioner_A Line 2516  Paso_SystemMatrix* Paso_Preconditioner_A
2516    
2517     /* Now we have part of RAP[r,c] where row "r" is the list of rows     /* Now we have part of RAP[r,c] where row "r" is the list of rows
2518        which is given by the column list of P->col_coupleBlock, and        which is given by the column list of P->col_coupleBlock, and
2519        column "c" is the list of columns which possiblely covers the        column "c" is the list of columns which possibly covers the
2520        whole column range of systme martris P. This part of data is to        whole column range of system matrix P. This part of data is to
2521        be passed to neighboring processors, and added to corresponding        be passed to neighboring processors, and added to corresponding
2522        RAP[r,c] entries in the neighboring processors */        RAP[r,c] entries in the neighboring processors */
2523     Paso_Preconditioner_AMG_CopyRemoteData(P, &RAP_ext_ptr, &RAP_ext_idx,     Paso_Preconditioner_AMG_CopyRemoteData(P, &RAP_ext_ptr, &RAP_ext_idx,
# Line 3139  Paso_SystemMatrix* Paso_Preconditioner_A Line 3139  Paso_SystemMatrix* Paso_Preconditioner_A
3139     TMPMEMFREE(P_marker);     TMPMEMFREE(P_marker);
3140    
3141     /******************************************************/     /******************************************************/
3142     /* Start to create the coasre level System Matrix A_c */     /* Start to create the coarse level System Matrix A_c */
3143     /******************************************************/     /******************************************************/
3144     /* first, prepare the sender/receiver for the col_connector */     /* first, prepare the sender/receiver for the col_connector */
3145     dist = P->pattern->input_distribution->first_component;     dist = P->pattern->input_distribution->first_component;

Legend:
Removed from v.4285  
changed lines
  Added in v.4286

  ViewVC Help
Powered by ViewVC 1.1.26