/[escript]/trunk-mpi-branch/finley/src/Assemble_addToSystemMatrix.c
ViewVC logotype

Diff of /trunk-mpi-branch/finley/src/Assemble_addToSystemMatrix.c

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

revision 1006 by ksteube, Wed Feb 21 00:26:26 2007 UTC revision 1007 by gross, Mon Mar 5 01:00:53 2007 UTC
# Line 36  Line 36 
36  void  Finley_Assemble_addToSystemMatrix(Paso_SystemMatrix* in,dim_t NN_Equa,index_t* Nodes_Equa, dim_t num_Equa,  void  Finley_Assemble_addToSystemMatrix(Paso_SystemMatrix* in,dim_t NN_Equa,index_t* Nodes_Equa, dim_t num_Equa,
37                                                        dim_t NN_Sol,index_t* Nodes_Sol, dim_t num_Sol, double* array) {                                                        dim_t NN_Sol,index_t* Nodes_Sol, dim_t num_Sol, double* array) {
38    index_t index_offset=(in->type & MATRIX_FORMAT_OFFSET1 ? 1:0);    index_t index_offset=(in->type & MATRIX_FORMAT_OFFSET1 ? 1:0);
39    dim_t k_Equa,j_Equa,j_Sol,k_Sol,i_Equa,i_Sol,l_col,l_row,ic,ir,index,k,iptr;    dim_t k_Equa,j_Equa,j_Sol,k_Sol,i_Equa,i_Sol,l_col,l_row,ic,ir,index,k,iptr, irow, icol;
40    dim_t row_block_size=in->row_block_size;    dim_t row_block_size=in->row_block_size;
41    dim_t col_block_size=in->col_block_size;    dim_t col_block_size=in->col_block_size;
42    dim_t block_size=in->block_size;    dim_t block_size=in->block_size;
# Line 72  void  Finley_Assemble_addToSystemMatrix( Line 72  void  Finley_Assemble_addToSystemMatrix(
72           }           }
73     } else if (in->type & MATRIX_FORMAT_TRILINOS_CRS) {     } else if (in->type & MATRIX_FORMAT_TRILINOS_CRS) {
74  #ifdef PASO_MPI  #ifdef PASO_MPI
75              Finley_NodeDistribution* row_degreeOfFreedomDistribution=in->pattern->row_degreeOfFreedomDistribution;
76              Finley_NodeDistribution* col_degreeOfFreedomDistribution=in->pattern->col_degreeOfFreedomDistribution;
77            for (k_Equa=0;k_Equa<NN_Equa;++k_Equa) { /* Down columns of array */            for (k_Equa=0;k_Equa<NN_Equa;++k_Equa) { /* Down columns of array */
78              j_Equa=Nodes_Equa[k_Equa];              j_Equa=Nodes_Equa[k_Equa];
79          if (j_Equa < row_degreeOfFreedomDistribution->numLocal) {          if (j_Equa < row_degreeOfFreedomDistribution->numLocal) {
80                for (k_Sol=0;k_Sol<NN_Sol;++k_Sol) { /* Across rows of array */                for (k_Sol=0;k_Sol<NN_Sol;++k_Sol) { /* Across rows of array */
81                  j_Sol=Nodes_Sol[k_Sol];                  j_Sol=Nodes_Sol[k_Sol];
82              j_Sol = Finley_IndexList_localToGlobal(col_degreeOfFreedomDistribution, my_CPU, j_Sol);              j_Sol = Finley_IndexList_localToGlobal(col_degreeOfFreedomDistribution, j_Sol);
83                  for (l_row=0;l_row<num_subblocks_Equa;++l_row) {                  for (l_row=0;l_row<num_subblocks_Equa;++l_row) {
84                    irow=j_Equa*row_block_size+l_row;                    irow=j_Equa*row_block_size+l_row;
85                    for (l_col=0;l_col<col_blocksize;++l_col) {                    for (l_col=0;l_col<col_block_size;++l_col) {
86                       icol=j_Sol*col_blocksize+index_offset+l_col;                       icol=j_Sol*col_block_size+index_offset+l_col;
87               // irow is local and icol is global               // irow is local and icol is global
88               Trilinos_SumIntoMyValues(in->trilinos_data, irow, icol, array[INDEX4(l_row,l_col,k_Equa,k_Sol,num_Equa,num_Sol,NN_Equa)]);               Trilinos_SumIntoMyValues(in->trilinos_data, irow, icol, array[INDEX4(l_row,l_col,k_Equa,k_Sol,num_Equa,num_Sol,NN_Equa)]);
89                }                }

Legend:
Removed from v.1006  
changed lines
  Added in v.1007

  ViewVC Help
Powered by ViewVC 1.1.26