/[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 964 by gross, Tue Feb 13 05:10:26 2007 UTC revision 1312 by ksteube, Mon Sep 24 06:18:44 2007 UTC
# Line 1  Line 1 
1  /*  
2   ************************************************************  /* $Id$ */
3   *          Copyright 2006 by ACcESS MNRF                   *  
4   *                                                          *  /*******************************************************
5   *              http://www.access.edu.au                    *   *
6   *       Primary Business: Queensland, Australia            *   *           Copyright 2003-2007 by ACceSS MNRF
7   *  Licensed under the Open Software License version 3.0    *   *       Copyright 2007 by University of Queensland
8   *     http://www.opensource.org/licenses/osl-3.0.php       *   *
9   *                                                          *   *                http://esscc.uq.edu.au
10   ************************************************************   *        Primary Business: Queensland, Australia
11  */   *  Licensed under the Open Software License version 3.0
12     *     http://www.opensource.org/licenses/osl-3.0.php
13     *
14     *******************************************************/
15    
16  /**************************************************************/  /**************************************************************/
17    
# Line 19  Line 22 
22                                                                                                                                                                                                                                                                                                        
23  /**************************************************************/  /**************************************************************/
24    
 /*  Author: gross@access.edu.au */  
 /*  Version: $Id$ */  
   
 /**************************************************************/  
   
25  #include "ElementFile.h"  #include "ElementFile.h"
26    
27  /****************************************************************************/  /****************************************************************************/
# Line 31  Line 29 
29    
30  void Finley_ElementFile_copyTable(index_t offset,Finley_ElementFile* out,index_t node_offset, index_t idOffset,Finley_ElementFile* in) {  void Finley_ElementFile_copyTable(index_t offset,Finley_ElementFile* out,index_t node_offset, index_t idOffset,Finley_ElementFile* in) {
31      dim_t i,n;      dim_t i,n;
32      dim_t NN=out->ReferenceElement->Type->numNodes;      dim_t NN=out->numNodes;
33      if (in==NULL) return;      if (in==NULL) return;
     /* check dimension and file size */  
34      if (out->ReferenceElement->Type->TypeId!=in->ReferenceElement->Type->TypeId) {      if (out->ReferenceElement->Type->TypeId!=in->ReferenceElement->Type->TypeId) {
35          Finley_setError(TYPE_ERROR,"Finley_ElementFile_copyTable: dimensions of element files don't match");          Finley_setError(TYPE_ERROR,"Finley_ElementFile_copyTable: dimensions of element files don't match");
36      }      }
37      if (out->numElements<in->numElements+offset) {      if (out->MPIInfo->comm!=in->MPIInfo->comm) {
38          Finley_setError(MEMORY_ERROR,"Finley_ElementFile_copyTable: element table is too small.");          Finley_setError(TYPE_ERROR,"Finley_ElementFile_copyTable: MPI communicators of element files don't match");
39      }      }
40      if (Finley_noError()) {      if (Finley_noError()) {
41         #pragma omp parallel for private(i,n) schedule(static)         #pragma omp parallel for private(i,n) schedule(static)
42         for(n=0;n<in->numElements;n++) {         for(n=0;n<in->numElements;n++) {
43  #ifdef PASO_MPI            out->Owner[offset+n]=out->Owner[n];
           out->Dom[offset+n]=in->Dom[n]+idOffset;  
 #endif    
44            out->Id[offset+n]=in->Id[n]+idOffset;            out->Id[offset+n]=in->Id[n]+idOffset;
45            out->Tag[offset+n]=in->Tag[n];            out->Tag[offset+n]=in->Tag[n];
           out->Color[offset+n]=in->Color[n]+out->maxColor+1;  
46            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;
47         }         }
        out->minColor=MIN(out->minColor,in->minColor+out->maxColor+1);  
        out->maxColor=MAX(out->maxColor,in->maxColor+out->maxColor+1);  
        out->isPrepared=MIN(out->isPrepared,in->isPrepared);  
48      }      }
49  }  }

Legend:
Removed from v.964  
changed lines
  Added in v.1312

  ViewVC Help
Powered by ViewVC 1.1.26