/[escript]/trunk/dudley/src/Assemble_CopyElementData.cpp
ViewVC logotype

Diff of /trunk/dudley/src/Assemble_CopyElementData.cpp

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

revision 1312 by ksteube, Mon Sep 24 06:18:44 2007 UTC revision 2748 by gross, Tue Nov 17 07:32:59 2009 UTC
# Line 1  Line 1 
1    
 /* $Id$ */  
   
2  /*******************************************************  /*******************************************************
3   *  *
4   *           Copyright 2003-2007 by ACceSS MNRF  * Copyright (c) 2003-2009 by University of Queensland
5   *       Copyright 2007 by University of Queensland  * Earth Systems Science Computational Center (ESSCC)
6   *  * http://www.uq.edu.au/esscc
7   *                http://esscc.uq.edu.au  *
8   *        Primary Business: Queensland, Australia  * Primary Business: Queensland, Australia
9   *  Licensed under the Open Software License version 3.0  * Licensed under the Open Software License version 3.0
10   *     http://www.opensource.org/licenses/osl-3.0.php  * http://www.opensource.org/licenses/osl-3.0.php
11   *  *
12   *******************************************************/  *******************************************************/
13    
14    
15  /**************************************************************/  /**************************************************************/
16    
# Line 29  Line 28 
28    
29  void Finley_Assemble_CopyElementData(Finley_ElementFile* elements,escriptDataC* out,escriptDataC* in) {  void Finley_Assemble_CopyElementData(Finley_ElementFile* elements,escriptDataC* out,escriptDataC* in) {
30      dim_t n,q, numElements, numQuad;      dim_t n,q, numElements, numQuad;
31      double *in_array,*out_array;      __const double *in_array;
32        double *out_array;
33      dim_t numComps=getDataPointSize(out);      dim_t numComps=getDataPointSize(out);
34      size_t len_size;      size_t len_size;
35    
# Line 41  void Finley_Assemble_CopyElementData(Fin Line 41  void Finley_Assemble_CopyElementData(Fin
41    
42      numElements=elements->numElements;      numElements=elements->numElements;
43      if (Finley_Assemble_reducedIntegrationOrder(in)) {      if (Finley_Assemble_reducedIntegrationOrder(in)) {
44         numQuad=elements->ReferenceElementReducedOrder->numQuadNodes;         numQuad=elements->referenceElementSet->referenceElementReducedQuadrature->Parametrization->numQuadNodes;
45      } else {      } else {
46         numQuad=elements->ReferenceElement->numQuadNodes;         numQuad=elements->referenceElementSet->referenceElement->Parametrization->numQuadNodes;
47      }      }
48    
49      /* check out and in */      /* check out and in */
# Line 61  void Finley_Assemble_CopyElementData(Fin Line 61  void Finley_Assemble_CopyElementData(Fin
61    
62      if (Finley_noError()) {      if (Finley_noError()) {
63           if (isExpanded(in)) {           if (isExpanded(in)) {
64             void* buffer=allocSampleBuffer(in);
65               len_size=numComps*numQuad*sizeof(double);               len_size=numComps*numQuad*sizeof(double);
66               # pragma omp parallel for private(n) schedule(static)           requireWrite(out);
67               for (n=0;n<numElements;n++)           #pragma omp parallel private(n)
68                   memcpy(getSampleData(out,n),getSampleData(in,n), len_size);           {
69                   # pragma omp for schedule(static)
70                   for (n=0;n<numElements;n++)
71                     memcpy(getSampleDataRW(out,n),getSampleDataRO(in,n,buffer), len_size);
72             }
73             freeSampleBuffer(buffer);
74           } else {           } else {
75             void* buffer=allocSampleBuffer(in);
76               len_size=numComps*sizeof(double);               len_size=numComps*sizeof(double);
77               # pragma omp parallel for private(q,n,out_array,in_array) schedule(static)           requireWrite(out);
78               for (n=0;n<numElements;n++) {           #pragma omp parallel private(q,n,out_array,in_array)
79                   in_array=getSampleData(in,n);           {
80                   out_array=getSampleData(out,n);                 # pragma omp for schedule(static)
81                   for (n=0;n<numElements;n++) {
82                     in_array=getSampleDataRO(in,n,buffer);
83                     out_array=getSampleDataRW(out,n);
84                   for (q=0;q<numQuad;q++) memcpy(out_array+q*numComps,in_array,len_size);                   for (q=0;q<numQuad;q++) memcpy(out_array+q*numComps,in_array,len_size);
85               }                 }
86             }
87             freeSampleBuffer(buffer);
88           }           }
89      }      }
90      return;      return;

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

  ViewVC Help
Powered by ViewVC 1.1.26