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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2548 - (hide annotations)
Mon Jul 20 06:20:06 2009 UTC (9 years, 11 months ago) by jfenwick
Original Path: trunk/finley/src/ElementFile_markNodes.c
File MIME type: text/plain
File size: 3044 byte(s)
Updating copyright notices
1 jgs 150
2 ksteube 1312 /*******************************************************
3 ksteube 1811 *
4 jfenwick 2548 * Copyright (c) 2003-2009 by University of Queensland
5 ksteube 1811 * Earth Systems Science Computational Center (ESSCC)
6     * http://www.uq.edu.au/esscc
7     *
8     * 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 ksteube 1312
14 ksteube 1811
15 jgs 82 /**************************************************************/
16    
17     /* Finley: ElementFile */
18    
19     /* mark the used nodes with offeset: */
20    
21     /**************************************************************/
22    
23     #include "ElementFile.h"
24    
25     /**************************************************************/
26    
27 ksteube 1770 void Finley_ElementFile_markNodes(index_t* mask,index_t offset,dim_t numNodes,Finley_ElementFile* in,bool_t useLinear) {
28 jgs 123 dim_t i,NN,NN2,e;
29 phornby 1628 index_t *lin_node,*id=NULL;
30 jgs 82 if (in!=NULL) {
31 gross 1028 id=TMPMEMALLOC(in->ReferenceElement->Type->numNodes, index_t);
32     if (! Finley_checkPtr(id) ){
33     if (useLinear) {
34     NN=in->LinearReferenceElement->Type->numNodes;
35     lin_node=in->ReferenceElement->Type->linearNodes;
36     } else {
37     NN=in->ReferenceElement->Type->numNodes;
38     lin_node=id;
39 gross 1763 for (i=0;i<in->ReferenceElement->Type->numNodes;i++) id[i]=i;
40 gross 1028 }
41 ksteube 1312 NN2=in->numNodes;
42 gross 1804
43 ksteube 1312 #pragma omp parallel for private(e,i) schedule(static)
44     for (e=0;e<in->numElements;e++) {
45     for (i=0;i<NN;i++) {
46 gross 1028 mask[in->Nodes[INDEX2(lin_node[i],e,NN2)]-offset]=1;
47     }
48 jgs 82 }
49 gross 1028 TMPMEMFREE(id);
50     }
51 jgs 82 }
52     }
53 bcumming 751
54 ksteube 1312 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 gross 1763 for (i=0;i<in->ReferenceElement->Type->numNodes;i++) id[i]=i;
68 ksteube 1312 }
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 gross 1763 for (j=0;j<NN;j++) {
78     mask[dofIndex[in->Nodes[INDEX2(lin_node[j],e,NN2)]]-offset]=marker;
79     }
80 ksteube 1312 break;
81     }
82     }
83     }
84     }
85     }
86     }
87     TMPMEMFREE(id);
88     }
89     }
90    

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26