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

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

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

revision 6008 by caltinay, Mon Feb 22 06:59:27 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 the array newX into self->coordinates */  /* copies the array newX into self->coordinates */
22    
23  /************************************************************************************/  /****************************************************************************/
   
 #define ESNEEDPYTHON  
 #include "esysUtils/first.h"  
24    
25  #include "NodeFile.h"  #include "NodeFile.h"
26  #include "Util.h"  #include "Util.h"
27    
28  /************************************************************************************/  namespace dudley {
29    
30  void Dudley_NodeFile_setCoordinates(Dudley_NodeFile* self, const escript::Data* newX)  void Dudley_NodeFile_setCoordinates(Dudley_NodeFile* self, const escript::Data* newX)
31  {  {
32      if (getDataPointSize(newX) != self->numDim)      if (newX->getDataPointSize() != self->numDim) {
     {  
33          std::stringstream ss;          std::stringstream ss;
34          ss << "Dudley_NodeFile_setCoordinates: number of dimensions of new "          ss << "Dudley_NodeFile_setCoordinates: number of dimensions of new "
35              "coordinates has to be " << self->numDim;              "coordinates has to be " << self->numDim;
36          const std::string errorMsg(ss.str());          const std::string errorMsg(ss.str());
37          Dudley_setError(VALUE_ERROR, errorMsg.c_str());          throw DudleyException(errorMsg);
38      } else if (!numSamplesEqual(newX, 1, self->numNodes)) {      } else if (newX->getNumDataPointsPerSample() != 1 ||
39                newX->getNumSamples() != self->numNodes) {
40          std::stringstream ss;          std::stringstream ss;
41          ss << "Dudley_NodeFile_setCoordinates: number of given nodes must be "          ss << "Dudley_NodeFile_setCoordinates: number of given nodes must be "
42              << self->numNodes;              << self->numNodes;
43          const std::string errorMsg(ss.str());          const std::string errorMsg(ss.str());
44          Dudley_setError(VALUE_ERROR, errorMsg.c_str());          throw DudleyException(errorMsg);
45      } else {      } else {
46          const size_t numDim_size = self->numDim * sizeof(double);          const size_t numDim_size = self->numDim * sizeof(double);
47          Dudley_increaseStatus(self);          Dudley_increaseStatus(self);
# Line 56  void Dudley_NodeFile_setCoordinates(Dudl Line 53  void Dudley_NodeFile_setCoordinates(Dudl
53      }      }
54  }  }
55    
56    } // namespace dudley
57    

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

  ViewVC Help
Powered by ViewVC 1.1.26