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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3086 - (show 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
2 /*******************************************************
3 *
4 * Copyright (c) 2003-2010 by University of Queensland
5 * 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
14
15 /**************************************************************/
16
17 /* Dudley: ElementFile */
18
19 /* mark the used nodes with offeset: */
20
21 /**************************************************************/
22
23 #include "ElementFile.h"
24
25 /**************************************************************/
26
27 void Dudley_ElementFile_markNodes(index_t* mask,index_t offset,dim_t numNodes,Dudley_ElementFile* in,bool_t useLinear) {
28 dim_t i,NN,NN2,e;
29 index_t *lin_nodes;
30 Dudley_ReferenceElement* refElement=NULL;
31
32 if (in!=NULL) {
33 refElement=Dudley_ReferenceElementSet_borrowReferenceElement(in->referenceElementSet, FALSE);
34 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 }
55
56 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 {
58 dim_t i,NN,NN2,e,j;
59 index_t color,*lin_nodes;
60 Dudley_ReferenceElement* refElement=NULL;
61 register index_t k;
62
63 if (in!=NULL) {
64 refElement=Dudley_ReferenceElementSet_borrowReferenceElement(in->referenceElementSet, FALSE);
65 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 }
102

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26