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

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

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

revision 2121 by gross, Fri Nov 28 05:09:23 2008 UTC revision 2122 by artak, Wed Dec 3 02:52:28 2008 UTC
# Line 42  void Paso_Pattern_coup(Paso_SparseMatrix Line 42  void Paso_Pattern_coup(Paso_SparseMatrix
42    
43    dim_t i,j;    dim_t i,j;
44    /*double threshold=0.05;*/    /*double threshold=0.05;*/
45      double sum;
46    index_t iptr,*index,*where_p,*diagptr;    index_t iptr,*index,*where_p,*diagptr;
47    bool_t passed=FALSE;    bool_t passed=FALSE;
48    dim_t n=A->numRows;    dim_t n=A->numRows;
49    diagptr=MEMALLOC(n,index_t);    diagptr=MEMALLOC(n,index_t);
50    /*double sum;*/  
51    if (A->pattern->type & PATTERN_FORMAT_SYM) {    if (A->pattern->type & PATTERN_FORMAT_SYM) {
52      Paso_setError(TYPE_ERROR,"Paso_Pattern_mis: symmetric matrix pattern is not supported yet");      Paso_setError(TYPE_ERROR,"Paso_Pattern_mis: symmetric matrix pattern is not supported yet");
53      return;      return;
# Line 110  void Paso_Pattern_coup(Paso_SparseMatrix Line 111  void Paso_Pattern_coup(Paso_SparseMatrix
111              }              }
112          }          }
113      }      }
114          
115        /* This check is to make sure we dont get some nusty rows which were not removed durring coarsing process.*/
116        /* TODO: we have to mechanism that this does not happend at all, and get rid of this 'If'. */
117        #pragma omp parallel for private(i,iptr,j,sum) schedule(static)
118        for (i=0;i<n;i++) {
119            if (mis_marker[i]==IS_REMOVED) {
120               sum=0;
121               for (iptr=A->pattern->ptr[i];iptr<A->pattern->ptr[i+1]; ++iptr) {
122                 j=A->pattern->index[iptr];
123                 if (mis_marker[j]==IS_REMOVED)
124                    sum+=A->val[iptr];
125               }
126               if(ABS(sum)<1.e-12)
127                 mis_marker[i]=IS_IN_SET;
128            }
129        }
130    
131    
132       /* swap to TRUE/FALSE in mis_marker */       /* swap to TRUE/FALSE in mis_marker */
133       #pragma omp parallel for private(i) schedule(static)       #pragma omp parallel for private(i) schedule(static)

Legend:
Removed from v.2121  
changed lines
  Added in v.2122

  ViewVC Help
Powered by ViewVC 1.1.26