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

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

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

revision 149 by jgs, Thu Sep 1 03:31:39 2005 UTC revision 150 by jgs, Thu Sep 15 03:44:45 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 17  Line 29 
29    
30  /**************************************************************/  /**************************************************************/
31    
32  /*   Copyrights by ACcESS Australia, 2003,2004,2005 */  /*  Author: gross@access.edu.au */
33  /*   author: gross@access.edu.au */  /*  Version: $Id$ */
 /*   Version: $Id$ */  
34    
35  /**************************************************************/  /**************************************************************/
36    
 #include "escript/Data/DataC.h"  
37  #include "Assemble.h"  #include "Assemble.h"
 #include "NodeFile.h"  
 #include "ElementFile.h"  
 #include "Finley.h"  
38  #include "Util.h"  #include "Util.h"
39  #ifdef _OPENMP  #ifdef _OPENMP
40  #include <omp.h>  #include <omp.h>
# Line 36  Line 43 
43  /**************************************************************/  /**************************************************************/
44    
45  void Finley_Assemble_RobinCondition_RHS(Finley_NodeFile* nodes,Finley_ElementFile* elements,escriptDataC* F, escriptDataC* y, Finley_Assemble_handelShapeMissMatch handelShapeMissMatchForEM) {  void Finley_Assemble_RobinCondition_RHS(Finley_NodeFile* nodes,Finley_ElementFile* elements,escriptDataC* F, escriptDataC* y, Finley_Assemble_handelShapeMissMatch handelShapeMissMatchForEM) {
46      char error_msg[LenErrorMsg_MAX];
47    double *EM_F=NULL,*V=NULL,*dVdv=NULL,*dSdV=NULL,*Area=NULL;    double *EM_F=NULL,*V=NULL,*dVdv=NULL,*dSdV=NULL,*Area=NULL;
48    double time0;    double time0;
49    Assemble_Parameters p;    Assemble_Parameters p;
50    index_t *index_row=NULL,color;    index_t *index_row=NULL,color;
51    dim_t dimensions[ESCRIPT_MAX_DATA_RANK],e,q;    dim_t dimensions[ESCRIPT_MAX_DATA_RANK],e,q;
52    bool_t assemble;    bool_t assemble;
53      Finley_resetError();
54    
55    if (nodes==NULL || elements==NULL) return;    if (nodes==NULL || elements==NULL) return;
56    if (isEmpty(F) || isEmpty(y) ) return;    if (isEmpty(F) || isEmpty(y) ) return;
57    
58    /* set all parameters in p*/    /* set all parameters in p*/
59    Assemble_getAssembleParameters(nodes,elements,NULL,F,&p);    Assemble_getAssembleParameters(nodes,elements,NULL,F,&p);
60    if (Finley_ErrorCode!=NO_ERROR) return;    if (! Finley_noError()) return;
61    
62    /*  get a functionspace */    /*  get a functionspace */
63    type_t funcspace=UNKNOWN;    type_t funcspace=UNKNOWN;
# Line 58  void Finley_Assemble_RobinCondition_RHS( Line 67  void Finley_Assemble_RobinCondition_RHS(
67    /* check if all function spaces are the same */    /* check if all function spaces are the same */
68    
69    if (! functionSpaceTypeEqual(funcspace,y) ) {    if (! functionSpaceTypeEqual(funcspace,y) ) {
70          Finley_ErrorCode=TYPE_ERROR;          Finley_setError(TYPE_ERROR,"__FILE__: unexpected function space type for coefficient y");
         sprintf(Finley_ErrorMsg,"unexpected function space type for coefficient y");  
71    }    }
72    
73    /* check if all function spaces are the same */    /* check if all function spaces are the same */
74    
75    if (! numSamplesEqual(y,p.numQuad,elements->numElements) ) {    if (! numSamplesEqual(y,p.numQuad,elements->numElements) ) {
76          Finley_ErrorCode=TYPE_ERROR;          sprintf(error_msg,"__FILE__:sample points of coefficient y don't match (%d,%d)",p.numQuad,elements->numElements);
77          sprintf(Finley_ErrorMsg,"sample points of coefficient y don't match (%d,%d)",p.numQuad,elements->numElements);          Finley_setError(TYPE_ERROR,error_msg);
78    }    }
79    
80        
# Line 75  void Finley_Assemble_RobinCondition_RHS( Line 83  void Finley_Assemble_RobinCondition_RHS(
83    if (p.numEqu==1 && p.numComp==1) {    if (p.numEqu==1 && p.numComp==1) {
84      if (!isEmpty(y)) {      if (!isEmpty(y)) {
85        if (! isDataPointShapeEqual(y,0,dimensions)) {        if (! isDataPointShapeEqual(y,0,dimensions)) {
86            Finley_ErrorCode=TYPE_ERROR;            Finley_setError(TYPE_ERROR,"__FILE__: coefficient y, rank 0 expected.");
           sprintf(Finley_ErrorMsg,"coefficient y, rank 0 expected.");  
87        }        }
88      }      }
89    } else {    } else {
90      if (!isEmpty(y)) {      if (!isEmpty(y)) {
91        dimensions[0]=p.numEqu;        dimensions[0]=p.numEqu;
92        if (! isDataPointShapeEqual(y,1,dimensions)) {        if (! isDataPointShapeEqual(y,1,dimensions)) {
93            Finley_ErrorCode=TYPE_ERROR;            sprintf(error_msg,"__FILE__:coefficient y, expected shape (%d,)",dimensions[0]);
94            sprintf(Finley_ErrorMsg,"coefficient y, expected shape (%d,)",dimensions[0]);            Finley_setError(TYPE_ERROR,error_msg);
95        }        }
96      }      }
97    }    }
98        
99    if (Finley_ErrorCode==NO_ERROR) {    if (Finley_noError()) {
100       time0=Finley_timer();       time0=Finley_timer();
101       #pragma omp parallel private(assemble,index_row,EM_F,V,dVdv,dSdV,Area,color)       #pragma omp parallel private(assemble,index_row,EM_F,V,dVdv,dSdV,Area,color)
102       {       {
# Line 160  void Finley_Assemble_RobinCondition_RHS( Line 167  void Finley_Assemble_RobinCondition_RHS(
167  }  }
168  /*  /*
169   * $Log$   * $Log$
170     * Revision 1.4  2005/09/15 03:44:21  jgs
171     * Merge of development branch dev-02 back to main trunk on 2005-09-15
172     *
173   * Revision 1.3  2005/09/01 03:31:35  jgs   * Revision 1.3  2005/09/01 03:31:35  jgs
174   * Merge of development branch dev-02 back to main trunk on 2005-09-01   * Merge of development branch dev-02 back to main trunk on 2005-09-01
175   *   *
176   * Revision 1.2  2005/08/12 01:45:43  jgs   * Revision 1.2  2005/08/12 01:45:43  jgs
177   * erge of development branch dev-02 back to main trunk on 2005-08-12   * erge of development branch dev-02 back to main trunk on 2005-08-12
178   *   *
179     * Revision 1.1.2.3  2005/09/07 06:26:17  gross
180     * the solver from finley are put into the standalone package paso now
181     *
182   * Revision 1.1.2.2  2005/08/24 02:02:18  gross   * Revision 1.1.2.2  2005/08/24 02:02:18  gross
183   * timing output switched off. solver output can be swiched through getSolution(verbose=True) now.   * timing output switched off. solver output can be swiched through getSolution(verbose=True) now.
184   *   *

Legend:
Removed from v.149  
changed lines
  Added in v.150

  ViewVC Help
Powered by ViewVC 1.1.26