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

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

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

revision 966 by gross, Tue Feb 13 05:10:26 2007 UTC revision 967 by gross, Tue Feb 13 09:40:12 2007 UTC
# Line 93  void Finley_Mesh_prepareNodes(Finley_Mes Line 93  void Finley_Mesh_prepareNodes(Finley_Mes
93    
94        /* get a list of the DOFs in the reduced mesh and convert it into reducedDegreeOfFreedom */        /* get a list of the DOFs in the reduced mesh and convert it into reducedDegreeOfFreedom */
95        in->Nodes->reducedNumDegreesOfFreedom=Finley_Util_packMask(len,maskReducedDOF,index);        in->Nodes->reducedNumDegreesOfFreedom=Finley_Util_packMask(len,maskReducedDOF,index);
96        MEMFREE(in->Nodes->reducedDegreeOfFreedomId);        #pragma omp parallel for private(n) schedule(static)
97        in->Nodes->reducedDegreeOfFreedomId=MEMALLOC(in->Nodes->reducedNumDegreesOfFreedom,index_t);        for (n=0;n<in->Nodes->reducedNumDegreesOfFreedom;n++) {
       if (! Finley_checkPtr(in->Nodes->reducedDegreeOfFreedomId) )  {  
          #pragma omp parallel for private(n) schedule(static)  
          for (n=0;n<in->Nodes->reducedNumDegreesOfFreedom;n++) {  
98             maskReducedDOF[index[n]]=n;               maskReducedDOF[index[n]]=n;  
99             in->Nodes->reducedDegreeOfFreedomId[n] = in->Nodes->Id[index[n]];        }
          }  
100    
101           /* get a list of the DOFs and convert it into degreeOfFreedom */        /* get a list of the DOFs and convert it into degreeOfFreedom */
102           in->Nodes->numDegreesOfFreedom=Finley_Util_packMask(len,maskDOF,index);        in->Nodes->numDegreesOfFreedom=Finley_Util_packMask(len,maskDOF,index);
103           MEMFREE(in->Nodes->degreeOfFreedomId);        MEMFREE(in->Nodes->degreeOfFreedomId);
104           in->Nodes->degreeOfFreedomId=MEMALLOC(in->Nodes->numDegreesOfFreedom,index_t);        MEMFREE(in->Nodes->reducedDegreeOfFreedomId);
105           if (! Finley_checkPtr(in->Nodes->degreeOfFreedomId)) {        in->Nodes->degreeOfFreedomId=MEMALLOC(in->Nodes->numDegreesOfFreedom,index_t);
106          in->Nodes->reducedDegreeOfFreedomId=MEMALLOC(in->Nodes->reducedNumDegreesOfFreedom,index_t);
107          if (! ( Finley_checkPtr(in->Nodes->degreeOfFreedomId) || Finley_checkPtr(in->Nodes->reducedDegreeOfFreedomId) ) ) {
108               #pragma omp parallel               #pragma omp parallel
109               {               {
110                   #pragma omp for private(n) schedule(static)                   #pragma omp for private(n) schedule(static)
111                   for (n=0;n<in->Nodes->numDegreesOfFreedom;n++) {                   for (n=0;n<in->Nodes->numDegreesOfFreedom;n++) {
112                     maskDOF[index[n]]=n;                     maskDOF[index[n]]=n;
                    in->Nodes->degreeOfFreedomId[n]=in->Nodes->Id[index[n]];  
113                   }                   }
114                   #pragma omp for private(n,id) schedule(static)                   #pragma omp for private(n,id) schedule(static)
115                   for (n=0;n<in->Nodes->numNodes;n++) {                   for (n=0;n<in->Nodes->numNodes;n++) {
116                         id=in->Nodes->degreeOfFreedom[n]-min_id;                         id=in->Nodes->degreeOfFreedom[n]-min_id;
117                         in->Nodes->degreeOfFreedom[n]=maskDOF[id];                         in->Nodes->degreeOfFreedom[n]=maskDOF[id];
118                         in->Nodes->reducedDegreeOfFreedom[n]=maskReducedDOF[id];                         in->Nodes->reducedDegreeOfFreedom[n]=maskReducedDOF[id];
119                           if (maskReducedDOF[id]>-1) in->Nodes->reducedDegreeOfFreedomId[maskReducedDOF[id]]=in->Nodes->Id[n];
120                           if (maskDOF[id]>-1) in->Nodes->degreeOfFreedomId[maskDOF[id]]=in->Nodes->Id[n];
121                   }                   }
122               }               }
          }  
123        }        }
124     }     }
   
125  #ifdef PASO_MPI  #ifdef PASO_MPI
126    /***********************************************************    /***********************************************************
127      update the distribution data      update the distribution data

Legend:
Removed from v.966  
changed lines
  Added in v.967

  ViewVC Help
Powered by ViewVC 1.1.26