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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 751 - (hide annotations)
Mon Jun 26 01:46:34 2006 UTC (13 years, 8 months ago) by bcumming
File MIME type: text/plain
File size: 8217 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 jgs 82
13     /**************************************************************/
14    
15     /* assemblage routines: prepares the assemble parameter set */
16    
17     /**************************************************************/
18    
19 jgs 150 /* Copyrights by ACcESS Australia, 2003,2004,2005 */
20 jgs 82 /* author: gross@access.edu.au */
21     /* Version: $Id$ */
22    
23     /**************************************************************/
24    
25     #include "Assemble.h"
26    
27     /**************************************************************/
28    
29 jgs 150 void Assemble_getAssembleParameters(Finley_NodeFile* nodes,Finley_ElementFile* elements,Paso_SystemMatrix* S,
30 jgs 82 escriptDataC* F,Assemble_Parameters *parm) {
31 jgs 150 Finley_resetError();
32 jgs 123 dim_t i;
33 jgs 82 parm->NN=elements->ReferenceElement->Type->numNodes;
34     for (i=0;i<parm->NN;i++) parm->id[i]=i;
35     parm->NS=elements->ReferenceElement->Type->numShapes;
36     parm->referenceElement=elements->ReferenceElement;
37     parm->numQuad=parm->referenceElement->numQuadNodes;
38     parm->numDim=nodes->numDim;
39     parm->numElementDim=parm->referenceElement->Type->numDim;
40    
41 jgs 102 if (!isEmpty(F) && !isExpanded(F) ) {
42 jgs 150 Finley_setError(TYPE_ERROR,"__FILE__: Right hand side is not expanded.");
43 jgs 82 return;
44     }
45     /* check the dimensions of S and F */
46     if (S!=NULL && !isEmpty(F)) {
47 jgs 102 if ( getDataPointSize(F)!=S->logical_row_block_size) {
48 jgs 150 Finley_setError(TYPE_ERROR,"__FILE__: matrix row block size and number of components of right hand side don't match.");
49 jgs 82 return;
50     }
51 jgs 123
52 jgs 102 if (! numSamplesEqual(F,1,(S->num_rows*S->row_block_size)/S->logical_row_block_size)) {
53 jgs 150 Finley_setError(TYPE_ERROR,"__FILE__: number of rows of matrix and length of right hand side don't match.");
54 jgs 82 return;
55     }
56     }
57     /* get the number of equations and components */
58     if (S!=NULL) {
59 jgs 102 parm->numEqu=S->logical_row_block_size;
60     parm->numComp=S->logical_col_block_size;
61 jgs 82 } else {
62     parm->numEqu=1;
63     parm->numComp=1;
64     }
65     if (!isEmpty(F)) parm->numEqu=getDataPointSize(F);
66    
67     parm->label_col=nodes->degreeOfFreedom;
68     parm->label_row=nodes->degreeOfFreedom;
69     parm->referenceElement_row=elements->ReferenceElement;
70     parm->referenceElement_col=elements->ReferenceElement;
71     /* get the information for the labeling of the degrees of freedom */
72     if (S!=NULL) {
73 bcumming 751 #ifndef PASO_MPI
74 jgs 82 if (S->num_rows*S->row_block_size==parm->numEqu*nodes->numDegreesOfFreedom) {
75 bcumming 751 #else
76     if (S->num_rows*S->row_block_size==parm->numEqu*nodes->degreeOfFreedomDistribution->numLocal) {
77     parm->degreeOfFreedomUpperBound = nodes->degreeOfFreedomDistribution->numLocal;
78     #endif
79 jgs 82 parm->label_row=nodes->degreeOfFreedom;
80     parm->row_node=&(parm->id[0]);
81     parm->referenceElement_row=elements->ReferenceElement;
82 bcumming 751 }
83     #ifndef PASO_MPI
84     else if (S->num_rows*S->row_block_size==parm->numEqu*nodes->reducedNumDegreesOfFreedom) {
85     #else
86     else if (S->num_rows*S->row_block_size==parm->numEqu*nodes->reducedDegreeOfFreedomDistribution->numLocal) {
87     parm->degreeOfFreedomUpperBound = nodes->reducedDegreeOfFreedomDistribution->numLocal;
88     #endif
89 jgs 82 parm->label_row=nodes->reducedDegreeOfFreedom;
90     parm->row_node=parm->referenceElement->Type->linearNodes;
91     parm->referenceElement_row=elements->LinearReferenceElement;
92     } else {
93 jgs 150 Finley_setError(TYPE_ERROR,"__FILE__: number of rows in matrix does not match the number of degrees of freedom in mesh");
94 jgs 82 return;
95     }
96 bcumming 751 #ifndef PASO_MPI
97 jgs 82 if (S->num_cols*S->col_block_size==parm->numComp*nodes->numDegreesOfFreedom) {
98 bcumming 751 #else
99     if (S->num_cols*S->col_block_size==parm->numComp*nodes->degreeOfFreedomDistribution->numLocal) {
100     parm->degreeOfFreedomUpperBound = nodes->degreeOfFreedomDistribution->numLocal;
101     #endif
102 jgs 82 parm->label_col=nodes->degreeOfFreedom;
103     parm->col_node=&(parm->id[0]);
104     parm->referenceElement_col=elements->ReferenceElement;
105 bcumming 751 }
106     #ifndef PASO_MPI
107     else if (S->num_cols*S->col_block_size==parm->numComp*nodes->reducedNumDegreesOfFreedom) {
108     #else
109     else if (S->num_cols*S->col_block_size==parm->numComp*nodes->reducedDegreeOfFreedomDistribution->numLocal) {
110     parm->degreeOfFreedomUpperBound = nodes->reducedDegreeOfFreedomDistribution->numLocal;
111     #endif
112 jgs 82 parm->label_col=nodes->reducedDegreeOfFreedom;
113     parm->col_node=parm->referenceElement->Type->linearNodes;
114     parm->referenceElement_col=elements->LinearReferenceElement;
115     } else {
116 jgs 150 Finley_setError(TYPE_ERROR,"__FILE__: number of columns in matrix does not match the number of degrees of freedom in mesh");
117 jgs 82 return;
118     }
119     }
120     if (!isEmpty(F)) {
121 bcumming 751 #ifndef PASO_MPI
122 jgs 82 if (numSamplesEqual(F,1,nodes->numDegreesOfFreedom)) {
123 bcumming 751 #else
124     if (numSamplesEqual(F,1,nodes->degreeOfFreedomDistribution->numLocal)) {
125     parm->degreeOfFreedomUpperBound = nodes->degreeOfFreedomDistribution->numLocal;
126     #endif
127 jgs 82 parm->row_node=&(parm->id[0]);
128     parm->label_row=nodes->degreeOfFreedom;
129     parm->referenceElement_row=elements->ReferenceElement;
130 bcumming 751 }
131     #ifndef PASO_MPI
132     else if (numSamplesEqual(F,1,nodes->reducedNumDegreesOfFreedom)) {
133     #else
134     else if (numSamplesEqual(F,1,nodes->reducedDegreeOfFreedomDistribution->numLocal)) {
135     parm->degreeOfFreedomUpperBound = nodes->reducedDegreeOfFreedomDistribution->numLocal;
136     #endif
137 jgs 82 parm->label_row=nodes->reducedDegreeOfFreedom;
138     parm->row_node=parm->referenceElement->Type->linearNodes;
139     parm->referenceElement_row=elements->LinearReferenceElement;
140     } else {
141 jgs 150 Finley_setError(TYPE_ERROR,"__FILE__: length of RHS vector does not match the number of degrees of freedom in mesh");
142 jgs 82 return;
143     }
144     if (S==NULL) {
145     parm->label_col=parm->label_row;
146     parm->col_node=parm->row_node;
147     parm->referenceElement_col=parm->referenceElement_row;
148     }
149     }
150     if (parm->referenceElement_row!=parm->referenceElement_col) {
151 bcumming 751 Finley_setError(TYPE_ERROR,"__FILE__: assemblage cannot handle different shape functions for rows and columns (yet).");
152 jgs 82 return;
153     }
154     parm->NN_row=parm->referenceElement_row->Type->numNodes;
155     parm->NS_row=parm->referenceElement_row->Type->numShapes;
156     parm->NN_col=parm->referenceElement_col->Type->numNodes;
157     parm->NS_col=parm->referenceElement_col->Type->numShapes;
158     }
159    
160     /*
161     * $Log$
162 jgs 150 * Revision 1.6 2005/09/15 03:44:21 jgs
163     * Merge of development branch dev-02 back to main trunk on 2005-09-15
164     *
165     * Revision 1.5.2.1 2005/09/07 06:26:17 gross
166     * the solver from finley are put into the standalone package paso now
167     *
168 jgs 123 * Revision 1.5 2005/07/08 04:07:47 jgs
169     * Merge of development branch back to main trunk on 2005-07-08
170     *
171 jgs 102 * Revision 1.4 2004/12/15 07:08:32 jgs
172 jgs 97 * *** empty log message ***
173 jgs 123 * Revision 1.1.1.1.2.4 2005/07/01 07:02:13 gross
174     * some bug with OPENMP fixed
175 jgs 82 *
176 jgs 123 * Revision 1.1.1.1.2.3 2005/06/29 02:34:48 gross
177     * some changes towards 64 integers in finley
178 jgs 97 *
179 jgs 123 * Revision 1.1.1.1.2.2 2004/11/12 06:58:18 gross
180     * a lot of changes to get the linearPDE class running: most important change is that there is no matrix format exposed to the user anymore. the format is chosen by the Domain according to the solver and symmetry
181     *
182     * Revision 1.1.1.1.2.1 2004/10/28 22:59:24 gross
183     * finley's RecTest.py is running now: problem in SystemMatrixAdapater fixed
184     *
185     * Revision 1.1.1.1 2004/10/26 06:53:57 jgs
186     * initial import of project esys2
187     *
188     * Revision 1.2 2004/07/21 05:00:54 gross
189     * name changes in DataC
190     *
191     * Revision 1.1 2004/07/02 04:21:13 gross
192     * Finley C code has been included
193     *
194     *
195 jgs 82 */
196    

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26