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

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

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

revision 82 by jgs, Tue Oct 26 06:53:54 2004 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    
17  /*   Finley: ElementFile                                                      */  /*   Finley: ElementFile                                                      */
# Line 8  Line 21 
21                                                                                                                                                                                                                                                                                                        
22  /**************************************************************/  /**************************************************************/
23    
24  /*   Copyrights by ACcESS Australia 2003/04 */  /*  Author: gross@access.edu.au */
25  /*   Author: gross@access.edu.au */  /*  Version: $Id$ */
 /*   Version: $Id$ */  
26    
27  /**************************************************************/  /**************************************************************/
28    
 #include "Finley.h"  
29  #include "ElementFile.h"  #include "ElementFile.h"
30    
31  /****************************************************************************/  /****************************************************************************/
32    
33    
34  void Finley_ElementFile_copyTable(int offset,Finley_ElementFile* out,int node_offset, int idOffset,Finley_ElementFile* in) {  void Finley_ElementFile_copyTable(index_t offset,Finley_ElementFile* out,index_t node_offset, index_t idOffset,Finley_ElementFile* in) {
35      maybelong i,n;      dim_t i,n;
36      maybelong NN=out->ReferenceElement->Type->numNodes;      dim_t NN=out->ReferenceElement->Type->numNodes;
37      if (in==NULL) return;      if (in==NULL) return;
38      /* check dimension and file size */      /* check dimension and file size */
39      if (out->ReferenceElement->Type->TypeId!=in->ReferenceElement->Type->TypeId) {      if (out->ReferenceElement->Type->TypeId!=in->ReferenceElement->Type->TypeId) {
40          Finley_ErrorCode=TYPE_ERROR;          Finley_setError(TYPE_ERROR,"__FILE__: dimensions of element files don't match");
         sprintf(Finley_ErrorMsg,"dimensions of element files don't match");  
41      }      }
42      if (out->numElements<in->numElements+offset) {      if (out->numElements<in->numElements+offset) {
43          Finley_ErrorCode=MEMORY_ERROR;          Finley_setError(MEMORY_ERROR,"__FILE__: element table is too small.");
         sprintf(Finley_ErrorMsg,"element table is too small.");  
44      }      }
45      if (Finley_ErrorCode==NO_ERROR) {      if (Finley_noError()) {
46         #pragma omp parallel for private(i,n) schedule(static)         #pragma omp parallel for private(i,n) schedule(static)
47         for(n=0;n<in->numElements;n++) {         for(n=0;n<in->numElements;n++) {
48            out->Id[offset+n]=in->Id[n]+idOffset;            out->Id[offset+n]=in->Id[n]+idOffset;
49            out->Tag[offset+n]=in->Tag[n];            out->Tag[offset+n]=in->Tag[n];
50            out->Color[offset+n]=in->Color[n]+out->numColors;            out->Color[offset+n]=in->Color[n]+out->maxColor+1;
51            for(i=0;i<NN;i++) out->Nodes[INDEX2(i,offset+n,NN)]=in->Nodes[INDEX2(i,n,in->ReferenceElement->Type->numNodes)]+node_offset;            for(i=0;i<NN;i++) out->Nodes[INDEX2(i,offset+n,NN)]=in->Nodes[INDEX2(i,n,in->ReferenceElement->Type->numNodes)]+node_offset;
52         }         }
53         out->numColors+=in->numColors;         out->minColor=MIN(out->minColor,in->minColor+out->maxColor+1);
54           out->maxColor=MAX(out->maxColor,in->maxColor+out->maxColor+1);
55      }      }
56  }  }
57  /*  /*
58  * $Log$  * $Log$
59  * Revision 1.1  2004/10/26 06:53:57  jgs  * Revision 1.3  2005/09/15 03:44:22  jgs
60  * Initial revision  * Merge of development branch dev-02 back to main trunk on 2005-09-15
61    *
62    * Revision 1.2.2.1  2005/09/07 06:26:18  gross
63    * the solver from finley are put into the standalone package paso now
64    *
65    * Revision 1.2  2005/07/08 04:07:49  jgs
66    * Merge of development branch back to main trunk on 2005-07-08
67    *
68    * Revision 1.1.1.1.2.2  2005/06/30 01:53:55  gross
69    * a bug in coloring fixed
70    *
71    * Revision 1.1.1.1.2.1  2005/06/29 02:34:49  gross
72    * some changes towards 64 integers in finley
73    *
74    * Revision 1.1.1.1  2004/10/26 06:53:57  jgs
75    * initial import of project esys2
76  *  *
77  * Revision 1.1.1.1  2004/06/24 04:00:40  johng  * Revision 1.1.1.1  2004/06/24 04:00:40  johng
78  * Initial version of eys using boost-python.  * Initial version of eys using boost-python.

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

  ViewVC Help
Powered by ViewVC 1.1.26