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

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

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

revision 1800 by ksteube, Thu Sep 18 05:28:20 2008 UTC revision 1811 by ksteube, Thu Sep 25 23:11:13 2008 UTC
# Line 1  Line 1 
1    
 /* $Id$ */  
   
2  /*******************************************************  /*******************************************************
3   *  *
4   *           Copyright 2003-2007 by ACceSS MNRF  * Copyright (c) 2003-2008 by University of Queensland
5   *       Copyright 2007 by University of Queensland  * Earth Systems Science Computational Center (ESSCC)
6   *  * http://www.uq.edu.au/esscc
7   *                http://esscc.uq.edu.au  *
8   *        Primary Business: Queensland, Australia  * Primary Business: Queensland, Australia
9   *  Licensed under the Open Software License version 3.0  * Licensed under the Open Software License version 3.0
10   *     http://www.opensource.org/licenses/osl-3.0.php  * http://www.opensource.org/licenses/osl-3.0.php
11   *  *
12   *******************************************************/  *******************************************************/
13    
14    
15  #include "DataTagged.h"  #include "DataTagged.h"
16  #include "esysUtils/esys_malloc.h"  #include "esysUtils/esys_malloc.h"
# Line 72  DataTagged::DataTagged(const FunctionSpa Line 71  DataTagged::DataTagged(const FunctionSpa
71    // not unit_tested tested yet    // not unit_tested tested yet
72    // It is not explicitly unit tested yet, but it is called from DataFactory    // It is not explicitly unit tested yet, but it is called from DataFactory
73    
74      if (!what.canTag())
75      {
76        throw DataException("Programming error - DataTag created with a non-taggable FunctionSpace.");
77      }
78    // copy the data    // copy the data
79    m_data=data;    m_data=data;
80    
# Line 100  DataTagged::DataTagged(const FunctionSpa Line 103  DataTagged::DataTagged(const FunctionSpa
103  {  {
104    // alternative constructor    // alternative constructor
105    
106      if (!what.canTag())
107      {
108        throw DataException("Programming error - DataTag created with a non-taggable FunctionSpace.");
109      }
110    
111    // copy the data    // copy the data
112    m_data=data;    m_data=data;
113    
# Line 149  DataTagged::DataTagged(const DataConstan Line 157  DataTagged::DataTagged(const DataConstan
157  {  {
158    // copy constructor    // copy constructor
159    
160      if (!other.getFunctionSpace().canTag())
161      {
162        throw DataException("Programming error - DataTag created with a non-taggable FunctionSpace.");
163      }
164    
165    // fill the default value with the constant value item from "other"    // fill the default value with the constant value item from "other"
166  //   const DataArrayView& value=other.getPointDataView();  //   const DataArrayView& value=other.getPointDataView();
167    int len = other.getNoValues();    int len = other.getNoValues();
# Line 177  DataTagged::DataTagged(const FunctionSpa Line 190  DataTagged::DataTagged(const FunctionSpa
190    }    }
191    
192    
193      if (!what.canTag())
194      {
195        throw DataException("Programming error - DataTag created with a non-taggable FunctionSpace.");
196      }
197    
198    if (tagsource!=0)    if (tagsource!=0)
199    {    {
200      int numtags=tagsource->getTagLookup().size();      int numtags=tagsource->getTagLookup().size();
# Line 590  DataTagged::toString() const Line 608  DataTagged::toString() const
608  //   DataArrayView tempView(getPointDataView().getData(), getPointDataView().getShape());  //   DataArrayView tempView(getPointDataView().getData(), getPointDataView().getShape());
609    for (i=m_offsetLookup.begin();i!=m_offsetLookup.end();++i) {    for (i=m_offsetLookup.begin();i!=m_offsetLookup.end();++i) {
610      temp << "Tag(" << i->first << ")" << endl;      temp << "Tag(" << i->first << ")" << endl;
611      temp << pointToString(m_data,getShape(),i->second,empty);      temp << pointToString(m_data,getShape(),i->second,empty) << endl;
612  //     tempView.setOffset(i->second);  //     tempView.setOffset(i->second);
613  //     temp << tempView.toString() << endl;  //     temp << tempView.toString() << endl;
614    }    }

Legend:
Removed from v.1800  
changed lines
  Added in v.1811

  ViewVC Help
Powered by ViewVC 1.1.26