/[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 3086 - (hide annotations)
Thu Aug 5 05:07:58 2010 UTC (9 years ago) by jfenwick
File MIME type: text/plain
File size: 3164 byte(s)
Another pass at removing finley

1 jgs 150
2 ksteube 1312 /*******************************************************
3 ksteube 1811 *
4 jfenwick 2881 * Copyright (c) 2003-2010 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 jfenwick 3086 /* Dudley: ElementFile */
18 jgs 82
19     /* mark the used nodes with offeset: */
20    
21     /**************************************************************/
22    
23     #include "ElementFile.h"
24    
25     /**************************************************************/
26    
27 jfenwick 3086 void Dudley_ElementFile_markNodes(index_t* mask,index_t offset,dim_t numNodes,Dudley_ElementFile* in,bool_t useLinear) {
28 jgs 123 dim_t i,NN,NN2,e;
29 gross 2748 index_t *lin_nodes;
30 jfenwick 3086 Dudley_ReferenceElement* refElement=NULL;
31 gross 2748
32 jgs 82 if (in!=NULL) {
33 jfenwick 3086 refElement=Dudley_ReferenceElementSet_borrowReferenceElement(in->referenceElementSet, FALSE);
34 gross 2748 NN2=in->numNodes;
35     if (useLinear) {
36     NN=refElement->numLinearNodes;
37     lin_nodes=refElement->Type->linearNodes;
38     #pragma omp parallel for private(e,i) schedule(static)
39     for (e=0;e<in->numElements;e++) {
40     for (i=0;i<NN;i++) {
41     mask[in->Nodes[INDEX2(lin_nodes[i],e,NN2)]-offset]=1;
42     }
43     }
44     } else {
45     NN=refElement->Type->numNodes;
46     #pragma omp parallel for private(e,i) schedule(static)
47     for (e=0;e<in->numElements;e++) {
48     for (i=0;i<NN;i++) {
49     mask[in->Nodes[INDEX2(i,e,NN2)]-offset]=1;
50     }
51     }
52     }
53     }
54 jgs 82 }
55 bcumming 751
56 jfenwick 3086 void Dudley_ElementFile_markDOFsConnectedToRange(index_t* mask,index_t offset,index_t marker,index_t firstDOF,index_t lastDOF,index_t *dofIndex,Dudley_ElementFile*in ,bool_t useLinear)
57 ksteube 1312 {
58     dim_t i,NN,NN2,e,j;
59 gross 2748 index_t color,*lin_nodes;
60 jfenwick 3086 Dudley_ReferenceElement* refElement=NULL;
61 gross 2748 register index_t k;
62    
63 ksteube 1312 if (in!=NULL) {
64 jfenwick 3086 refElement=Dudley_ReferenceElementSet_borrowReferenceElement(in->referenceElementSet, FALSE);
65 gross 2748 NN2=in->numNodes;
66     if (useLinear) {
67     NN=refElement->numLinearNodes;
68     lin_nodes=refElement->Type->linearNodes;
69     for (color=in->minColor;color<=in->maxColor;color++) {
70     #pragma omp parallel for private(e,i,j,k) schedule(static)
71     for (e=0;e<in->numElements;e++) {
72     if (in->Color[e]==color) {
73     for (i=0;i<NN;i++) {
74     k=dofIndex[in->Nodes[INDEX2(lin_nodes[i],e,NN2)]];
75     if ( (firstDOF<=k) && (k<lastDOF) ) {
76     for (j=0;j<NN;j++) mask[dofIndex[in->Nodes[INDEX2(lin_nodes[j],e,NN2)]]-offset]=marker;
77     break;
78     }
79     }
80     }
81     }
82     }
83     } else {
84     NN=refElement->Type->numNodes;
85     for (color=in->minColor;color<=in->maxColor;color++) {
86     #pragma omp parallel for private(e,i,j,k) schedule(static)
87     for (e=0;e<in->numElements;e++) {
88     if (in->Color[e]==color) {
89     for (i=0;i<NN;i++) {
90     k=dofIndex[in->Nodes[INDEX2(i,e,NN2)]];
91     if ( (firstDOF<=k) && (k<lastDOF) ) {
92     for (j=0;j<NN;j++) mask[dofIndex[in->Nodes[INDEX2(j,e,NN2)]]-offset]=marker;
93     break;
94     }
95     }
96     }
97     }
98     }
99     }
100     }
101 ksteube 1312 }
102    

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26