/[escript]/trunk/finley/src/CPPAdapter/SystemMatrixAdapter.cpp
ViewVC logotype

Diff of /trunk/finley/src/CPPAdapter/SystemMatrixAdapter.cpp

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

revision 1338 by ksteube, Mon Sep 24 06:18:44 2007 UTC revision 1339 by ksteube, Wed Nov 7 01:53:12 2007 UTC
# Line 138  int SystemMatrixAdapter::mapOptionToPaso Line 138  int SystemMatrixAdapter::mapOptionToPaso
138      }      }
139  }  }
140    
141    void finley::SystemMatrixAdapter::Print_Matrix_Info(const bool full=false) const
142    {
143      Paso_SystemMatrix* mat=m_system_matrix.get();
144      int first_row_index  = mat->row_distribution->first_component[mat->mpi_info->rank];
145      int last_row_index   = mat->row_distribution->first_component[mat->mpi_info->rank+1]-1;
146      int first_col_index  = mat->col_distribution->first_component[mat->mpi_info->rank];
147      int last_col_index   = mat->col_distribution->first_component[mat->mpi_info->rank+1]-1;
148    
149      fprintf(stdout, "Print_Matrix_Info running on CPU %d of %d\n", mat->mpi_info->rank, mat->mpi_info->size);
150    
151      switch (mat->type) {
152        case MATRIX_FORMAT_DEFAULT:     fprintf(stdout, "\tMatrix type MATRIX_FORMAT_DEFAULT\n"); break;
153        case MATRIX_FORMAT_CSC:     fprintf(stdout, "\tMatrix type MATRIX_FORMAT_CSC\n"); break;
154        case MATRIX_FORMAT_SYM:     fprintf(stdout, "\tMatrix type MATRIX_FORMAT_SYM\n"); break;
155        case MATRIX_FORMAT_BLK1:        fprintf(stdout, "\tMatrix type MATRIX_FORMAT_BLK1\n"); break;
156        case MATRIX_FORMAT_OFFSET1:     fprintf(stdout, "\tMatrix type MATRIX_FORMAT_OFFSET1\n"); break;
157        case MATRIX_FORMAT_TRILINOS_CRS:    fprintf(stdout, "\tMatrix type MATRIX_FORMAT_TRILINOS_CRS\n"); break;
158        default:                fprintf(stdout, "\tMatrix type unknown\n"); break;
159      }
160    
161      fprintf(stdout, "\trow indices run from %d to %d\n", first_row_index, last_row_index);
162      fprintf(stdout, "\tcol indices run from %d to %d\n", first_col_index, last_col_index);
163      fprintf(stdout, "\tmainBlock numRows %d\n", mat->mainBlock->numRows);
164      fprintf(stdout, "\tmainBlock numCols %d\n", mat->mainBlock->numCols);
165      fprintf(stdout, "\tmainBlock pattern numOutput %d\n", mat->mainBlock->pattern->numOutput);
166      fprintf(stdout, "\tcoupleBlock numRows %d\n", mat->coupleBlock->numRows);
167      fprintf(stdout, "\tcoupleBlock numCols %d\n", mat->coupleBlock->numCols);
168      fprintf(stdout, "\tcoupleBlock pattern numOutput %d\n", mat->coupleBlock->pattern->numOutput);
169      fprintf(stdout, "\trow_block_size %d\n", mat->row_block_size);
170      fprintf(stdout, "\tcol_block_size %d\n", mat->col_block_size);
171      fprintf(stdout, "\tblock_size %d\n", mat->block_size);
172      fprintf(stdout, "\tlogical_row_block_size %d\n", mat->logical_row_block_size);
173      fprintf(stdout, "\tlogical_col_block_size %d\n", mat->logical_col_block_size);
174      fprintf(stdout, "\tlogical_block_size %d\n", mat->logical_block_size);
175    
176      if (full) {
177        printf("\trow_distribution: ");
178        for(int i=0; i<=mat->mpi_info->size; i++) printf("%3d ", mat->row_distribution[i]);
179        printf("\n");
180        printf("\tcol_distribution: ");
181        for(int i=0; i<=mat->mpi_info->size; i++) printf("%3d ", mat->col_distribution[i]);
182        printf("\n");
183      }
184    
185    }
186    
187  void SystemMatrixAdapter::setToSolution(escript::Data& out,escript::Data& in, const boost::python::dict& options) const  void SystemMatrixAdapter::setToSolution(escript::Data& out,escript::Data& in, const boost::python::dict& options) const
188  {  {
189      Paso_SystemMatrix* mat=getPaso_SystemMatrix();      Paso_SystemMatrix* mat=getPaso_SystemMatrix();

Legend:
Removed from v.1338  
changed lines
  Added in v.1339

  ViewVC Help
Powered by ViewVC 1.1.26