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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1028 - (show annotations)
Wed Mar 14 00:15:24 2007 UTC (12 years, 7 months ago) by gross
File MIME type: text/plain
File size: 9107 byte(s)
modifications to be compliant with _WIN32. The substitutes for asinh, acosh, atanh are still missing (erf will through an exception)
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 dim_t i;
32 Finley_resetError();
33
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->num_rows*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 #ifndef PASO_MPI
75 if (S->num_rows*S->row_block_size==parm->numEqu*nodes->numDegreesOfFreedom) {
76 parm->row_DOF_UpperBound = nodes->numDegreesOfFreedom;
77 #else
78 if (S->num_rows*S->row_block_size==parm->numEqu*nodes->degreeOfFreedomDistribution->numLocal) {
79 parm->row_DOF_UpperBound = nodes->degreeOfFreedomDistribution->numLocal;
80 #endif
81 parm->row_DOF=nodes->degreeOfFreedom;
82 parm->row_node=&(parm->id[0]);
83 parm->row_jac=Finley_ElementFile_borrowJacobeans(elements,nodes,FALSE,reducedIntegrationOrder);
84 }
85 #ifndef PASO_MPI
86 else if (S->num_rows*S->row_block_size==parm->numEqu*nodes->reducedNumDegreesOfFreedom) {
87 parm->row_DOF_UpperBound = nodes->reducedNumDegreesOfFreedom;
88 #else
89 else if (S->num_rows*S->row_block_size==parm->numEqu*nodes->reducedDegreeOfFreedomDistribution->numLocal) {
90 parm->row_DOF_UpperBound = nodes->reducedDegreeOfFreedomDistribution->numLocal;
91 #endif
92 parm->row_DOF=nodes->reducedDegreeOfFreedom;
93 parm->row_jac=Finley_ElementFile_borrowJacobeans(elements,nodes,TRUE,reducedIntegrationOrder);
94 parm->row_node=parm->row_jac->ReferenceElement->Type->linearNodes;
95 } else {
96 Finley_setError(TYPE_ERROR,"Assemble_getAssembleParameters: number of rows in matrix does not match the number of degrees of freedom in mesh");
97 }
98 #ifndef PASO_MPI
99 if (S->num_cols*S->col_block_size==parm->numComp*nodes->numDegreesOfFreedom) {
100 parm->col_DOF_UpperBound = nodes->numDegreesOfFreedom;
101 #else
102 if (S->num_cols*S->col_block_size==parm->numComp*nodes->degreeOfFreedomDistribution->numLocal) {
103 parm->col_DOF_UpperBound = nodes->degreeOfFreedomDistribution->numLocal;
104 #endif
105 parm->col_jac=Finley_ElementFile_borrowJacobeans(elements,nodes,FALSE,reducedIntegrationOrder);
106 parm->col_DOF=nodes->degreeOfFreedom;
107 parm->col_node=&(parm->id[0]);
108 }
109 #ifndef PASO_MPI
110 else if (S->num_cols*S->col_block_size==parm->numComp*nodes->reducedNumDegreesOfFreedom) {
111 parm->col_DOF_UpperBound = nodes->reducedNumDegreesOfFreedom;
112 #else
113 else if (S->num_cols*S->col_block_size==parm->numComp*nodes->reducedDegreeOfFreedomDistribution->numLocal) {
114 parm->col_DOF_UpperBound = nodes->reducedDegreeOfFreedomDistribution->numLocal;
115 #endif
116 parm->col_DOF=nodes->reducedDegreeOfFreedom;
117 parm->col_jac=Finley_ElementFile_borrowJacobeans(elements,nodes,TRUE,reducedIntegrationOrder);
118 parm->col_node=parm->row_jac->ReferenceElement->Type->linearNodes;
119 } else {
120 Finley_setError(TYPE_ERROR,"Assemble_getAssembleParameters: number of columns in matrix does not match the number of degrees of freedom in mesh");
121 }
122 }
123 if (! Finley_noError()) return;
124 /* get the information from right hand side */
125 if (!isEmpty(F)) {
126 #ifndef PASO_MPI
127 if (numSamplesEqual(F,1,nodes->numDegreesOfFreedom)) {
128 parm->row_DOF_UpperBound=nodes->numDegreesOfFreedom;
129 #else
130 if (numSamplesEqual(F,1,nodes->degreeOfFreedomDistribution->numLocal)) {
131 parm->row_DOF_UpperBound = nodes->degreeOfFreedomDistribution->numLocal;
132 #endif
133 parm->row_DOF=nodes->degreeOfFreedom;
134 parm->row_jac=Finley_ElementFile_borrowJacobeans(elements,nodes,FALSE,reducedIntegrationOrder);
135 parm->row_node=&(parm->id[0]);
136 }
137 #ifndef PASO_MPI
138 else if (numSamplesEqual(F,1,nodes->reducedNumDegreesOfFreedom)) {
139 parm->row_DOF_UpperBound=nodes->reducedNumDegreesOfFreedom;
140 #else
141 else if (numSamplesEqual(F,1,nodes->reducedDegreeOfFreedomDistribution->numLocal)) {
142 parm->row_DOF_UpperBound = nodes->reducedDegreeOfFreedomDistribution->numLocal;
143 #endif
144 parm->row_DOF=nodes->reducedDegreeOfFreedom;
145 parm->row_jac=Finley_ElementFile_borrowJacobeans(elements,nodes,TRUE,reducedIntegrationOrder);
146 parm->row_node=parm->row_jac->ReferenceElement->Type->linearNodes;
147 } else {
148 Finley_setError(TYPE_ERROR,"Assemble_getAssembleParameters: length of RHS vector does not match the number of degrees of freedom in mesh");
149 }
150 if (S==NULL) {
151 parm->col_DOF_UpperBound=parm->row_DOF_UpperBound;
152 parm->col_DOF=parm->row_DOF;
153 parm->col_node=parm->row_node;
154 parm->col_jac=parm->row_jac;
155 }
156 }
157 if (! Finley_noError()) return;
158 if (parm->row_jac!=parm->col_jac) {
159 Finley_setError(TYPE_ERROR,"Assemble_getAssembleParameters: assemblage cannot handle different shape functions for rows and columns (yet).");
160 }
161 if (! Finley_noError()) return;
162 parm->NN=elements->ReferenceElement->Type->numNodes;
163 parm->numDim=parm->row_jac->numDim;
164 parm->numQuad=parm->row_jac->ReferenceElement->numQuadNodes;
165 parm->row_NN=parm->row_jac->ReferenceElement->Type->numNodes;
166 parm->row_NS=parm->row_jac->ReferenceElement->Type->numShapes;
167 parm->col_NN=parm->col_jac->ReferenceElement->Type->numNodes;
168 parm->col_NS=parm->col_jac->ReferenceElement->Type->numShapes;
169 }
170
171 /*
172 * $Log$
173 * Revision 1.6 2005/09/15 03:44:21 jgs
174 * Merge of development branch dev-02 back to main trunk on 2005-09-15
175 *
176 * Revision 1.5.2.1 2005/09/07 06:26:17 gross
177 * the solver from finley are put into the standalone package paso now
178 *
179 * Revision 1.5 2005/07/08 04:07:47 jgs
180 * Merge of development branch back to main trunk on 2005-07-08
181 *
182 * Revision 1.4 2004/12/15 07:08:32 jgs
183 * *** empty log message ***
184 * Revision 1.1.1.1.2.4 2005/07/01 07:02:13 gross
185 * some bug with OPENMP fixed
186 *
187 * Revision 1.1.1.1.2.3 2005/06/29 02:34:48 gross
188 * some changes towards 64 integers in finley
189 *
190 * Revision 1.1.1.1.2.2 2004/11/12 06:58:18 gross
191 * 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
192 *
193 * Revision 1.1.1.1.2.1 2004/10/28 22:59:24 gross
194 * finley's RecTest.py is running now: problem in SystemMatrixAdapater fixed
195 *
196 * Revision 1.1.1.1 2004/10/26 06:53:57 jgs
197 * initial import of project esys2
198 *
199 * Revision 1.2 2004/07/21 05:00:54 gross
200 * name changes in DataC
201 *
202 * Revision 1.1 2004/07/02 04:21:13 gross
203 * Finley C code has been included
204 *
205 *
206 */
207

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26