/[escript]/trunk/ripley/src/Brick.cpp
ViewVC logotype

Diff of /trunk/ripley/src/Brick.cpp

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

revision 5114 by caltinay, Thu Aug 14 05:15:31 2014 UTC revision 5115 by caltinay, Thu Aug 14 05:36:58 2014 UTC
# Line 16  Line 16 
16    
17  #include <ripley/Brick.h>  #include <ripley/Brick.h>
18  #include <ripley/DefaultAssembler3D.h>  #include <ripley/DefaultAssembler3D.h>
 #include <ripley/WaveAssembler3D.h>  
19  #include <ripley/LameAssembler3D.h>  #include <ripley/LameAssembler3D.h>
20    #include <ripley/WaveAssembler3D.h>
21  #include <ripley/blocktools.h>  #include <ripley/blocktools.h>
22  #include <ripley/domainhelpers.h>  #include <ripley/domainhelpers.h>
23  #include <esysUtils/esysFileWriter.h>  #include <esysUtils/esysFileWriter.h>
# Line 61  int indexOfMax(int a, int b, int c) { Line 61  int indexOfMax(int a, int b, int c) {
61    
62  Brick::Brick(int n0, int n1, int n2, double x0, double y0, double z0,  Brick::Brick(int n0, int n1, int n2, double x0, double y0, double z0,
63               double x1, double y1, double z1, int d0, int d1, int d2,               double x1, double y1, double z1, int d0, int d1, int d2,
64               const std::vector<double>& points, const std::vector<int>& tags,               const vector<double>& points, const vector<int>& tags,
65               const simap_t& tagnamestonums,               const simap_t& tagnamestonums,
66               escript::SubWorld_ptr w) :               escript::SubWorld_ptr w) :
67      RipleyDomain(3, w)      RipleyDomain(3, w)
68  {  {
69      if (static_cast<long>(n0 + 1) * static_cast<long>(n1 + 1)      if (static_cast<long>(n0 + 1) * static_cast<long>(n1 + 1)
70              * static_cast<long>(n2 + 1) > std::numeric_limits<int>::max())              * static_cast<long>(n2 + 1) > numeric_limits<int>::max())
71          throw RipleyException("The number of elements has overflowed, this "          throw RipleyException("The number of elements has overflowed, this "
72                  "limit may be raised in future releases.");                  "limit may be raised in future releases.");
73    
# Line 83  Brick::Brick(int n0, int n1, int n2, dou Line 83  Brick::Brick(int n0, int n1, int n2, dou
83      }      }
84      bool warn=false;      bool warn=false;
85    
86      std::vector<int> factors;      vector<int> factors;
87      int ranks = m_mpiInfo->size;      int ranks = m_mpiInfo->size;
88      int epr[3] = {n0,n1,n2};      int epr[3] = {n0,n1,n2};
89      int d[3] = {d0,d1,d2};      int d[3] = {d0,d1,d2};
# Line 620  void Brick::readBinaryGridZippedImpl(esc Line 620  void Brick::readBinaryGridZippedImpl(esc
620      const int numComp = out.getDataPointSize();      const int numComp = out.getDataPointSize();
621      int filesize = f.tellg();      int filesize = f.tellg();
622      f.seekg(0, ios::beg);      f.seekg(0, ios::beg);
623      std::vector<char> compressed(filesize);      vector<char> compressed(filesize);
624      f.read((char*)&compressed[0], filesize);      f.read((char*)&compressed[0], filesize);
625      f.close();      f.close();
626      std::vector<char> decompressed = unzip(compressed);      vector<char> decompressed = unzip(compressed);
627      filesize = decompressed.size();      filesize = decompressed.size();
628      const int reqsize = params.numValues[0]*params.numValues[1]*params.numValues[2]*numComp*sizeof(ValueType);      const int reqsize = params.numValues[0]*params.numValues[1]*params.numValues[2]*numComp*sizeof(ValueType);
629      if (filesize < reqsize) {      if (filesize < reqsize) {
# Line 2163  void Brick::populateSampleIds() Line 2163  void Brick::populateSampleIds()
2163          m_nodeId.resize(getNumNodes());          m_nodeId.resize(getNumNodes());
2164          m_dofId.resize(numDOF);          m_dofId.resize(numDOF);
2165          m_elementId.resize(getNumElements());          m_elementId.resize(getNumElements());
2166      } catch (const std::length_error& le) {      } catch (const length_error& le) {
2167          throw RipleyException("The system does not have sufficient memory for a domain of this size.");          throw RipleyException("The system does not have sufficient memory for a domain of this size.");
2168      }      }
2169            
# Line 2642  void Brick::createPattern() Line 2642  void Brick::createPattern()
2642    
2643  #pragma omp parallel for  #pragma omp parallel for
2644      for (int i = 0; i < numShared; i++) {      for (int i = 0; i < numShared; i++) {
2645          std::sort(rowIndices[i].begin(), rowIndices[i].end());          sort(rowIndices[i].begin(), rowIndices[i].end());
2646      }      }
2647    
2648    

Legend:
Removed from v.5114  
changed lines
  Added in v.5115

  ViewVC Help
Powered by ViewVC 1.1.26