/[escript]/branches/trilinos_from_5897/dudley/src/NodeFile_copyTable.cpp
ViewVC logotype

Diff of /branches/trilinos_from_5897/dudley/src/NodeFile_copyTable.cpp

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

revision 6008 by caltinay, Fri Feb 5 03:37:49 2016 UTC revision 6009 by caltinay, Wed Mar 2 04:13:26 2016 UTC
# Line 14  Line 14 
14  *  *
15  *****************************************************************************/  *****************************************************************************/
16    
17  /************************************************************************************/  /****************************************************************************/
18    
19  /*   Dudley: Mesh: NodeFile */  /*   Dudley: Mesh: NodeFile */
20    
21  /* copies node file in into node file out starting from offset          */  /* copies node file in into node file out starting from offset          */
22  /* the nodes offset to in->numNodes+offset-1 in out will be overwritten */  /* the nodes offset to in->numNodes+offset-1 in out will be overwritten */
23    
24  /************************************************************************************/  /****************************************************************************/
   
 #define ESNEEDPYTHON  
 #include "esysUtils/first.h"  
25    
26  #include "NodeFile.h"  #include "NodeFile.h"
27    
28  /************************************************************************************/  namespace dudley {
29    
30  void Dudley_NodeFile_copyTable(int offset, Dudley_NodeFile * out, int idOffset, int dofOffset, Dudley_NodeFile * in)  void Dudley_NodeFile_copyTable(int offset, Dudley_NodeFile * out, int idOffset, int dofOffset, Dudley_NodeFile * in)
31  {  {
     int i, n;  
32      /* check dimension and file size */      /* check dimension and file size */
33      if (out->numDim != in->numDim)      if (out->numDim != in->numDim)
34      {          throw DudleyException("Dudley_NodeFile_copyTable: dimensions of node files don't match");
35      Dudley_setError(TYPE_ERROR, "Dudley_NodeFile_copyTable: dimensions of node files don't match");  
     }  
36      if (out->numNodes < in->numNodes + offset)      if (out->numNodes < in->numNodes + offset)
37      {          throw DudleyException("Dudley_NodeFile_copyTable: node table is too small.");
38      Dudley_setError(MEMORY_ERROR, "Dudley_NodeFile_copyTable: node table is too small.");  
39      }      int i, n;
     if (Dudley_noError())  
     {  
40  #pragma omp parallel for private(i,n) schedule(static)  #pragma omp parallel for private(i,n) schedule(static)
41      for (n = 0; n < in->numNodes; n++)      for (n = 0; n < in->numNodes; n++)
42      {      {
43          out->Id[offset + n] = in->Id[n] + idOffset;          out->Id[offset + n] = in->Id[n] + idOffset;
44          out->Tag[offset + n] = in->Tag[n];          out->Tag[offset + n] = in->Tag[n];
45          out->globalDegreesOfFreedom[offset + n] = in->globalDegreesOfFreedom[n] + dofOffset;          out->globalDegreesOfFreedom[offset + n] = in->globalDegreesOfFreedom[n] + dofOffset;
46          for (i = 0; i < out->numDim; i++)          for (i = 0; i < out->numDim; i++)
47          out->Coordinates[INDEX2(i, offset + n, out->numDim)] = in->Coordinates[INDEX2(i, n, in->numDim)];              out->Coordinates[INDEX2(i, offset + n, out->numDim)] = in->Coordinates[INDEX2(i, n, in->numDim)];
     }  
48      }      }
49  }  }
50    
51    } // namespace dudley
52    

Legend:
Removed from v.6008  
changed lines
  Added in v.6009

  ViewVC Help
Powered by ViewVC 1.1.26