/[escript]/branches/arrexp_2137_win/escript/src/DataTagged.cpp
ViewVC logotype

Diff of /branches/arrexp_2137_win/escript/src/DataTagged.cpp

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

revision 123 by jgs, Fri Jul 8 04:08:13 2005 UTC revision 149 by jgs, Thu Sep 1 03:31:39 2005 UTC
# Line 191  DataTagged::setSlice(const DataAbstract* Line 191  DataTagged::setSlice(const DataAbstract*
191    }    }
192  }  }
193    
194    int
195    DataTagged::getTagNumber(int dpno)
196    {
197      //
198      // Get the number of samples and data-points per sample
199      int numSamples = getNumSamples();
200      int numDataPointsPerSample = getNumDPPSample();
201      int numDataPoints = numSamples * numDataPointsPerSample;
202    
203      if (numDataPointsPerSample==0) {
204        throw DataException("DataTagged::getTagNumber error: no data-points associated with this object.");
205      }
206    
207      if (dpno<0 || dpno>numDataPoints) {
208        throw DataException("DataTagged::getTagNumber error: invalid data-point number supplied.");
209      }
210    
211      //
212      // Determine the sample number which corresponds to this data-point number
213      int sampleNo = dpno / numDataPointsPerSample;
214    
215      //
216      // Determine the tag number which corresponds to this sample number
217      int tagNo = getFunctionSpace().getTagFromSampleNo(sampleNo);
218    
219      //
220      // return the tag number
221      return(tagNo);
222    }
223    
224  void  void
225  DataTagged::setTaggedValue(int tagKey,  DataTagged::setTaggedValue(int tagKey,
226                             const DataArrayView& value)                             const DataArrayView& value)

Legend:
Removed from v.123  
changed lines
  Added in v.149

  ViewVC Help
Powered by ViewVC 1.1.26