/[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

revision 787 by bcumming, Wed Jul 26 01:46:45 2006 UTC revision 2548 by jfenwick, Mon Jul 20 06:20:06 2009 UTC
# Line 1  Line 1 
1  /*  
2   ************************************************************  /*******************************************************
3   *          Copyright 2006 by ACcESS MNRF                   *  *
4   *                                                          *  * Copyright (c) 2003-2009 by University of Queensland
5   *              http://www.access.edu.au                    *  * Earth Systems Science Computational Center (ESSCC)
6   *       Primary Business: Queensland, Australia            *  * http://www.uq.edu.au/esscc
7   *  Licensed under the Open Software License version 3.0    *  *
8   *     http://www.opensource.org/licenses/osl-3.0.php       *  * Primary Business: Queensland, Australia
9   *                                                          *  * Licensed under the Open Software License version 3.0
10   ************************************************************  * http://www.opensource.org/licenses/osl-3.0.php
11  */  *
12    *******************************************************/
13    
14    
15  /**************************************************************/  /**************************************************************/
16    
# Line 18  Line 20 
20    
21  /**************************************************************/  /**************************************************************/
22    
 /*  Copyrights by ACcESS Australia 2003,2004,2005 */  
 /*  Author: gross@access.edu.au */  
 /*  Version: $Id$ */  
   
 /**************************************************************/  
   
23  #include "ElementFile.h"  #include "ElementFile.h"
24    
25  /**************************************************************/  /**************************************************************/
26    
27  void Finley_ElementFile_markNodes(index_t* mask,index_t offset,Finley_ElementFile* in,bool_t useLinear) {  void Finley_ElementFile_markNodes(index_t* mask,index_t offset,dim_t numNodes,Finley_ElementFile* in,bool_t useLinear) {
28     dim_t i,NN,NN2,e;     dim_t i,NN,NN2,e;
29     index_t color,*lin_node;     index_t *lin_node,*id=NULL;
30     if (in!=NULL) {     if (in!=NULL) {
31       index_t id[in->ReferenceElement->Type->numNodes];       id=TMPMEMALLOC(in->ReferenceElement->Type->numNodes, index_t);
32       for (i=0;i<in->ReferenceElement->Type->numNodes;i++) id[i]=i;       if (! Finley_checkPtr(id) ){
33       if (useLinear) {          if (useLinear) {
34          NN=in->LinearReferenceElement->Type->numNodes;             NN=in->LinearReferenceElement->Type->numNodes;
35          lin_node=in->ReferenceElement->Type->linearNodes;             lin_node=in->ReferenceElement->Type->linearNodes;
36       } else {          } else {
37          NN=in->ReferenceElement->Type->numNodes;             NN=in->ReferenceElement->Type->numNodes;
38          lin_node=id;             lin_node=id;
39       }             for (i=0;i<in->ReferenceElement->Type->numNodes;i++) id[i]=i;
      NN2=in->ReferenceElement->Type->numNodes;  
      if ((in->maxColor-in->minColor+1)*NN<in->numElements) {  
         #pragma omp parallel private(color)  
         {  
            for (color=in->minColor;color<=in->maxColor;color++) {  
              #pragma omp for private(e,i) schedule(static)  
              for (e=0;e<in->numElements;e++) {  
                if (in->Color[e]==color) {  
                   for (i=0;i<NN;i++)  
                     mask[in->Nodes[INDEX2(lin_node[i],e,NN2)]-offset]=1;  
                }  
              }  
            }  
            #pragma omp barrier  
40          }          }
41        } else {          NN2=in->numNodes;
42    
43          #pragma omp parallel for private(e,i) schedule(static)          #pragma omp parallel for private(e,i) schedule(static)
44          for (e=0;e<in->numElements;e++) {          for (e=0;e<in->numElements;e++) {
45             for (i=0;i<NN;i++)              for (i=0;i<NN;i++) {
46               mask[in->Nodes[INDEX2(lin_node[i],e,NN2)]-offset]=1;                  mask[in->Nodes[INDEX2(lin_node[i],e,NN2)]-offset]=1;
47               }
48          }          }
49        }          TMPMEMFREE(id);
50         }
51       }
52    }
53    
54    void Finley_ElementFile_markDOFsConnectedToRange(index_t* mask,index_t offset,index_t marker,index_t firstDOF,index_t lastDOF,index_t *dofIndex,Finley_ElementFile*in ,bool_t useLinear)
55    {
56       dim_t i,NN,NN2,e,j;
57       index_t color,*lin_node,*id=NULL,k;
58       if (in!=NULL) {
59         id=TMPMEMALLOC(in->ReferenceElement->Type->numNodes, index_t);
60         if (! Finley_checkPtr(id) ){
61            if (useLinear) {
62               NN=in->LinearReferenceElement->Type->numNodes;
63               lin_node=in->ReferenceElement->Type->linearNodes;
64            } else {
65               NN=in->ReferenceElement->Type->numNodes;
66               lin_node=id;
67               for (i=0;i<in->ReferenceElement->Type->numNodes;i++) id[i]=i;
68            }
69            NN2=in->numNodes;
70            for (color=in->minColor;color<=in->maxColor;color++) {
71                #pragma omp parallel for private(e,i,j,k) schedule(static)
72                for (e=0;e<in->numElements;e++) {
73                   if (in->Color[e]==color) {
74                      for (i=0;i<NN;i++) {
75                         k=dofIndex[in->Nodes[INDEX2(lin_node[i],e,NN2)]];
76                         if ( (firstDOF<=k) && (k<lastDOF) ) {
77                            for (j=0;j<NN;j++) {
78                                       mask[dofIndex[in->Nodes[INDEX2(lin_node[j],e,NN2)]]-offset]=marker;
79                            }
80                            break;
81                         }
82                      }
83                   }
84                }
85            }
86         }
87         TMPMEMFREE(id);
88     }     }
89  }  }
90    
 /*  
 * $Log$  
 * Revision 1.4  2005/09/15 03:44:22  jgs  
 * Merge of development branch dev-02 back to main trunk on 2005-09-15  
 *  
 * Revision 1.3.2.1  2005/09/07 06:26:18  gross  
 * the solver from finley are put into the standalone package paso now  
 *  
 * Revision 1.3  2005/07/22 03:53:08  jgs  
 * Merge of development branch back to main trunk on 2005-07-22  
 *  
 * Revision 1.2  2005/07/08 04:07:50  jgs  
 * Merge of development branch back to main trunk on 2005-07-08  
 *  
 * Revision 1.1.1.1.2.2  2005/07/18 10:34:54  gross  
 * some informance improvements when reading meshes  
 *  
 * Revision 1.1.1.1.2.1  2005/06/29 02:34:49  gross  
 * some changes towards 64 integers in finley  
 *  
 * Revision 1.1.1.1  2004/10/26 06:53:57  jgs  
 * initial import of project esys2  
 *  
 * Revision 1.1.1.1  2004/06/24 04:00:40  johng  
 * Initial version of eys using boost-python.  
 *  
 *  
 */  

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

  ViewVC Help
Powered by ViewVC 1.1.26