/[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 3004 by jfenwick, Thu Jan 28 02:03:15 2010 UTC revision 3005 by gross, Thu Apr 22 05:59:31 2010 UTC
# Line 250  dim_t Paso_SystemMatrix_getNumOutput(Pas Line 250  dim_t Paso_SystemMatrix_getNumOutput(Pas
250     return Paso_SystemMatrixPattern_getNumOutput(A->pattern);     return Paso_SystemMatrixPattern_getNumOutput(A->pattern);
251  }  }
252    
253    index_t* Paso_SystemMatrix_borrowMainDiagonalPointer(Paso_SystemMatrix * A_p)
254    {
255        return  Paso_SparseMatrix_borrowMainDiagonalPointer(A_p->mainBlock);
256    }
257    
258    void Paso_SystemMatrix_makeZeroRowSums(Paso_SystemMatrix * A_p, double* left_over)
259    {
260       index_t ir, ib, irow;
261       register double rtmp1, rtmp2;
262       const dim_t n = Paso_SystemMatrixPattern_getNumOutput(A_p->pattern);
263       const dim_t nblk = A_p->block_size;
264       const dim_t blk = A_p->row_block_size;
265       const index_t* main_ptr=Paso_SystemMatrix_borrowMainDiagonalPointer(A_p);
266      
267      
268       Paso_SystemMatrix_rowSum(A_p, left_over); /* left_over now hold the row sum */
269    
270       #pragma omp parallel for private(ir,ib, rtmp1, rtmp2) schedule(static)
271       for (ir=0;ir< n;ir++) {
272           for (ib=0;ib<blk; ib++) {
273             irow=ib+blk*ir;
274             rtmp1=left_over[irow];
275             rtmp2=A_p->mainBlock->val[main_ptr[ir]*nblk+ib+blk*ib];
276             A_p->mainBlock->val[main_ptr[ir]*nblk+ib+blk*ib] = -rtmp1;
277             left_over[irow]=rtmp2+rtmp1;
278           }
279       }
280    }
281    void Paso_SystemMatrix_copyBlockFromMainDiagonal(Paso_SystemMatrix * A_p, double* out)
282    {
283        Paso_SparseMatrix_copyBlockFromMainDiagonal(A_p->mainBlock, out);
284        return;
285    }
286    void Paso_SystemMatrix_copyBlockToMainDiagonal(Paso_SystemMatrix * A_p, const double* in)
287    {
288        Paso_SparseMatrix_copyBlockToMainDiagonal(A_p->mainBlock, in);
289        return;
290    }
291    void Paso_SystemMatrix_copyFromMainDiagonal(Paso_SystemMatrix * A_p, double* out)
292    {
293        Paso_SparseMatrix_copyFromMainDiagonal(A_p->mainBlock, out);
294        return;
295    }
296    void Paso_SystemMatrix_copyToMainDiagonal(Paso_SystemMatrix * A_p, const double* in)
297    {
298        Paso_SparseMatrix_copyToMainDiagonal(A_p->mainBlock, in);
299        return;
300    }

Legend:
Removed from v.3004  
changed lines
  Added in v.3005

  ViewVC Help
Powered by ViewVC 1.1.26