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

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

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

revision 3314 by gross, Tue Oct 26 22:22:20 2010 UTC revision 3369 by gross, Fri Nov 19 06:26:11 2010 UTC
# Line 72  Paso_SystemMatrix* Paso_SystemMatrix_all Line 72  Paso_SystemMatrix* Paso_SystemMatrix_all
72       out->mainBlock=NULL;       out->mainBlock=NULL;
73       out->row_coupleBlock=NULL;       out->row_coupleBlock=NULL;
74       out->col_coupleBlock=NULL;       out->col_coupleBlock=NULL;
75       out->normalizer_is_valid=FALSE;       out->is_balanced=FALSE;
76       out->normalizer=NULL;       out->balance_vector=NULL;
77       out->solver_package=PASO_PASO;         out->solver_package=PASO_PASO;  
78       out->solver_p=NULL;         out->solver_p=NULL;  
79       out->trilinos_data=NULL;       out->trilinos_data=NULL;
# Line 135  Paso_SystemMatrix* Paso_SystemMatrix_all Line 135  Paso_SystemMatrix* Paso_SystemMatrix_all
135             out->row_coupleBlock=Paso_SparseMatrix_alloc(type,out->pattern->row_couplePattern,row_block_size,col_block_size,TRUE);             out->row_coupleBlock=Paso_SparseMatrix_alloc(type,out->pattern->row_couplePattern,row_block_size,col_block_size,TRUE);
136             if (Esys_noError()) {             if (Esys_noError()) {
137                /* allocate memory for matrix entries */                /* allocate memory for matrix entries */
138                if (type & MATRIX_FORMAT_CSC) {                n_norm = MAX(out->mainBlock->numCols * out->col_block_size, out->mainBlock->numRows * out->row_block_size);
139                   n_norm = out->mainBlock->numCols * out->col_block_size;            out->balance_vector=MEMALLOC(n_norm,double);
140                } else {            out->is_balanced=FALSE;
141                   n_norm = out->mainBlock->numRows * out->row_block_size;            if (! Esys_checkPtr(out->balance_vector)) {
               }  
               out->normalizer=MEMALLOC(n_norm,double);  
               out->normalizer_is_valid=FALSE;  
               if (! Esys_checkPtr(out->normalizer)) {  
142                   #pragma omp parallel for private(i) schedule(static)                   #pragma omp parallel for private(i) schedule(static)
143                   for (i=0;i<n_norm;++i) out->normalizer[i]=0.;                   for (i=0;i<n_norm;++i) out->balance_vector[i]=1.;
144                }                }
145             }             }
146          }          }
# Line 182  void Paso_SystemMatrix_free(Paso_SystemM Line 178  void Paso_SystemMatrix_free(Paso_SystemM
178          Paso_SparseMatrix_free(in->mainBlock);          Paso_SparseMatrix_free(in->mainBlock);
179          Paso_SparseMatrix_free(in->col_coupleBlock);          Paso_SparseMatrix_free(in->col_coupleBlock);
180          Paso_SparseMatrix_free(in->row_coupleBlock);          Paso_SparseMatrix_free(in->row_coupleBlock);
181          MEMFREE(in->normalizer);      MEMFREE(in->balance_vector);
182          Paso_solve_free(in);          Paso_solve_free(in);
183          #ifdef TRILINOS          #ifdef TRILINOS
184          Paso_TRILINOS_free(in->trilinos_data);          Paso_TRILINOS_free(in->trilinos_data);

Legend:
Removed from v.3314  
changed lines
  Added in v.3369

  ViewVC Help
Powered by ViewVC 1.1.26