/[escript]/trunk/finley/src/ElementFile_createColoring.c
ViewVC logotype

Diff of /trunk/finley/src/ElementFile_createColoring.c

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

revision 1334 by ksteube, Mon Oct 1 08:10:41 2007 UTC revision 1335 by gross, Fri Nov 2 05:54:25 2007 UTC
# Line 43  void Finley_ElementFile_createColoring(F Line 43  void Finley_ElementFile_createColoring(F
43           #pragma omp parallel for private(e) schedule(static)           #pragma omp parallel for private(e) schedule(static)
44           for (e=0;e<in->numElements;e++) in->Color[e]=-1;           for (e=0;e<in->numElements;e++) in->Color[e]=-1;
45           numUncoloredElements=in->numElements;           numUncoloredElements=in->numElements;
46             in->minColor=0;
47             in->maxColor=in->minColor-1;
48           while (numUncoloredElements>0) {           while (numUncoloredElements>0) {
49              /* initialize the mask marking nodes used by a color */              /* initialize the mask marking nodes used by a color */
50              #pragma omp parallel for private(n) schedule(static)              #pragma omp parallel for private(n) schedule(static)
# Line 57  void Finley_ElementFile_createColoring(F Line 59  void Finley_ElementFile_createColoring(F
59  #ifdef BOUNDS_CHECK  #ifdef BOUNDS_CHECK
60  if ((degreeOfFreedom[in->Nodes[INDEX2(i,e,NN)]]-min_id) >= len || (degreeOfFreedom[in->Nodes[INDEX2(i,e,NN)]]-min_id) < 0) { printf("BOUNDS_CHECK %s %d i=%d e=%d NN=%d min_id=%d dof=%d\n", __FILE__, __LINE__, i, e, NN, min_id, degreeOfFreedom[in->Nodes[INDEX2(i,e,NN)]]-min_id); exit(1); }  if ((degreeOfFreedom[in->Nodes[INDEX2(i,e,NN)]]-min_id) >= len || (degreeOfFreedom[in->Nodes[INDEX2(i,e,NN)]]-min_id) < 0) { printf("BOUNDS_CHECK %s %d i=%d e=%d NN=%d min_id=%d dof=%d\n", __FILE__, __LINE__, i, e, NN, min_id, degreeOfFreedom[in->Nodes[INDEX2(i,e,NN)]]-min_id); exit(1); }
61  #endif  #endif
62                  if (maskDOF[degreeOfFreedom[in->Nodes[INDEX2(i,e,NN)]]-min_id]>0) independent=FALSE;                  if (maskDOF[degreeOfFreedom[in->Nodes[INDEX2(i,e,NN)]]-min_id]>0) {
63                                 independent=FALSE;
64                                 break;
65                            }
66               }               }
67                       /* if e is independend a new color is assigned and the nodes are marked as being used */                       /* if e is independend a new color is assigned and the nodes are marked as being used */
68                       if (independent) {                       if (independent) {
69                           for (i=0;i<NN;i++) maskDOF[degreeOfFreedom[in->Nodes[INDEX2(i,e,NN)]]-min_id]=1;                             for (i=0;i<NN;i++) maskDOF[degreeOfFreedom[in->Nodes[INDEX2(i,e,NN)]]-min_id]=1;
70                           in->Color[e]=in->maxColor+1;                             in->Color[e]=in->maxColor+1;
71                        } else {                       } else {
72                           numUncoloredElements++;                               numUncoloredElements++;
73                        }                       }
74                    }                    }
75              }              }
76              in->maxColor++;              in->maxColor++;

Legend:
Removed from v.1334  
changed lines
  Added in v.1335

  ViewVC Help
Powered by ViewVC 1.1.26