/[escript]/trunk/finley/src/Mesh_markNodes.c
ViewVC logotype

Contents of /trunk/finley/src/Mesh_markNodes.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 782 - (show annotations)
Tue Jul 18 00:47:47 2006 UTC (12 years, 9 months ago) by bcumming
File MIME type: text/plain
File size: 6027 byte(s)
Large number of changes to Finley for meshing in MPI.

- optimisation and neatening up of rectcanglular mesh generation code
- first and second order 1D, 2D and 3D rectangular meshes are now
  available in finley and escript using MPI.
- reduced meshes now generated in MPI, and interpolation to and from 
  reduced data types now supported.  

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: Mesh */
16
17 /* mark the used nodes with offeset: */
18
19 /**************************************************************/
20
21 /* Author: gross@access.edu.au */
22 /* Version: $Id$ */
23
24 /**************************************************************/
25
26 #include "Mesh.h"
27
28 /**************************************************************/
29
30 void Finley_Mesh_markNodes(index_t* mask,index_t offset,Finley_Mesh* in,bool_t useLinear) {
31 Finley_ElementFile_markNodes(mask,offset,in->Elements,useLinear);
32 Finley_ElementFile_markNodes(mask,offset,in->FaceElements,useLinear);
33 Finley_ElementFile_markNodes(mask,offset,in->ContactElements,useLinear);
34 Finley_ElementFile_markNodes(mask,offset,in->Points,useLinear);
35 }
36
37 #ifdef PASO_MPI
38
39 /* assumes that mask has length in->Nodes->numNodes
40 hence, it assumes that nodes are dense and offset==0
41 offset must ==0
42 assumes mask[i]==-1, i=0:in->Nodes->numNodes
43 */
44 void Finley_Mesh_markOrderedNodesLocation(index_t* mask,index_t offset,Finley_Mesh* in,bool_t useLinear)
45 {
46 index_t *internalMask=NULL, *boundaryMask=NULL, i;
47
48 if( offset )
49 {
50 Finley_setError(VALUE_ERROR, "Finley_Mesh_markNodesExternal() : yet to implement offest!=0");
51 return;
52 }
53
54 internalMask = TMPMEMALLOC( in->Nodes->numNodes, index_t );
55 boundaryMask = TMPMEMALLOC( in->Nodes->numNodes, index_t );
56 for( i=0; i<in->Nodes->numNodes; i++ )
57 internalMask[i] = boundaryMask[i] = 0;
58
59 Finley_ElementFile_markInternalElementNodes(internalMask,offset,in->Elements,useLinear);
60 Finley_ElementFile_markInternalElementNodes(internalMask,offset,in->FaceElements,useLinear);
61 Finley_ElementFile_markInternalElementNodes(internalMask,offset,in->ContactElements,useLinear);
62 Finley_ElementFile_markInternalElementNodes(internalMask,offset,in->Points,useLinear);
63
64 Finley_ElementFile_markBoundaryElementNodes(boundaryMask,offset,in->Elements,useLinear);
65 Finley_ElementFile_markBoundaryElementNodes(boundaryMask,offset,in->FaceElements,useLinear);
66 Finley_ElementFile_markBoundaryElementNodes(boundaryMask,offset,in->ContactElements,useLinear);
67 Finley_ElementFile_markBoundaryElementNodes(boundaryMask,offset,in->Points,useLinear);
68
69 for( i=0; i<in->Nodes->numNodes; i++ )
70 if( internalMask[i] && boundaryMask[i] )
71 mask[i] = 2; /* boundary */
72 else if( internalMask[i] )
73 mask[i] = 1; /* internal */
74 else if( boundaryMask[i] )
75 mask[i] = 3; /* external */
76 else
77 mask[i] = -1; /* not referenced */
78 }
79
80 void Finley_Mesh_markOrderedDegreesOfFreedomLocation(index_t* mask,index_t offset,Finley_Mesh* in,bool_t useLinear)
81 {
82 index_t *internalMask=NULL, *boundaryMask=NULL, i,startElement;
83
84 if( offset )
85 {
86 Finley_setError(VALUE_ERROR, "Finley_Mesh_markNodesExternal() : yet to implement offest!=0");
87 return;
88 }
89
90 internalMask = TMPMEMALLOC( in->Nodes->numDegreesOfFreedom, index_t );
91 boundaryMask = TMPMEMALLOC( in->Nodes->numDegreesOfFreedom, index_t );
92 for( i=0; i<in->Nodes->numDegreesOfFreedom; i++ )
93 internalMask[i] = boundaryMask[i] = 0;
94
95 startElement = 0;
96 Finley_ElementFile_markInternalElementDOF(internalMask,offset,in->Nodes->degreeOfFreedom,in->Elements,useLinear,startElement);
97 startElement += in->Elements->numElements;
98 Finley_ElementFile_markInternalElementDOF(internalMask,offset,in->Nodes->degreeOfFreedom,in->FaceElements,useLinear,startElement);
99 startElement += in->FaceElements->numElements;
100 Finley_ElementFile_markInternalElementDOF(internalMask,offset,in->Nodes->degreeOfFreedom,in->ContactElements,useLinear,startElement);
101 startElement += in->ContactElements->numElements;
102 Finley_ElementFile_markInternalElementDOF(internalMask,offset,in->Nodes->degreeOfFreedom,in->Points,useLinear,startElement);
103
104 startElement = 0;
105 Finley_ElementFile_markBoundaryElementDOF(boundaryMask,offset,in->Nodes->degreeOfFreedom,in->Elements,useLinear,startElement);
106 startElement += in->Elements->numElements;
107 Finley_ElementFile_markBoundaryElementDOF(boundaryMask,offset,in->Nodes->degreeOfFreedom,in->FaceElements,useLinear,startElement);
108 startElement += in->FaceElements->numElements;
109 Finley_ElementFile_markBoundaryElementDOF(boundaryMask,offset,in->Nodes->degreeOfFreedom,in->ContactElements,useLinear,startElement);
110 startElement += in->ContactElements->numElements;
111 Finley_ElementFile_markBoundaryElementDOF(boundaryMask,offset,in->Nodes->degreeOfFreedom,in->Points,useLinear,startElement);
112
113 for( i=0; i<in->Nodes->numDegreesOfFreedom; i++ )
114 if( internalMask[i] && boundaryMask[i] )
115 mask[i] = 2; /* boundary */
116 else if( internalMask[i] )
117 mask[i] = 1; /* internal */
118 else if( boundaryMask[i] )
119 mask[i] = 3; /* external */
120 else
121 mask[i] = -1; /* not referenced */
122 }
123 #endif
124
125 /*
126 * $Log$
127 * Revision 1.3 2005/09/15 03:44:22 jgs
128 * Merge of development branch dev-02 back to main trunk on 2005-09-15
129 *
130 * Revision 1.2.2.1 2005/09/07 06:26:19 gross
131 * the solver from finley are put into the standalone package paso now
132 *
133 * Revision 1.2 2005/07/08 04:07:53 jgs
134 * Merge of development branch back to main trunk on 2005-07-08
135 *
136 * Revision 1.1.1.1.2.1 2005/06/29 02:34:52 gross
137 * some changes towards 64 integers in finley
138 *
139 * Revision 1.1.1.1 2004/10/26 06:53:57 jgs
140 * initial import of project esys2
141 *
142 * Revision 1.1.1.1 2004/06/24 04:00:40 johng
143 * Initial version of eys using boost-python.
144 *
145 *
146 */
147

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26