/[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 616 - (hide annotations)
Wed Mar 22 02:46:56 2006 UTC (13 years, 11 months ago) by elspeth
File MIME type: text/plain
File size: 6839 byte(s)
Copyright added to more source files.

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     if (S->num_rows*S->row_block_size==parm->numEqu*nodes->numDegreesOfFreedom) {
74     parm->label_row=nodes->degreeOfFreedom;
75     parm->row_node=&(parm->id[0]);
76     parm->referenceElement_row=elements->ReferenceElement;
77     } else if (S->num_rows*S->row_block_size==parm->numEqu*nodes->reducedNumDegreesOfFreedom) {
78     parm->label_row=nodes->reducedDegreeOfFreedom;
79     parm->row_node=parm->referenceElement->Type->linearNodes;
80     parm->referenceElement_row=elements->LinearReferenceElement;
81     } else {
82 jgs 150 Finley_setError(TYPE_ERROR,"__FILE__: number of rows in matrix does not match the number of degrees of freedom in mesh");
83 jgs 82 return;
84     }
85     if (S->num_cols*S->col_block_size==parm->numComp*nodes->numDegreesOfFreedom) {
86     parm->label_col=nodes->degreeOfFreedom;
87     parm->col_node=&(parm->id[0]);
88     parm->referenceElement_col=elements->ReferenceElement;
89     } else if (S->num_cols*S->col_block_size==parm->numComp*nodes->reducedNumDegreesOfFreedom) {
90     parm->label_col=nodes->reducedDegreeOfFreedom;
91     parm->col_node=parm->referenceElement->Type->linearNodes;
92     parm->referenceElement_col=elements->LinearReferenceElement;
93     } else {
94 jgs 150 Finley_setError(TYPE_ERROR,"__FILE__: number of columns in matrix does not match the number of degrees of freedom in mesh");
95 jgs 82 return;
96     }
97     }
98     if (!isEmpty(F)) {
99     if (numSamplesEqual(F,1,nodes->numDegreesOfFreedom)) {
100     parm->row_node=&(parm->id[0]);
101     parm->label_row=nodes->degreeOfFreedom;
102     parm->referenceElement_row=elements->ReferenceElement;
103     } else if (numSamplesEqual(F,1,nodes->reducedNumDegreesOfFreedom)) {
104     parm->label_row=nodes->reducedDegreeOfFreedom;
105     parm->row_node=parm->referenceElement->Type->linearNodes;
106     parm->referenceElement_row=elements->LinearReferenceElement;
107     } else {
108 jgs 150 Finley_setError(TYPE_ERROR,"__FILE__: length of RHS vector does not match the number of degrees of freedom in mesh");
109 jgs 82 return;
110     }
111     if (S==NULL) {
112     parm->label_col=parm->label_row;
113     parm->col_node=parm->row_node;
114     parm->referenceElement_col=parm->referenceElement_row;
115     }
116     }
117     if (parm->referenceElement_row!=parm->referenceElement_col) {
118 jgs 150 Finley_setError(TYPE_ERROR,"__FILE__: assemblage cannot handel different shape functions for rows and columns (yet).");
119 jgs 82 return;
120     }
121     parm->NN_row=parm->referenceElement_row->Type->numNodes;
122     parm->NS_row=parm->referenceElement_row->Type->numShapes;
123     parm->NN_col=parm->referenceElement_col->Type->numNodes;
124     parm->NS_col=parm->referenceElement_col->Type->numShapes;
125     }
126    
127     /*
128     * $Log$
129 jgs 150 * Revision 1.6 2005/09/15 03:44:21 jgs
130     * Merge of development branch dev-02 back to main trunk on 2005-09-15
131     *
132     * Revision 1.5.2.1 2005/09/07 06:26:17 gross
133     * the solver from finley are put into the standalone package paso now
134     *
135 jgs 123 * Revision 1.5 2005/07/08 04:07:47 jgs
136     * Merge of development branch back to main trunk on 2005-07-08
137     *
138 jgs 102 * Revision 1.4 2004/12/15 07:08:32 jgs
139 jgs 97 * *** empty log message ***
140 jgs 123 * Revision 1.1.1.1.2.4 2005/07/01 07:02:13 gross
141     * some bug with OPENMP fixed
142 jgs 82 *
143 jgs 123 * Revision 1.1.1.1.2.3 2005/06/29 02:34:48 gross
144     * some changes towards 64 integers in finley
145 jgs 97 *
146 jgs 123 * Revision 1.1.1.1.2.2 2004/11/12 06:58:18 gross
147     * 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
148     *
149     * Revision 1.1.1.1.2.1 2004/10/28 22:59:24 gross
150     * finley's RecTest.py is running now: problem in SystemMatrixAdapater fixed
151     *
152     * Revision 1.1.1.1 2004/10/26 06:53:57 jgs
153     * initial import of project esys2
154     *
155     * Revision 1.2 2004/07/21 05:00:54 gross
156     * name changes in DataC
157     *
158     * Revision 1.1 2004/07/02 04:21:13 gross
159     * Finley C code has been included
160     *
161     *
162 jgs 82 */
163    

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26