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

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

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

trunk/finley/src/finley/ElementFile_markNodes.c revision 201 by jgs, Wed Nov 23 04:10:21 2005 UTC trunk/finley/src/ElementFile_markNodes.c revision 751 by bcumming, Mon Jun 26 01:46:34 2006 UTC
# Line 1  Line 1 
1  /*  /*
2   ******************************************************************************   ************************************************************
3   *                                                                            *   *          Copyright 2006 by ACcESS MNRF                   *
4   *       COPYRIGHT  ACcESS 2003,2004,2005 -  All Rights Reserved              *   *                                                          *
5   *                                                                            *   *              http://www.access.edu.au                    *
6   * This software is the property of ACcESS. No part of this code              *   *       Primary Business: Queensland, Australia            *
7   * may be copied in any form or by any means without the expressed written    *   *  Licensed under the Open Software License version 3.0    *
8   * consent of ACcESS.  Copying, use or modification of this software          *   *     http://www.opensource.org/licenses/osl-3.0.php       *
9   * by any unauthorised person is illegal unless that person has a software    *   *                                                          *
10   * license agreement with ACcESS.                                             *   ************************************************************
  *                                                                            *  
  ******************************************************************************  
11  */  */
12    
13  /**************************************************************/  /**************************************************************/
# Line 44  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;
45    /* knock out the OpenMP directives for the MPI version, get the OpenMP running
46       after the MPI is working satisfactorily */
47    #ifndef PASO_MPI
48       if ((in->maxColor-in->minColor+1)*NN<in->numElements) {       if ((in->maxColor-in->minColor+1)*NN<in->numElements) {
49          #pragma omp parallel private(color)          #pragma omp parallel private(color)
50          {          {
# Line 51  void Finley_ElementFile_markNodes(index_ Line 52  void Finley_ElementFile_markNodes(index_
52               #pragma omp for private(e,i) schedule(static)               #pragma omp for private(e,i) schedule(static)
53               for (e=0;e<in->numElements;e++) {               for (e=0;e<in->numElements;e++) {
54                 if (in->Color[e]==color) {                 if (in->Color[e]==color) {
55                    for (i=0;i<NN;i++) mask[in->Nodes[INDEX2(lin_node[i],e,NN2)]-offset]=1;                    for (i=0;i<NN;i++)
56                        mask[in->Nodes[INDEX2(lin_node[i],e,NN2)]-offset]=1;
57                 }                 }
58               }               }
59             }             }
# Line 59  void Finley_ElementFile_markNodes(index_ Line 61  void Finley_ElementFile_markNodes(index_
61          }          }
62        } else {        } else {
63          #pragma omp parallel for private(e,i) schedule(static)          #pragma omp parallel for private(e,i) schedule(static)
64    #endif
65          for (e=0;e<in->numElements;e++) {          for (e=0;e<in->numElements;e++) {
66             for (i=0;i<NN;i++) mask[in->Nodes[INDEX2(lin_node[i],e,NN2)]-offset]=1;             for (i=0;i<NN;i++)
67                 mask[in->Nodes[INDEX2(lin_node[i],e,NN2)]-offset]=1;
68          }          }
69    #ifndef PASO_MPI
70        }        }
71    #endif
72     }     }
73  }  }
74    
75    #ifdef PASO_MPI
76    
77    /* these have been trimmed down from the colors-based scheme for simplicity of testing
78       in the MPI scheme. */
79    void Finley_ElementFile_markBoundaryElementNodes(index_t* mask,index_t offset,Finley_ElementFile* in,bool_t useLinear) {
80       dim_t i,NN,NN2,e;
81       index_t color,*lin_node;
82       if (in!=NULL&& in->numElements>0) {
83         index_t id[in->ReferenceElement->Type->numNodes];
84         for (i=0;i<in->ReferenceElement->Type->numNodes;i++) id[i]=i;
85         if (useLinear) {
86            NN=in->LinearReferenceElement->Type->numNodes;
87            lin_node=in->ReferenceElement->Type->linearNodes;
88         } else {
89            NN=in->ReferenceElement->Type->numNodes;
90            lin_node=id;
91         }
92         NN2=in->ReferenceElement->Type->numNodes;
93         for (e=0;e<in->elementDistribution->numBoundary;e++)
94           for (i=0;i<NN;i++)
95             mask[in->Nodes[INDEX2(lin_node[i],e+in->elementDistribution->numInternal,NN2)]-offset]=1;
96       }
97    }
98    
99    void Finley_ElementFile_markInternalElementNodes(index_t* mask,index_t offset,Finley_ElementFile* in,bool_t useLinear) {
100       dim_t i,NN,NN2,e;
101       index_t color,*lin_node;
102       if (in!=NULL && in->numElements>0) {
103         index_t id[in->ReferenceElement->Type->numNodes];
104         for (i=0;i<in->ReferenceElement->Type->numNodes;i++) id[i]=i;
105         if (useLinear) {
106            NN=in->LinearReferenceElement->Type->numNodes;
107            lin_node=in->ReferenceElement->Type->linearNodes;
108         } else {
109            NN=in->ReferenceElement->Type->numNodes;
110            lin_node=id;
111         }
112         NN2=in->ReferenceElement->Type->numNodes;
113    
114         for (e=0;e<in->elementDistribution->numInternal;e++)
115           for (i=0;i<NN;i++)
116             mask[in->Nodes[INDEX2(lin_node[i],e,NN2)]-offset]=1;
117       }
118    }
119    
120    void Finley_ElementFile_markBoundaryElementDOF(index_t* mask,index_t offset,index_t *degreeOfFreedom,Finley_ElementFile* in,bool_t useLinear) {
121       dim_t i,NN,NN2,e;
122       index_t color,*lin_node;
123       if (in!=NULL&& in->numElements>0) {
124         index_t id[in->ReferenceElement->Type->numNodes];
125         for (i=0;i<in->ReferenceElement->Type->numNodes;i++) id[i]=i;
126         if (useLinear) {
127            NN=in->LinearReferenceElement->Type->numNodes;
128            lin_node=in->ReferenceElement->Type->linearNodes;
129         } else {
130            NN=in->ReferenceElement->Type->numNodes;
131            lin_node=id;
132         }
133         NN2=in->ReferenceElement->Type->numNodes;
134         for (e=0;e<in->elementDistribution->numBoundary;e++)
135           for (i=0;i<NN;i++)
136             mask[degreeOfFreedom[in->Nodes[INDEX2(lin_node[i],e+in->elementDistribution->numInternal,NN2)]]-offset]=1;
137       }
138    }
139    
140    void Finley_ElementFile_markInternalElementDOF(index_t* mask,index_t offset,index_t *degreeOfFreedom, Finley_ElementFile* in,bool_t useLinear) {
141       dim_t i,NN,NN2,e;
142       index_t color,*lin_node;
143       if (in!=NULL && in->numElements>0) {
144         index_t id[in->ReferenceElement->Type->numNodes];
145         for (i=0;i<in->ReferenceElement->Type->numNodes;i++) id[i]=i;
146         if (useLinear) {
147            NN=in->LinearReferenceElement->Type->numNodes;
148            lin_node=in->ReferenceElement->Type->linearNodes;
149         } else {
150            NN=in->ReferenceElement->Type->numNodes;
151            lin_node=id;
152         }
153         NN2=in->ReferenceElement->Type->numNodes;
154    
155         for (e=0;e<in->elementDistribution->numInternal;e++)
156           for (i=0;i<NN;i++)
157             mask[degreeOfFreedom[in->Nodes[INDEX2(lin_node[i],e,NN2)]]-offset]=1;
158       }
159    }
160    #endif
161    
162  /*  /*
163  * $Log$  * $Log$
164  * Revision 1.4  2005/09/15 03:44:22  jgs  * Revision 1.4  2005/09/15 03:44:22  jgs

Legend:
Removed from v.201  
changed lines
  Added in v.751

  ViewVC Help
Powered by ViewVC 1.1.26