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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 751 - (hide annotations)
Mon Jun 26 01:46:34 2006 UTC (13 years, 4 months ago) by bcumming
File MIME type: text/plain
File size: 5586 byte(s)
Changes relating to the MPI version of escript
The standard OpenMP version of escript is unchanged

- updated data types (Finley_Mesh, Finley_NodeFile, etc) to store meshes
  over multiple MPI processes.
- added CommBuffer code in Paso for communication of Data associated
  with distributed meshes
- updates in Finley and Escript to support distributed data and operations
  on distributed data (such as interpolation).
- construction of RHS in MPI, so that simple explicit schemes (such as
  /docs/examples/wave.py without IO and the Locator) can run in MPI.
- updated mesh generation for first order line, rectangle and brick
  meshes and second order line meshes in MPI.        
- small changes to trunk/SConstruct and trunk/scons/ess_options.py to
  build the MPI version, these changes are turned off by default.

1 jgs 150 /*
2 elspeth 616 ************************************************************
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 jgs 150 */
12    
13 jgs 82 /**************************************************************/
14    
15     /* Finley: Mesh */
16    
17     /* mark the used nodes with offeset: */
18    
19     /**************************************************************/
20    
21 jgs 150 /* Author: gross@access.edu.au */
22     /* Version: $Id$ */
23 jgs 82
24     /**************************************************************/
25    
26     #include "Mesh.h"
27    
28     /**************************************************************/
29    
30 jgs 123 void Finley_Mesh_markNodes(index_t* mask,index_t offset,Finley_Mesh* in,bool_t useLinear) {
31 jgs 82 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 bcumming 751
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;
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     Finley_ElementFile_markInternalElementDOF(internalMask,offset,in->Nodes->degreeOfFreedom,in->Elements,useLinear);
96     Finley_ElementFile_markInternalElementDOF(internalMask,offset,in->Nodes->degreeOfFreedom,in->FaceElements,useLinear);
97     Finley_ElementFile_markInternalElementDOF(internalMask,offset,in->Nodes->degreeOfFreedom,in->ContactElements,useLinear);
98     Finley_ElementFile_markInternalElementDOF(internalMask,offset,in->Nodes->degreeOfFreedom,in->Points,useLinear);
99    
100     Finley_ElementFile_markBoundaryElementDOF(boundaryMask,offset,in->Nodes->degreeOfFreedom,in->Elements,useLinear);
101     Finley_ElementFile_markBoundaryElementDOF(boundaryMask,offset,in->Nodes->degreeOfFreedom,in->FaceElements,useLinear);
102     Finley_ElementFile_markBoundaryElementDOF(boundaryMask,offset,in->Nodes->degreeOfFreedom,in->ContactElements,useLinear);
103     Finley_ElementFile_markBoundaryElementDOF(boundaryMask,offset,in->Nodes->degreeOfFreedom,in->Points,useLinear);
104    
105     for( i=0; i<in->Nodes->numDegreesOfFreedom; i++ )
106     if( internalMask[i] && boundaryMask[i] )
107     mask[i] = 2; /* boundary */
108     else if( internalMask[i] )
109     mask[i] = 1; /* internal */
110     else if( boundaryMask[i] )
111     mask[i] = 3; /* external */
112     else
113     mask[i] = -1; /* not referenced */
114     }
115     #endif
116    
117 jgs 82 /*
118     * $Log$
119 jgs 150 * Revision 1.3 2005/09/15 03:44:22 jgs
120     * Merge of development branch dev-02 back to main trunk on 2005-09-15
121     *
122     * Revision 1.2.2.1 2005/09/07 06:26:19 gross
123     * the solver from finley are put into the standalone package paso now
124     *
125 jgs 123 * Revision 1.2 2005/07/08 04:07:53 jgs
126     * Merge of development branch back to main trunk on 2005-07-08
127 jgs 82 *
128 jgs 123 * Revision 1.1.1.1.2.1 2005/06/29 02:34:52 gross
129     * some changes towards 64 integers in finley
130     *
131     * Revision 1.1.1.1 2004/10/26 06:53:57 jgs
132     * initial import of project esys2
133     *
134 jgs 82 * Revision 1.1.1.1 2004/06/24 04:00:40 johng
135     * Initial version of eys using boost-python.
136     *
137     *
138     */
139    

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26