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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 123 - (hide annotations)
Fri Jul 8 04:08:13 2005 UTC (14 years, 2 months ago) by jgs
Original Path: trunk/esys2/finley/src/finleyC/ElementFile_copyTable.c
File MIME type: text/plain
File size: 2523 byte(s)
Merge of development branch back to main trunk on 2005-07-08

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 jgs 123 void Finley_ElementFile_copyTable(index_t offset,Finley_ElementFile* out,index_t node_offset, index_t idOffset,Finley_ElementFile* in) {
24     dim_t i,n;
25     dim_t NN=out->ReferenceElement->Type->numNodes;
26 jgs 82 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 jgs 123 out->Color[offset+n]=in->Color[n]+out->maxColor+1;
42 jgs 82 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 jgs 123 out->minColor=MIN(out->minColor,in->minColor+out->maxColor+1);
45     out->maxColor=MAX(out->maxColor,in->maxColor+out->maxColor+1);
46 jgs 82 }
47     }
48     /*
49     * $Log$
50 jgs 123 * Revision 1.2 2005/07/08 04:07:49 jgs
51     * Merge of development branch back to main trunk on 2005-07-08
52 jgs 82 *
53 jgs 123 * Revision 1.1.1.1.2.2 2005/06/30 01:53:55 gross
54     * a bug in coloring fixed
55     *
56     * Revision 1.1.1.1.2.1 2005/06/29 02:34:49 gross
57     * some changes towards 64 integers in finley
58     *
59     * Revision 1.1.1.1 2004/10/26 06:53:57 jgs
60     * initial import of project esys2
61     *
62 jgs 82 * Revision 1.1.1.1 2004/06/24 04:00:40 johng
63     * Initial version of eys using boost-python.
64     *
65     *
66     */

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26