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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1096 - (show annotations)
Mon Apr 16 22:59:33 2007 UTC (13 years, 1 month ago) by ksteube
File MIME type: text/plain
File size: 9324 byte(s)
MPI implicit solver example run_simplesolve.py now compiling and
running successfully on one CPU of ess.

Adjusted SConscript, removed some debug print statements and removed
some partially implemented TRILINOS calls.


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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26