/[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 471 - (hide annotations)
Fri Jan 27 01:33:02 2006 UTC (14 years, 1 month ago) by jgs
File MIME type: text/plain
File size: 7161 byte(s)
reorganise finley src tree to remove inc dir and src/finley directory

1 jgs 150 /*
2     ******************************************************************************
3     * *
4     * COPYRIGHT ACcESS 2003,2004,2005 - All Rights Reserved *
5     * *
6     * This software is the property of ACcESS. No part of this code *
7     * may be copied in any form or by any means without the expressed written *
8     * consent of ACcESS. Copying, use or modification of this software *
9     * by any unauthorised person is illegal unless that person has a software *
10     * license agreement with ACcESS. *
11     * *
12     ******************************************************************************
13     */
14 jgs 82
15     /**************************************************************/
16    
17     /* assemblage routines: prepares the assemble parameter set */
18    
19     /**************************************************************/
20    
21 jgs 150 /* Copyrights by ACcESS Australia, 2003,2004,2005 */
22 jgs 82 /* author: gross@access.edu.au */
23     /* Version: $Id$ */
24    
25     /**************************************************************/
26    
27     #include "Assemble.h"
28    
29     /**************************************************************/
30    
31 jgs 150 void Assemble_getAssembleParameters(Finley_NodeFile* nodes,Finley_ElementFile* elements,Paso_SystemMatrix* S,
32 jgs 82 escriptDataC* F,Assemble_Parameters *parm) {
33 jgs 150 Finley_resetError();
34 jgs 123 dim_t i;
35 jgs 82 parm->NN=elements->ReferenceElement->Type->numNodes;
36     for (i=0;i<parm->NN;i++) parm->id[i]=i;
37     parm->NS=elements->ReferenceElement->Type->numShapes;
38     parm->referenceElement=elements->ReferenceElement;
39     parm->numQuad=parm->referenceElement->numQuadNodes;
40     parm->numDim=nodes->numDim;
41     parm->numElementDim=parm->referenceElement->Type->numDim;
42    
43 jgs 102 if (!isEmpty(F) && !isExpanded(F) ) {
44 jgs 150 Finley_setError(TYPE_ERROR,"__FILE__: Right hand side is not expanded.");
45 jgs 82 return;
46     }
47     /* check the dimensions of S and F */
48     if (S!=NULL && !isEmpty(F)) {
49 jgs 102 if ( getDataPointSize(F)!=S->logical_row_block_size) {
50 jgs 150 Finley_setError(TYPE_ERROR,"__FILE__: matrix row block size and number of components of right hand side don't match.");
51 jgs 82 return;
52     }
53 jgs 123
54 jgs 102 if (! numSamplesEqual(F,1,(S->num_rows*S->row_block_size)/S->logical_row_block_size)) {
55 jgs 150 Finley_setError(TYPE_ERROR,"__FILE__: number of rows of matrix and length of right hand side don't match.");
56 jgs 82 return;
57     }
58     }
59     /* get the number of equations and components */
60     if (S!=NULL) {
61 jgs 102 parm->numEqu=S->logical_row_block_size;
62     parm->numComp=S->logical_col_block_size;
63 jgs 82 } else {
64     parm->numEqu=1;
65     parm->numComp=1;
66     }
67     if (!isEmpty(F)) parm->numEqu=getDataPointSize(F);
68    
69     parm->label_col=nodes->degreeOfFreedom;
70     parm->label_row=nodes->degreeOfFreedom;
71     parm->referenceElement_row=elements->ReferenceElement;
72     parm->referenceElement_col=elements->ReferenceElement;
73     /* get the information for the labeling of the degrees of freedom */
74     if (S!=NULL) {
75     if (S->num_rows*S->row_block_size==parm->numEqu*nodes->numDegreesOfFreedom) {
76     parm->label_row=nodes->degreeOfFreedom;
77     parm->row_node=&(parm->id[0]);
78     parm->referenceElement_row=elements->ReferenceElement;
79     } else if (S->num_rows*S->row_block_size==parm->numEqu*nodes->reducedNumDegreesOfFreedom) {
80     parm->label_row=nodes->reducedDegreeOfFreedom;
81     parm->row_node=parm->referenceElement->Type->linearNodes;
82     parm->referenceElement_row=elements->LinearReferenceElement;
83     } else {
84 jgs 150 Finley_setError(TYPE_ERROR,"__FILE__: number of rows in matrix does not match the number of degrees of freedom in mesh");
85 jgs 82 return;
86     }
87     if (S->num_cols*S->col_block_size==parm->numComp*nodes->numDegreesOfFreedom) {
88     parm->label_col=nodes->degreeOfFreedom;
89     parm->col_node=&(parm->id[0]);
90     parm->referenceElement_col=elements->ReferenceElement;
91     } else if (S->num_cols*S->col_block_size==parm->numComp*nodes->reducedNumDegreesOfFreedom) {
92     parm->label_col=nodes->reducedDegreeOfFreedom;
93     parm->col_node=parm->referenceElement->Type->linearNodes;
94     parm->referenceElement_col=elements->LinearReferenceElement;
95     } else {
96 jgs 150 Finley_setError(TYPE_ERROR,"__FILE__: number of columns in matrix does not match the number of degrees of freedom in mesh");
97 jgs 82 return;
98     }
99     }
100     if (!isEmpty(F)) {
101     if (numSamplesEqual(F,1,nodes->numDegreesOfFreedom)) {
102     parm->row_node=&(parm->id[0]);
103     parm->label_row=nodes->degreeOfFreedom;
104     parm->referenceElement_row=elements->ReferenceElement;
105     } else if (numSamplesEqual(F,1,nodes->reducedNumDegreesOfFreedom)) {
106     parm->label_row=nodes->reducedDegreeOfFreedom;
107     parm->row_node=parm->referenceElement->Type->linearNodes;
108     parm->referenceElement_row=elements->LinearReferenceElement;
109     } else {
110 jgs 150 Finley_setError(TYPE_ERROR,"__FILE__: length of RHS vector does not match the number of degrees of freedom in mesh");
111 jgs 82 return;
112     }
113     if (S==NULL) {
114     parm->label_col=parm->label_row;
115     parm->col_node=parm->row_node;
116     parm->referenceElement_col=parm->referenceElement_row;
117     }
118     }
119     if (parm->referenceElement_row!=parm->referenceElement_col) {
120 jgs 150 Finley_setError(TYPE_ERROR,"__FILE__: assemblage cannot handel different shape functions for rows and columns (yet).");
121 jgs 82 return;
122     }
123     parm->NN_row=parm->referenceElement_row->Type->numNodes;
124     parm->NS_row=parm->referenceElement_row->Type->numShapes;
125     parm->NN_col=parm->referenceElement_col->Type->numNodes;
126     parm->NS_col=parm->referenceElement_col->Type->numShapes;
127     }
128    
129     /*
130     * $Log$
131 jgs 150 * Revision 1.6 2005/09/15 03:44:21 jgs
132     * Merge of development branch dev-02 back to main trunk on 2005-09-15
133     *
134     * Revision 1.5.2.1 2005/09/07 06:26:17 gross
135     * the solver from finley are put into the standalone package paso now
136     *
137 jgs 123 * Revision 1.5 2005/07/08 04:07:47 jgs
138     * Merge of development branch back to main trunk on 2005-07-08
139     *
140 jgs 102 * Revision 1.4 2004/12/15 07:08:32 jgs
141 jgs 97 * *** empty log message ***
142 jgs 123 * Revision 1.1.1.1.2.4 2005/07/01 07:02:13 gross
143     * some bug with OPENMP fixed
144 jgs 82 *
145 jgs 123 * Revision 1.1.1.1.2.3 2005/06/29 02:34:48 gross
146     * some changes towards 64 integers in finley
147 jgs 97 *
148 jgs 123 * Revision 1.1.1.1.2.2 2004/11/12 06:58:18 gross
149     * 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
150     *
151     * Revision 1.1.1.1.2.1 2004/10/28 22:59:24 gross
152     * finley's RecTest.py is running now: problem in SystemMatrixAdapater fixed
153     *
154     * Revision 1.1.1.1 2004/10/26 06:53:57 jgs
155     * initial import of project esys2
156     *
157     * Revision 1.2 2004/07/21 05:00:54 gross
158     * name changes in DataC
159     *
160     * Revision 1.1 2004/07/02 04:21:13 gross
161     * Finley C code has been included
162     *
163     *
164 jgs 82 */
165    

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26