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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/esys2/finley/src/finleyC/Assemble_getAssembleParameters.c revision 82 by jgs, Tue Oct 26 06:53:54 2004 UTC trunk/finley/src/finley/Assemble_getAssembleParameters.c revision 201 by jgs, Wed Nov 23 04:10:21 2005 UTC
# Line 1  Line 1 
1  /* $Id$ */  /*
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    
15  /**************************************************************/  /**************************************************************/
16    
# Line 6  Line 18 
18    
19  /**************************************************************/  /**************************************************************/
20    
21  /*   Copyrights by ACcESS Australia, 2003,2004 */  /*   Copyrights by ACcESS Australia, 2003,2004,2005 */
22  /*   author: gross@access.edu.au */  /*   author: gross@access.edu.au */
23  /*   Version: $Id$ */  /*   Version: $Id$ */
24    
25  /**************************************************************/  /**************************************************************/
26    
 #include "escript/Data/DataC.h"  
 #include "Finley.h"  
27  #include "Assemble.h"  #include "Assemble.h"
 #include "NodeFile.h"  
 #include "ElementFile.h"  
28    
29  /**************************************************************/  /**************************************************************/
30    
31  void Assemble_getAssembleParameters(Finley_NodeFile* nodes,Finley_ElementFile* elements,Finley_SystemMatrix* S,  void Assemble_getAssembleParameters(Finley_NodeFile* nodes,Finley_ElementFile* elements,Paso_SystemMatrix* S,
32                                          escriptDataC* F,Assemble_Parameters *parm) {                                          escriptDataC* F,Assemble_Parameters *parm) {
33    int i;    Finley_resetError();
34      dim_t i;
35    parm->NN=elements->ReferenceElement->Type->numNodes;    parm->NN=elements->ReferenceElement->Type->numNodes;
36    for (i=0;i<parm->NN;i++) parm->id[i]=i;    for (i=0;i<parm->NN;i++) parm->id[i]=i;
37    parm->NS=elements->ReferenceElement->Type->numShapes;    parm->NS=elements->ReferenceElement->Type->numShapes;
# Line 31  void Assemble_getAssembleParameters(Finl Line 40  void Assemble_getAssembleParameters(Finl
40    parm->numDim=nodes->numDim;    parm->numDim=nodes->numDim;
41    parm->numElementDim=parm->referenceElement->Type->numDim;    parm->numElementDim=parm->referenceElement->Type->numDim;
42    
43    if (!isExpanded(F) ) {    if (!isEmpty(F) && !isExpanded(F) ) {
44        Finley_ErrorCode=TYPE_ERROR;        Finley_setError(TYPE_ERROR,"__FILE__: Right hand side is not expanded.");
       sprintf(Finley_ErrorMsg,"Right hand side is not expanded.");  
45        return;        return;
46    }    }
47    /*  check the dimensions of S and F */    /*  check the dimensions of S and F */
48    if (S!=NULL && !isEmpty(F)) {    if (S!=NULL && !isEmpty(F)) {
49      if ( getDataPointSize(F)!=S->total_row_block_size) {      if ( getDataPointSize(F)!=S->logical_row_block_size) {
50        Finley_ErrorCode=TYPE_ERROR;        Finley_setError(TYPE_ERROR,"__FILE__: matrix row block size and number of components of right hand side don't match.");
       sprintf(Finley_ErrorMsg,"matrix rows and number of components of right hand side don't match.");  
51        return;        return;
52      }      }
53      if (! numSamplesEqual(F,1,S->num_rows*S->row_block_size)) {  
54        Finley_ErrorCode=TYPE_ERROR;      if (! numSamplesEqual(F,1,(S->num_rows*S->row_block_size)/S->logical_row_block_size)) {
55        sprintf(Finley_ErrorMsg,"number of rows of matrix and length of right hand side don't match.");        Finley_setError(TYPE_ERROR,"__FILE__: number of rows of matrix and length of right hand side don't match.");
56        return;        return;
57      }      }
58    }    }
59    /* get the number of equations and components */    /* get the number of equations and components */
60    if (S!=NULL) {    if (S!=NULL) {
61      parm->numEqu=S->total_row_block_size;      parm->numEqu=S->logical_row_block_size;
62      parm->numComp=S->total_col_block_size;      parm->numComp=S->logical_col_block_size;
63    } else {    } else {
64      parm->numEqu=1;      parm->numEqu=1;
65      parm->numComp=1;      parm->numComp=1;
# Line 74  void Assemble_getAssembleParameters(Finl Line 81  void Assemble_getAssembleParameters(Finl
81             parm->row_node=parm->referenceElement->Type->linearNodes;             parm->row_node=parm->referenceElement->Type->linearNodes;
82             parm->referenceElement_row=elements->LinearReferenceElement;             parm->referenceElement_row=elements->LinearReferenceElement;
83        } else {        } else {
84             Finley_ErrorCode=TYPE_ERROR;             Finley_setError(TYPE_ERROR,"__FILE__: number of rows in matrix does not match the number of degrees of freedom in mesh");
            sprintf(Finley_ErrorMsg,"number of rows in matrix does not match the number of degrees of freedom in mesh");  
85             return;             return;
86        }        }
87        if (S->num_cols*S->col_block_size==parm->numComp*nodes->numDegreesOfFreedom) {        if (S->num_cols*S->col_block_size==parm->numComp*nodes->numDegreesOfFreedom) {
# Line 87  void Assemble_getAssembleParameters(Finl Line 93  void Assemble_getAssembleParameters(Finl
93             parm->col_node=parm->referenceElement->Type->linearNodes;             parm->col_node=parm->referenceElement->Type->linearNodes;
94             parm->referenceElement_col=elements->LinearReferenceElement;             parm->referenceElement_col=elements->LinearReferenceElement;
95        } else {        } else {
96             Finley_ErrorCode=TYPE_ERROR;             Finley_setError(TYPE_ERROR,"__FILE__: number of columns in matrix does not match the number of degrees of freedom in mesh");
            sprintf(Finley_ErrorMsg,"number of columns in matrix does not match the number of degrees of freedom in mesh");  
97             return;             return;
98        }        }
99    }    }
# Line 102  void Assemble_getAssembleParameters(Finl Line 107  void Assemble_getAssembleParameters(Finl
107             parm->row_node=parm->referenceElement->Type->linearNodes;             parm->row_node=parm->referenceElement->Type->linearNodes;
108             parm->referenceElement_row=elements->LinearReferenceElement;             parm->referenceElement_row=elements->LinearReferenceElement;
109        } else {        } else {
110             Finley_ErrorCode=TYPE_ERROR;             Finley_setError(TYPE_ERROR,"__FILE__: length of RHS vector does not match the number of degrees of freedom in mesh");
            sprintf(Finley_ErrorMsg,"length of RHS vector does not match the number of degrees of freedom in mesh");  
111             return;             return;
112        }        }
113        if (S==NULL) {        if (S==NULL) {
# Line 113  void Assemble_getAssembleParameters(Finl Line 117  void Assemble_getAssembleParameters(Finl
117        }        }
118    }    }
119    if (parm->referenceElement_row!=parm->referenceElement_col) {    if (parm->referenceElement_row!=parm->referenceElement_col) {
120        Finley_ErrorCode=TYPE_ERROR;        Finley_setError(TYPE_ERROR,"__FILE__: assemblage cannot handel different shape functions for rows and columns (yet).");
       sprintf(Finley_ErrorMsg,"assemblage cannot handel different shape functions for rows and columns (yet).");  
121        return;        return;
122    }    }
123    parm->NN_row=parm->referenceElement_row->Type->numNodes;    parm->NN_row=parm->referenceElement_row->Type->numNodes;
# Line 125  void Assemble_getAssembleParameters(Finl Line 128  void Assemble_getAssembleParameters(Finl
128    
129  /*  /*
130   * $Log$   * $Log$
131   * Revision 1.1  2004/10/26 06:53:57  jgs   * Revision 1.6  2005/09/15 03:44:21  jgs
132   * Initial revision   * 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     * 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     * Revision 1.4  2004/12/15 07:08:32  jgs
141     * *** empty log message ***
142     * Revision 1.1.1.1.2.4  2005/07/01 07:02:13  gross
143     * some bug with OPENMP fixed
144     *
145     * Revision 1.1.1.1.2.3  2005/06/29 02:34:48  gross
146     * some changes towards 64 integers in finley
147     *
148     * 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   * Revision 1.2  2004/07/21 05:00:54  gross
158   * name changes in DataC   * name changes in DataC

Legend:
Removed from v.82  
changed lines
  Added in v.201

  ViewVC Help
Powered by ViewVC 1.1.26