/[escript]/branches/diaplayground/ripley/src/Brick.cpp
ViewVC logotype

Diff of /branches/diaplayground/ripley/src/Brick.cpp

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

revision 4851 by sshaw, Wed Apr 9 03:30:36 2014 UTC revision 4861 by sshaw, Thu Apr 10 05:17:47 2014 UTC
# Line 14  Line 14 
14  *  *
15  *****************************************************************************/  *****************************************************************************/
16    
17    #include <limits>
18    
19  #include <ripley/Brick.h>  #include <ripley/Brick.h>
20  #include <paso/SystemMatrix.h>  #include <paso/SystemMatrix.h>
21  #include <esysUtils/esysFileWriter.h>  #include <esysUtils/esysFileWriter.h>
# Line 63  Brick::Brick(int n0, int n1, int n2, dou Line 65  Brick::Brick(int n0, int n1, int n2, dou
65               const simap_t& tagnamestonums) :               const simap_t& tagnamestonums) :
66      RipleyDomain(3)      RipleyDomain(3)
67  {  {
68        if (static_cast<long>(n0 + 1) * static_cast<long>(n1 + 1)
69                * static_cast<long>(n2 + 1) > std::numeric_limits<int>::max())
70            throw RipleyException("The number of elements has overflowed, this "
71                    "limit may be raised in future releases.");
72    
73      if (n0 <= 0 || n1 <= 0 || n2 <= 0)      if (n0 <= 0 || n1 <= 0 || n2 <= 0)
74          throw RipleyException("Number of elements in each spatial dimension "          throw RipleyException("Number of elements in each spatial dimension "
75                  "must be positive");                  "must be positive");
# Line 2088  void Brick::populateSampleIds() Line 2095  void Brick::populateSampleIds()
2095          m_nodeDistribution[k]=k*numDOF;          m_nodeDistribution[k]=k*numDOF;
2096      }      }
2097      m_nodeDistribution[m_mpiInfo->size]=getNumDataPointsGlobal();      m_nodeDistribution[m_mpiInfo->size]=getNumDataPointsGlobal();
2098      m_nodeId.resize(getNumNodes());      
2099      m_dofId.resize(numDOF);      try {
2100      m_elementId.resize(getNumElements());          m_nodeId.resize(getNumNodes());
2101            m_dofId.resize(numDOF);
2102            m_elementId.resize(getNumElements());
2103        } catch (const std::length_error& le) {
2104            throw RipleyException("The system does not have sufficient memory for a domain of this size.");
2105        }
2106        
2107      // populate face element counts      // populate face element counts
2108      //left      //left
2109      if (m_offset[0]==0)      if (m_offset[0]==0)

Legend:
Removed from v.4851  
changed lines
  Added in v.4861

  ViewVC Help
Powered by ViewVC 1.1.26