/[escript]/branches/arrayview_from_1695_trunk/finley/src/ElementFile_markNodes.c
ViewVC logotype

Contents of /branches/arrayview_from_1695_trunk/finley/src/ElementFile_markNodes.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1781 - (show annotations)
Thu Sep 11 05:03:14 2008 UTC (10 years, 9 months ago) by jfenwick
File MIME type: text/plain
File size: 3079 byte(s)
Branch commit

Merged changes from trunk version 1695 up to and including version 1779.


1
2 /* $Id$ */
3
4 /*******************************************************
5 *
6 * Copyright 2003-2007 by ACceSS MNRF
7 * Copyright 2007 by University of Queensland
8 *
9 * http://esscc.uq.edu.au
10 * Primary Business: Queensland, Australia
11 * Licensed under the Open Software License version 3.0
12 * http://www.opensource.org/licenses/osl-3.0.php
13 *
14 *******************************************************/
15
16 /**************************************************************/
17
18 /* Finley: ElementFile */
19
20 /* mark the used nodes with offeset: */
21
22 /**************************************************************/
23
24 #include "ElementFile.h"
25
26 /**************************************************************/
27
28 void Finley_ElementFile_markNodes(index_t* mask,index_t offset,dim_t numNodes,Finley_ElementFile* in,bool_t useLinear) {
29 dim_t i,NN,NN2,e;
30 index_t *lin_node,*id=NULL;
31
32 if (in!=NULL) {
33 id=TMPMEMALLOC(in->ReferenceElement->Type->numNodes, index_t);
34 if (! Finley_checkPtr(id) ){
35 if (useLinear) {
36 NN=in->LinearReferenceElement->Type->numNodes;
37 lin_node=in->ReferenceElement->Type->linearNodes;
38 } else {
39 NN=in->ReferenceElement->Type->numNodes;
40 lin_node=id;
41 for (i=0;i<in->ReferenceElement->Type->numNodes;i++) id[i]=i;
42 }
43 NN2=in->numNodes;
44 #pragma omp parallel for private(e,i) schedule(static)
45 for (e=0;e<in->numElements;e++) {
46 for (i=0;i<NN;i++) {
47 mask[in->Nodes[INDEX2(lin_node[i],e,NN2)]-offset]=1;
48 }
49 }
50 TMPMEMFREE(id);
51 }
52 }
53 }
54
55 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)
56 {
57 dim_t i,NN,NN2,e,j;
58 index_t color,*lin_node,*id=NULL,k;
59 if (in!=NULL) {
60 id=TMPMEMALLOC(in->ReferenceElement->Type->numNodes, index_t);
61 if (! Finley_checkPtr(id) ){
62 if (useLinear) {
63 NN=in->LinearReferenceElement->Type->numNodes;
64 lin_node=in->ReferenceElement->Type->linearNodes;
65 } else {
66 NN=in->ReferenceElement->Type->numNodes;
67 lin_node=id;
68 for (i=0;i<in->ReferenceElement->Type->numNodes;i++) id[i]=i;
69 }
70 NN2=in->numNodes;
71 for (color=in->minColor;color<=in->maxColor;color++) {
72 #pragma omp parallel for private(e,i,j,k) schedule(static)
73 for (e=0;e<in->numElements;e++) {
74 if (in->Color[e]==color) {
75 for (i=0;i<NN;i++) {
76 k=dofIndex[in->Nodes[INDEX2(lin_node[i],e,NN2)]];
77 if ( (firstDOF<=k) && (k<lastDOF) ) {
78 for (j=0;j<NN;j++) {
79 mask[dofIndex[in->Nodes[INDEX2(lin_node[j],e,NN2)]]-offset]=marker;
80 }
81 break;
82 }
83 }
84 }
85 }
86 }
87 }
88 TMPMEMFREE(id);
89 }
90 }
91

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26