/[escript]/trunk-mpi-branch/finley/src/NodeFile_copyTable.c
ViewVC logotype

Contents of /trunk-mpi-branch/finley/src/NodeFile_copyTable.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1223 - (show annotations)
Fri Aug 3 02:40:39 2007 UTC (12 years, 10 months ago) by gross
File MIME type: text/plain
File size: 1998 byte(s)
first attemt towards an improved MPI version.  

1 /*
2 ************************************************************
3 * Copyright 2006 by ACcESS MNRF *
4 * *
5 * http://www.access.edu.au *
6 * Primary Business: Queensland, Australia *
7 * Licensed under the Open Software License version 3.0 *
8 * http://www.opensource.org/licenses/osl-3.0.php *
9 * *
10 ************************************************************
11 */
12
13 /**************************************************************/
14
15 /* Finley: Mesh: NodeFile */
16
17 /* copies node file in into node file out starting from offset */
18 /* the nodes offset to in->numNodes+offset-1 in out will be overwritten */
19
20
21 /**************************************************************/
22
23 /* Author: gross@access.edu.au */
24 /* Version: $Id$ */
25
26 /**************************************************************/
27
28 #include "NodeFile.h"
29
30 /**************************************************************/
31
32 void Finley_NodeFile_copyTable(int offset,Finley_NodeFile* out,int idOffset,int dofOffset,Finley_NodeFile* in) {
33 int i,n;
34 /* check dimension and file size */
35 if (out->numDim!=in->numDim) {
36 Finley_setError(TYPE_ERROR,"Finley_NodeFile_copyTable: dimensions of node files don't match");
37 }
38 if (out->numNodes<in->numNodes+offset) {
39 Finley_setError(MEMORY_ERROR,"Finley_NodeFile_copyTable: node table is too small.");
40 }
41 if (Finley_noError()) {
42 #pragma omp parallel for private(i,n) schedule(static)
43 for(n=0;n<in->numNodes;n++) {
44 out->Id[offset+n]=in->Id[n]+idOffset;
45 out->Tag[offset+n]=in->Tag[n];
46 out->globalDegreesOfFreedom[offset+n]=in->globalDegreesOfFreedom[n]+dofOffset;
47 for(i=0;i<out->numDim;i++) out->Coordinates[INDEX2(i,offset+n,out->numDim)]=in->Coordinates[INDEX2(i,n,in->numDim)];
48 }
49 }
50 }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26