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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 82 - (hide annotations)
Tue Oct 26 06:53:54 2004 UTC (14 years, 9 months ago) by jgs
Original Path: trunk/esys2/finley/src/finleyC/ElementFile_copyTable.c
File MIME type: text/plain
File size: 2114 byte(s)
Initial revision

1 jgs 82 /* $Id$ */
2     /**************************************************************/
3    
4     /* Finley: ElementFile */
5    
6     /* copies element file in into element file out starting from offset */
7     /* the elements offset to in->numElements+offset-1 in out will be overwritten */
8    
9     /**************************************************************/
10    
11     /* Copyrights by ACcESS Australia 2003/04 */
12     /* Author: gross@access.edu.au */
13     /* Version: $Id$ */
14    
15     /**************************************************************/
16    
17     #include "Finley.h"
18     #include "ElementFile.h"
19    
20     /****************************************************************************/
21    
22    
23     void Finley_ElementFile_copyTable(int offset,Finley_ElementFile* out,int node_offset, int idOffset,Finley_ElementFile* in) {
24     maybelong i,n;
25     maybelong NN=out->ReferenceElement->Type->numNodes;
26     if (in==NULL) return;
27     /* check dimension and file size */
28     if (out->ReferenceElement->Type->TypeId!=in->ReferenceElement->Type->TypeId) {
29     Finley_ErrorCode=TYPE_ERROR;
30     sprintf(Finley_ErrorMsg,"dimensions of element files don't match");
31     }
32     if (out->numElements<in->numElements+offset) {
33     Finley_ErrorCode=MEMORY_ERROR;
34     sprintf(Finley_ErrorMsg,"element table is too small.");
35     }
36     if (Finley_ErrorCode==NO_ERROR) {
37     #pragma omp parallel for private(i,n) schedule(static)
38     for(n=0;n<in->numElements;n++) {
39     out->Id[offset+n]=in->Id[n]+idOffset;
40     out->Tag[offset+n]=in->Tag[n];
41     out->Color[offset+n]=in->Color[n]+out->numColors;
42     for(i=0;i<NN;i++) out->Nodes[INDEX2(i,offset+n,NN)]=in->Nodes[INDEX2(i,n,in->ReferenceElement->Type->numNodes)]+node_offset;
43     }
44     out->numColors+=in->numColors;
45     }
46     }
47     /*
48     * $Log$
49     * Revision 1.1 2004/10/26 06:53:57 jgs
50     * Initial revision
51     *
52     * Revision 1.1.1.1 2004/06/24 04:00:40 johng
53     * Initial version of eys using boost-python.
54     *
55     *
56     */

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26