/[escript]/trunk-mpi-branch/finley/src/ElementFile_markNodes.c
ViewVC logotype

Contents of /trunk-mpi-branch/finley/src/ElementFile_markNodes.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1253 - (show annotations)
Fri Aug 17 04:09:29 2007 UTC (12 years, 9 months ago) by gross
File MIME type: text/plain
File size: 3301 byte(s)
finally everthing for MPI is in the code. now testing is needed
1 /*
2 ************************************************************
3 * Copyright 2006 by ACcESS MNRF *
4 * *
5 * http://www.access.edu.au *
6 * Primary Business: Queensland, Australia *
7 * Licensed under the Open Software License version 3.0 *
8 * http://www.opensource.org/licenses/osl-3.0.php *
9 * *
10 ************************************************************
11 */
12
13 /**************************************************************/
14
15 /* Finley: ElementFile */
16
17 /* mark the used nodes with offeset: */
18
19 /**************************************************************/
20
21 /* Copyrights by ACcESS Australia 2003,2004,2005 */
22 /* Author: gross@access.edu.au */
23 /* Version: $Id$ */
24
25 /**************************************************************/
26
27 #include "ElementFile.h"
28
29 /**************************************************************/
30
31 void Finley_ElementFile_markNodes(index_t* mask,index_t offset,Finley_ElementFile* in,bool_t useLinear) {
32 dim_t i,NN,NN2,e;
33 index_t color,*lin_node,*id=NULL;
34 if (in!=NULL) {
35 id=TMPMEMALLOC(in->ReferenceElement->Type->numNodes, index_t);
36 if (! Finley_checkPtr(id) ){
37 for (i=0;i<in->ReferenceElement->Type->numNodes;i++) id[i]=i;
38 if (useLinear) {
39 NN=in->LinearReferenceElement->Type->numNodes;
40 lin_node=in->ReferenceElement->Type->linearNodes;
41 } else {
42 NN=in->ReferenceElement->Type->numNodes;
43 lin_node=id;
44 }
45 NN2=in->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(lin_node[i],e,NN2)]-offset]=1;
50 }
51 }
52 TMPMEMFREE(id);
53 }
54 }
55 }
56
57 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)
58 {
59 dim_t i,NN,NN2,e,j;
60 index_t color,*lin_node,*id=NULL,k;
61 if (in!=NULL) {
62 id=TMPMEMALLOC(in->ReferenceElement->Type->numNodes, index_t);
63 if (! Finley_checkPtr(id) ){
64 for (i=0;i<in->ReferenceElement->Type->numNodes;i++) id[i]=i;
65 if (useLinear) {
66 NN=in->LinearReferenceElement->Type->numNodes;
67 lin_node=in->ReferenceElement->Type->linearNodes;
68 } else {
69 NN=in->ReferenceElement->Type->numNodes;
70 lin_node=id;
71 }
72 NN2=in->numNodes;
73 for (color=in->minColor;color<=in->maxColor;color++) {
74 #pragma omp parallel for private(e,i,j,k) schedule(static)
75 for (e=0;e<in->numElements;e++) {
76 if (in->Color[e]==color) {
77 for (i=0;i<NN;i++) {
78 k=dofIndex[in->Nodes[INDEX2(lin_node[i],e,NN2)]];
79 if ( (firstDOF<=k) && (k<lastDOF) ) {
80 for (j=0;j<NN;j++) mask[dofIndex[in->Nodes[INDEX2(lin_node[i],e,NN2)]]-offset]=marker;
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