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

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

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

revision 3013 by gross, Thu Apr 22 05:59:31 2010 UTC revision 3014 by gross, Wed Apr 28 04:05:21 2010 UTC
# Line 423  void Paso_FCTSolver_addCorrectedFluxes(d Line 423  void Paso_FCTSolver_addCorrectedFluxes(d
423  {  {
424    dim_t i, j;    dim_t i, j;
425    Paso_SystemMatrixPattern *pattern;    Paso_SystemMatrixPattern *pattern;
426    register double RN_i, RP_i, f_i, f_ij;    register double RN_i, RP_i, f_i, f_ij, rtmp;
427    register index_t iptr_ij;    register index_t iptr_ij;
428    const double *RN=Paso_Coupler_borrowLocalData(RN_coupler);    const double *RN=Paso_Coupler_borrowLocalData(RN_coupler);
429    const double *remote_RN=Paso_Coupler_borrowRemoteData(RN_coupler);    const double *remote_RN=Paso_Coupler_borrowRemoteData(RN_coupler);
# Line 432  void Paso_FCTSolver_addCorrectedFluxes(d Line 432  void Paso_FCTSolver_addCorrectedFluxes(d
432    const dim_t n=Paso_SystemMatrix_getTotalNumRows(flux_matrix);    const dim_t n=Paso_SystemMatrix_getTotalNumRows(flux_matrix);
433    
434    pattern=flux_matrix->pattern;    pattern=flux_matrix->pattern;
435    #pragma omp parallel for schedule(static) private(i, RN_i, RP_i, iptr_ij, j, f_ij, f_i)    #pragma omp parallel for schedule(static) private(i, RN_i, RP_i, iptr_ij, j, f_ij, f_i, rtmp)
436    for (i = 0; i < n; ++i) {    for (i = 0; i < n; ++i) {
437            
438       RN_i=RN[i];       RN_i=RN[i];
# Line 442  void Paso_FCTSolver_addCorrectedFluxes(d Line 442  void Paso_FCTSolver_addCorrectedFluxes(d
442       for (iptr_ij=(pattern->mainPattern->ptr[i]);iptr_ij<pattern->mainPattern->ptr[i+1]; ++iptr_ij) {       for (iptr_ij=(pattern->mainPattern->ptr[i]);iptr_ij<pattern->mainPattern->ptr[i+1]; ++iptr_ij) {
443           j=pattern->mainPattern->index[iptr_ij];           j=pattern->mainPattern->index[iptr_ij];
444           f_ij=flux_matrix->mainBlock->val[iptr_ij];           f_ij=flux_matrix->mainBlock->val[iptr_ij];
445           if (f_ij >=0) {           rtmp=(f_ij >=0 ) ? MIN(RP_i,RN[j]) : MIN(RN_i,RP[j]) ;
446                f_i+=f_ij*MIN(RP_i,RN[j]);       f_i+=f_ij*rtmp;
          } else {  
               f_i+=f_ij*MIN(RN_i,RP[j]);  
      }  
   
447       }       }
448       #pragma ivdep       #pragma ivdep
449       for (iptr_ij=(pattern->col_couplePattern->ptr[i]);iptr_ij<pattern->col_couplePattern->ptr[i+1]; ++iptr_ij) {       for (iptr_ij=(pattern->col_couplePattern->ptr[i]);iptr_ij<pattern->col_couplePattern->ptr[i+1]; ++iptr_ij) {
450            j=pattern->col_couplePattern->index[iptr_ij];            j=pattern->col_couplePattern->index[iptr_ij];
451            f_ij=flux_matrix->col_coupleBlock->val[iptr_ij];            f_ij=flux_matrix->col_coupleBlock->val[iptr_ij];
452            if (f_ij >=0) {            rtmp=(f_ij >=0 ) ? MIN(RP_i,remote_RN[j]) : MIN(RN_i,remote_RP[j]) ;
453                f_i+=f_ij*MIN(RP_i,remote_RN[j]);            f_i+=f_ij*rtmp;
454            }else {       }
               f_i+=f_ij*MIN(RN_i,remote_RP[j]);  
           }  
       }  
455        f[i]+=f_i;        f[i]+=f_i;
456    
457    }    }

Legend:
Removed from v.3013  
changed lines
  Added in v.3014

  ViewVC Help
Powered by ViewVC 1.1.26