/[escript]/trunk/escript/src/FunctionSpace.cpp
ViewVC logotype

Diff of /trunk/escript/src/FunctionSpace.cpp

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

revision 1716 by gross, Thu Aug 21 05:03:49 2008 UTC revision 1718 by gross, Thu Aug 21 05:50:11 2008 UTC
# Line 129  FunctionSpace::getTagFromDataPointNo(int Line 129  FunctionSpace::getTagFromDataPointNo(int
129    return(tagNo);    return(tagNo);
130  }  }
131    
132    int FunctionSpace::getReferenceIDFromDataPointNo(int dataPointNo) const
133    {
134         //
135         // Get the number of samples and data-points per sample
136         int numSamples = getNumSamples();
137         int numDataPointsPerSample = getNumDPPSample();
138         int*referenceIDs= borrowSampleReferenceIDs();
139         int numDataPoints = numSamples * numDataPointsPerSample;
140    
141         if (numDataPointsPerSample==0) {
142            throw DataException("FunctionSpace::getReferenceIDFromDataPointNo error: no data-points associated with this object.");
143         }
144         if (dataPointNo<0 || dataPointNo>numDataPoints) {
145            throw DataException("FunctionSpace::getReferenceIDFromDataPointNo error: invalid data-point number supplied.");
146         }
147         int sampleNo = dataPointNo / numDataPointsPerSample;
148         return referenceIDs[sampleNo];
149    }
150    
151  int*  int*
152  FunctionSpace::borrowSampleReferenceIDs() const  FunctionSpace::borrowSampleReferenceIDs() const
153  {  {
# Line 207  FunctionSpace::borrowListOfTagsInUse() c Line 226  FunctionSpace::borrowListOfTagsInUse() c
226    
227    
228    
229    
230  boost::python::list  boost::python::list
231  FunctionSpace::getListOfTags() const  FunctionSpace::getListOfTags() const
232  {  {

Legend:
Removed from v.1716  
changed lines
  Added in v.1718

  ViewVC Help
Powered by ViewVC 1.1.26