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

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

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

revision 3756 by caltinay, Fri Jan 6 02:35:19 2012 UTC revision 3757 by caltinay, Fri Jan 6 04:48:27 2012 UTC
# Line 258  const int* Brick::borrowSampleReferenceI Line 258  const int* Brick::borrowSampleReferenceI
258          case Nodes:          case Nodes:
259          case ReducedNodes: //FIXME: reduced          case ReducedNodes: //FIXME: reduced
260              return &m_nodeId[0];              return &m_nodeId[0];
261          case DegreesOfFreedom: //FIXME          case DegreesOfFreedom:
262          case ReducedDegreesOfFreedom: //FIXME          case ReducedDegreesOfFreedom: //FIXME: reduced
263              return &m_dofId[0];              return &m_dofId[0];
264          case Elements:          case Elements:
265          case ReducedElements:          case ReducedElements:
266              return &m_elementId[0];              return &m_elementId[0];
267            case FaceElements:
268          case ReducedFaceElements:          case ReducedFaceElements:
269              return &m_faceId[0];              return &m_faceId[0];
270          default:          default:
# Line 276  const int* Brick::borrowSampleReferenceI Line 277  const int* Brick::borrowSampleReferenceI
277      throw RipleyException(msg.str());      throw RipleyException(msg.str());
278  }  }
279    
280  bool Brick::ownSample(int fsCode, index_t id) const  bool Brick::ownSample(int fsType, index_t id) const
281  {  {
282  #ifdef ESYS_MPI  #ifdef ESYS_MPI
283      if (fsCode == Nodes) {      switch (fsType) {
284          return (m_dofMap[id] < getNumDOF());          case Nodes:
285      } else {          case ReducedNodes: //FIXME: reduced
286          stringstream msg;              return (m_dofMap[id] < getNumDOF());
287          msg << "ownSample() not implemented for "          case DegreesOfFreedom:
288              << functionSpaceTypeAsString(fsCode);          case ReducedDegreesOfFreedom:
289          throw RipleyException(msg.str());              return true;
290            case Elements:
291            case ReducedElements:
292                {
293                    // check ownership of element's _last_ node
294                    const index_t x=id%m_NE0 + 1;
295                    const index_t y=id%(m_NE0*m_NE1)/m_NE0 + 1;
296                    const index_t z=id/(m_NE0*m_NE1) + 1;
297                    return (m_dofMap[x + m_N0*y +m_N0*m_N1*z] < getNumDOF());
298                }
299            case FaceElements:
300            case ReducedFaceElements:
301            default:
302                break;
303      }      }
304    
305        stringstream msg;
306        msg << "ownSample() not implemented for "
307            << functionSpaceTypeAsString(fsType);
308        throw RipleyException(msg.str());
309  #else  #else
310      return true;      return true;
311  #endif  #endif

Legend:
Removed from v.3756  
changed lines
  Added in v.3757

  ViewVC Help
Powered by ViewVC 1.1.26