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

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

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

revision 3743 by caltinay, Fri Dec 9 05:03:08 2011 UTC revision 3744 by caltinay, Tue Dec 13 06:41:54 2011 UTC
# Line 69  string Rectangle::getDescription() const Line 69  string Rectangle::getDescription() const
69    
70  bool Rectangle::operator==(const AbstractDomain& other) const  bool Rectangle::operator==(const AbstractDomain& other) const
71  {  {
72      if (dynamic_cast<const Rectangle*>(&other))      const Rectangle* o=dynamic_cast<const Rectangle*>(&other);
73          return this==&other;      if (o) {
74            return (RipleyDomain::operator==(other) &&
75                    m_gNE0==o->m_gNE0 && m_gNE1==o->m_gNE1
76                    && m_l0==o->m_l0 && m_l1==o->m_l1
77                    && m_NX==o->m_NX && m_NY==o->m_NY);
78        }
79    
80      return false;      return false;
81  }  }
# Line 221  const int* Rectangle::borrowSampleRefere Line 226  const int* Rectangle::borrowSampleRefere
226  {  {
227      switch (fsType) {      switch (fsType) {
228          case Nodes:          case Nodes:
         case DegreesOfFreedom: //FIXME  
         case ReducedDegreesOfFreedom: //FIXME  
229              return &m_nodeId[0];              return &m_nodeId[0];
230            case DegreesOfFreedom:
231            case ReducedDegreesOfFreedom: //FIXME: reduced
232                return &m_dofId[0];
233          case Elements:          case Elements:
234          case ReducedElements:          case ReducedElements:
235              return &m_elementId[0];              return &m_elementId[0];
# Line 966  pair<double,double> Rectangle::getFirstC Line 972  pair<double,double> Rectangle::getFirstC
972  }  }
973    
974  //protected  //protected
975    dim_t Rectangle::getNumDOF() const
976    {
977        return m_nodeDistribution[m_mpiInfo->rank+1]
978            -m_nodeDistribution[m_mpiInfo->rank];
979    }
980    
981    //protected
982  dim_t Rectangle::getNumFaceElements() const  dim_t Rectangle::getNumFaceElements() const
983  {  {
984      const IndexVector faces = getNumFacesPerBoundary();      const IndexVector faces = getNumFacesPerBoundary();
# Line 1024  void Rectangle::populateSampleIds() Line 1037  void Rectangle::populateSampleIds()
1037      }      }
1038      m_nodeDistribution[m_mpiInfo->size]=getNumDataPointsGlobal();      m_nodeDistribution[m_mpiInfo->size]=getNumDataPointsGlobal();
1039    
1040        m_dofId.resize(getNumDOF());
1041      m_nodeId.resize(getNumNodes());      m_nodeId.resize(getNumNodes());
1042    
1043      // the bottom row and left column are not owned by this rank so the      // the bottom row and left column are not owned by this rank so the
# Line 1061  void Rectangle::populateSampleIds() Line 1075  void Rectangle::populateSampleIds()
1075  #pragma omp parallel for  #pragma omp parallel for
1076      for (dim_t i1=bottom; i1<m_N1; i1++) {      for (dim_t i1=bottom; i1<m_N1; i1++) {
1077          for (dim_t i0=left; i0<m_N0; i0++) {          for (dim_t i0=left; i0<m_N0; i0++) {
1078              m_nodeId[i0+i1*m_N0] = firstId+i0-left+(i1-bottom)*(m_N0-left);              const index_t idx=i0-left+(i1-bottom)*(m_N0-left);
1079                m_nodeId[i0+i1*m_N0] = firstId+idx;
1080                m_dofId[idx] = firstId+idx;
1081          }          }
1082      }      }
1083      m_nodeTags.assign(getNumNodes(), 0);      m_nodeTags.assign(getNumNodes(), 0);

Legend:
Removed from v.3743  
changed lines
  Added in v.3744

  ViewVC Help
Powered by ViewVC 1.1.26