/[escript]/branches/domexper/dudley/src/ElementFile_markNodes.c
ViewVC logotype

Diff of /branches/domexper/dudley/src/ElementFile_markNodes.c

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

revision 782 by bcumming, Tue Jul 18 00:47:47 2006 UTC revision 787 by bcumming, Wed Jul 26 01:46:45 2006 UTC
# Line 42  void Finley_ElementFile_markNodes(index_ Line 42  void Finley_ElementFile_markNodes(index_
42          lin_node=id;          lin_node=id;
43       }       }
44       NN2=in->ReferenceElement->Type->numNodes;       NN2=in->ReferenceElement->Type->numNodes;
 /* knock out the OpenMP directives for the MPI version, get the OpenMP running  
    after the MPI is working satisfactorily */  
 #ifndef PASO_MPI  
45       if ((in->maxColor-in->minColor+1)*NN<in->numElements) {       if ((in->maxColor-in->minColor+1)*NN<in->numElements) {
46          #pragma omp parallel private(color)          #pragma omp parallel private(color)
47          {          {
# Line 61  void Finley_ElementFile_markNodes(index_ Line 58  void Finley_ElementFile_markNodes(index_
58          }          }
59        } else {        } else {
60          #pragma omp parallel for private(e,i) schedule(static)          #pragma omp parallel for private(e,i) schedule(static)
 #endif  
61          for (e=0;e<in->numElements;e++) {          for (e=0;e<in->numElements;e++) {
62             for (i=0;i<NN;i++)             for (i=0;i<NN;i++)
63               mask[in->Nodes[INDEX2(lin_node[i],e,NN2)]-offset]=1;               mask[in->Nodes[INDEX2(lin_node[i],e,NN2)]-offset]=1;
64          }          }
 #ifndef PASO_MPI  
65        }        }
 #endif  
66     }     }
67  }  }
68    
 #ifdef PASO_MPI  
   
 /* these have been trimmed down from the colors-based scheme for simplicity of testing  
    in the MPI scheme. */  
 void Finley_ElementFile_markBoundaryElementNodes(index_t* mask,index_t offset,Finley_ElementFile* in,bool_t useLinear) {  
    dim_t i,NN,NN2,e;  
    index_t color,*lin_node;  
    if (in!=NULL&& in->numElements>0) {  
      index_t id[in->ReferenceElement->Type->numNodes];  
      for (i=0;i<in->ReferenceElement->Type->numNodes;i++) id[i]=i;  
      if (useLinear) {  
         NN=in->LinearReferenceElement->Type->numNodes;  
         lin_node=in->ReferenceElement->Type->linearNodes;  
      } else {  
         NN=in->ReferenceElement->Type->numNodes;  
         lin_node=id;  
      }  
      NN2=in->ReferenceElement->Type->numNodes;  
      for (e=0;e<in->elementDistribution->numLocal;e++)  
              if( in->Id[e]>=in->elementDistribution->numInternal )  
                  for (i=0;i<NN;i++)  
                      mask[in->Nodes[INDEX2(lin_node[i],e,NN2)]-offset]=1;  
    }  
 }  
   
 void Finley_ElementFile_markInternalElementNodes(index_t* mask,index_t offset,Finley_ElementFile* in,bool_t useLinear) {  
    dim_t i,NN,NN2,e;  
    index_t color,*lin_node;  
    if (in!=NULL && in->numElements>0) {  
      index_t id[in->ReferenceElement->Type->numNodes];  
      for (i=0;i<in->ReferenceElement->Type->numNodes;i++) id[i]=i;  
      if (useLinear) {  
         NN=in->LinearReferenceElement->Type->numNodes;  
         lin_node=in->ReferenceElement->Type->linearNodes;  
      } else {  
         NN=in->ReferenceElement->Type->numNodes;  
         lin_node=id;  
      }  
      NN2=in->ReferenceElement->Type->numNodes;  
   
      for (e=0;e<in->elementDistribution->numLocal;e++)  
              if( in->Id[e]<in->elementDistribution->numInternal )  
                  for (i=0;i<NN;i++)  
                      mask[in->Nodes[INDEX2(lin_node[i],e,NN2)]-offset]=1;  
    }  
 }  
   
 void Finley_ElementFile_markBoundaryElementDOF(index_t* mask,index_t offset,index_t *degreeOfFreedom, Finley_ElementFile* in,bool_t useLinear, index_t startElement) {  
     dim_t i,NN,NN2,e;  
     index_t color,*lin_node;  
     if (in!=NULL&& in->numElements>0) {  
   
         index_t id[in->ReferenceElement->Type->numNodes];  
         for (i=0;i<in->ReferenceElement->Type->numNodes;i++) id[i]=i;  
             if (useLinear) {  
                 NN=in->LinearReferenceElement->Type->numNodes;  
                 lin_node=in->ReferenceElement->Type->linearNodes;  
             } else {  
                 NN=in->ReferenceElement->Type->numNodes;  
                 lin_node=id;  
             }  
             NN2=in->ReferenceElement->Type->numNodes;  
             for (e=0;e<in->elementDistribution->numLocal;e++)  
                 if( in->Id[e]-startElement>=in->elementDistribution->numInternal )  
                     for (i=0;i<NN;i++)  
                         mask[degreeOfFreedom[in->Nodes[INDEX2(lin_node[i],e,NN2)]]-offset]=1;  
     }  
   
 }  
   
 void Finley_ElementFile_markInternalElementDOF(index_t* mask,index_t offset,index_t *degreeOfFreedom, Finley_ElementFile* in,bool_t useLinear, index_t startElement) {  
    dim_t i,NN,NN2,e;  
    index_t color,*lin_node;  
    if (in!=NULL && in->numElements>0) {  
      index_t id[in->ReferenceElement->Type->numNodes];  
      for (i=0;i<in->ReferenceElement->Type->numNodes;i++) id[i]=i;  
      if (useLinear) {  
         NN=in->LinearReferenceElement->Type->numNodes;  
         lin_node=in->ReferenceElement->Type->linearNodes;  
      } else {  
         NN=in->ReferenceElement->Type->numNodes;  
         lin_node=id;  
      }  
      NN2=in->ReferenceElement->Type->numNodes;  
   
      for (e=0;e<in->elementDistribution->numLocal;e++)  
              if( in->Id[e]-startElement<in->elementDistribution->numInternal )  
                  for (i=0;i<NN;i++)  
                      mask[degreeOfFreedom[in->Nodes[INDEX2(lin_node[i],e,NN2)]]-offset]=1;  
    }  
 }  
 #endif  
   
69  /*  /*
70  * $Log$  * $Log$
71  * Revision 1.4  2005/09/15 03:44:22  jgs  * Revision 1.4  2005/09/15 03:44:22  jgs

Legend:
Removed from v.782  
changed lines
  Added in v.787

  ViewVC Help
Powered by ViewVC 1.1.26