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

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

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

trunk/esys2/finley/src/finleyC/Assemble_integrate.c revision 102 by jgs, Wed Dec 15 07:08:39 2004 UTC trunk/finley/src/finley/Assemble_integrate.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  #include "Util.h"  #include "Util.h"
29  #ifdef _OPENMP  #ifdef _OPENMP
30  #include <omp.h>  #include <omp.h>
# Line 25  Line 33 
33  /**************************************************************/  /**************************************************************/
34    
35  void Finley_Assemble_integrate(Finley_NodeFile* nodes, Finley_ElementFile* elements,escriptDataC* data,double* out) {  void Finley_Assemble_integrate(Finley_NodeFile* nodes, Finley_ElementFile* elements,escriptDataC* data,double* out) {
36      int q,e,datacase,node_offset,i;      type_t datacase;
37        index_t node_offset;
38        dim_t q,e,i;
39      double *local_X, *dVdv, *Vol,*out_local,*data_array,rtmp;      double *local_X, *dVdv, *Vol,*out_local,*data_array,rtmp;
40      if (nodes==NULL || elements==NULL) return;      if (nodes==NULL || elements==NULL) return;
41      int NN=elements->ReferenceElement->Type->numNodes;      dim_t NN=elements->ReferenceElement->Type->numNodes;
42      int NS=elements->ReferenceElement->Type->numShapes;      dim_t NS=elements->ReferenceElement->Type->numShapes;
43      int data_type=getFunctionSpaceType(data);      type_t data_type=getFunctionSpaceType(data);
44      int numComps=getDataPointSize(data);      dim_t numComps=getDataPointSize(data);
45      int numQuad=elements->ReferenceElement->numQuadNodes;      dim_t numQuad=elements->ReferenceElement->numQuadNodes;
46      int numDim=nodes->numDim;      dim_t numDim=nodes->numDim;
47      int numDim_local=elements->ReferenceElement->Type->numDim;      dim_t numDim_local=elements->ReferenceElement->Type->numDim;
48        Finley_resetError();
49                                                                                                                                                                                                                                                                                                
50      /* set some parameter */      /* set some parameter */
51                                                                                                                                                                                                                                                                                                
# Line 51  void Finley_Assemble_integrate(Finley_No Line 62  void Finley_Assemble_integrate(Finley_No
62          datacase=1;          datacase=1;
63          node_offset=NN-NS;          node_offset=NN-NS;
64      } else {      } else {
65         Finley_ErrorCode=TYPE_ERROR;         Finley_setError(TYPE_ERROR,"__FILE__: integration of data is not possible.");
        sprintf(Finley_ErrorMsg,"integration of data is not possible.");  
66      }      }
67    
68      /* check the shape of the data  */      /* check the shape of the data  */
69    
70      if (! numSamplesEqual(data,numQuad,elements->numElements)) {      if (! numSamplesEqual(data,numQuad,elements->numElements)) {
71         Finley_ErrorCode=TYPE_ERROR;         Finley_setError(TYPE_ERROR,"__FILE__: illegal number of samples of integrant kernel Data object");
        sprintf(Finley_ErrorMsg,"illegal number of samples of integrant kernel Data object");  
72      }      }
73    
74      /* now we can start */      /* now we can start */
75    
76      if (Finley_ErrorCode==NO_ERROR) {      if (Finley_noError()) {
77          for (q=0;q<numComps;q++) out[q]=0;          for (q=0;q<numComps;q++) out[q]=0;
78          #pragma omp parallel private(local_X,dVdv,Vol,out_local,i)          #pragma omp parallel private(local_X,dVdv,Vol,out_local,i)
79          {          {
# Line 129  void Finley_Assemble_integrate(Finley_No Line 138  void Finley_Assemble_integrate(Finley_No
138    
139  /*  /*
140   * $Log$   * $Log$
141     * Revision 1.6  2005/09/15 03:44:21  jgs
142     * Merge of development branch dev-02 back to main trunk on 2005-09-15
143     *
144     * Revision 1.5.2.1  2005/09/07 06:26:18  gross
145     * the solver from finley are put into the standalone package paso now
146     *
147     * Revision 1.5  2005/07/08 04:07:48  jgs
148     * Merge of development branch back to main trunk on 2005-07-08
149     *
150   * Revision 1.4  2004/12/15 07:08:32  jgs   * Revision 1.4  2004/12/15 07:08:32  jgs
151   * *** empty log message ***   * *** empty log message ***
152     * Revision 1.1.1.1.2.2  2005/06/29 02:34:48  gross
153     * some changes towards 64 integers in finley
154     *
155     * Revision 1.1.1.1.2.1  2004/11/24 01:37:12  gross
156     * some changes dealing with the integer overflow in memory allocation. Finley solves 4M unknowns now
157   *   *
158   *   *
159   *   *

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

  ViewVC Help
Powered by ViewVC 1.1.26