/[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 123 by jgs, Fri Jul 8 04:08:13 2005 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      Finley_resetError();
34    dim_t i;    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;
# Line 32  void Assemble_getAssembleParameters(Finl Line 41  void Assemble_getAssembleParameters(Finl
41    parm->numElementDim=parm->referenceElement->Type->numDim;    parm->numElementDim=parm->referenceElement->Type->numDim;
42    
43    if (!isEmpty(F) && !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->logical_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 row block size and number of components of right hand side don't match.");  
51        return;        return;
52      }      }
53    
54      if (! numSamplesEqual(F,1,(S->num_rows*S->row_block_size)/S->logical_row_block_size)) {      if (! numSamplesEqual(F,1,(S->num_rows*S->row_block_size)/S->logical_row_block_size)) {
55        Finley_ErrorCode=TYPE_ERROR;        Finley_setError(TYPE_ERROR,"__FILE__: number of rows of matrix and length of right hand side don't match.");
       sprintf(Finley_ErrorMsg,"number of rows of matrix and length of right hand side don't match.");  
56        return;        return;
57      }      }
58    }    }
# Line 75  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 88  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 103  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 114  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 126  void Assemble_getAssembleParameters(Finl Line 128  void Assemble_getAssembleParameters(Finl
128    
129  /*  /*
130   * $Log$   * $Log$
131     * 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   * Revision 1.5  2005/07/08 04:07:47  jgs   * Revision 1.5  2005/07/08 04:07:47  jgs
138   * Merge of development branch back to main trunk on 2005-07-08   * Merge of development branch back to main trunk on 2005-07-08
139   *   *

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

  ViewVC Help
Powered by ViewVC 1.1.26