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

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

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

revision 1362 by gross, Mon Dec 17 02:28:16 2007 UTC revision 1363 by gross, Mon Dec 17 03:42:03 2007 UTC
# Line 44  Line 44 
44  /* b[i,i]-=alpha*d_ij  */  /* b[i,i]-=alpha*d_ij  */
45  /* b[j,j]-=alpha*d_ij  */  /* b[j,j]-=alpha*d_ij  */
46    
47  void Paso_FCTransportProblem_addDiffusion(Paso_FCTransportProblem * fc, double alpha, Paso_SystemMatrix * B) {  void Paso_FCTransportProblem_addAdvectivePart(Paso_FCTransportProblem * fc, double alpha) {
48    dim_t n,i;    dim_t n,i;
49    index_t color, iptr_ij,j,iptr_ji;    index_t color, iptr_ij,j,iptr_ji;
50    register double d_ij;    register double d_ij;
51    
52    if (fc==NULL) return;    if (fc==NULL) return;
53    n=Paso_SystemMatrix_getTotalNumRows(fc->flux_matrix);    n=Paso_SystemMatrix_getTotalNumRows(fc->flux_matrix);
   /* TODO test - same pattern + block size */  
54    
55    #pragma omp parallel private(color)    #pragma omp parallel private(color)
56    {    {
# Line 67  void Paso_FCTransportProblem_addDiffusio Line 66  void Paso_FCTransportProblem_addDiffusio
66                          for (iptr_ji=fc->flux_matrix->mainBlock->pattern->ptr[i];iptr_ji<fc->flux_matrix->mainBlock->pattern->ptr[j+1]-1; ++iptr_ji) {                          for (iptr_ji=fc->flux_matrix->mainBlock->pattern->ptr[i];iptr_ji<fc->flux_matrix->mainBlock->pattern->ptr[j+1]-1; ++iptr_ji) {
67                              if (fc->flux_matrix->mainBlock->pattern->index[iptr_ji]==i) {                              if (fc->flux_matrix->mainBlock->pattern->index[iptr_ji]==i) {
68                                  d_ij=(-alpha)*MIN3(0.,fc->flux_matrix->mainBlock->val[iptr_ij],fc->flux_matrix->mainBlock->val[iptr_ji]);                                  d_ij=(-alpha)*MIN3(0.,fc->flux_matrix->mainBlock->val[iptr_ij],fc->flux_matrix->mainBlock->val[iptr_ji]);
69                                  B->mainBlock->val[iptr_ij]+=alpha*fc->flux_matrix->mainBlock->val[iptr_ij]+d_ij;                                  fc->transport_matrix->mainBlock->val[iptr_ij]+=alpha*fc->flux_matrix->mainBlock->val[iptr_ij]+d_ij;
70                                  B->mainBlock->val[iptr_ji]+=alpha*fc->flux_matrix->mainBlock->val[iptr_ji]+d_ij;                                  fc->transport_matrix->mainBlock->val[iptr_ji]+=alpha*fc->flux_matrix->mainBlock->val[iptr_ji]+d_ij;
71                                  B->mainBlock->val[fc->main_iptr[i]]-=d_ij;                                  fc->transport_matrix->mainBlock->val[fc->main_iptr[i]]-=d_ij;
72                                  B->mainBlock->val[fc->main_iptr[j]]-=d_ij;                                  fc->transport_matrix->mainBlock->val[fc->main_iptr[j]]-=d_ij;
73                                  break;                                  break;
74                              }                              }
75                          }                          }

Legend:
Removed from v.1362  
changed lines
  Added in v.1363

  ViewVC Help
Powered by ViewVC 1.1.26