/[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 1388 by trankine, Fri Jan 11 07:45:58 2008 UTC revision 1716 by gross, Thu Aug 21 05:03:49 2008 UTC
# Line 27  namespace escript { Line 27  namespace escript {
27    
28  //  //
29  // Create a null domain for use with any default-constructed function space  // Create a null domain for use with any default-constructed function space
30  ESCRIPT_DLL_API NullDomain FunctionSpace::m_nullDomainValue;  NullDomain const FunctionSpace::nullDomainValue;
31    
32  FunctionSpace::FunctionSpace():  FunctionSpace::FunctionSpace():
33    m_domain(static_cast<AbstractDomain*>(&m_nullDomainValue)),    m_domain(static_cast<const AbstractDomain*>(&nullDomainValue)),
34    m_functionSpaceType(m_nullDomainValue.getFunctionCode())    m_functionSpaceType(nullDomainValue.getFunctionCode())
35  {  {
36  }  }
37    
# Line 73  FunctionSpace::toString() const Line 73  FunctionSpace::toString() const
73    std::stringstream temp;    std::stringstream temp;
74    temp << m_domain->functionSpaceTypeAsString(m_functionSpaceType)    temp << m_domain->functionSpaceTypeAsString(m_functionSpaceType)
75         << " on " << m_domain->getDescription();         << " on " << m_domain->getDescription();
76    
77    return temp.str();    return temp.str();
78  }  }
79    
80    
81    #ifdef DEBUG_PY_STRINGS
82    PyObject *
83    FunctionSpace::toPyString() const
84    {
85      boost::python::to_python_value<const std::string &> cvtr;
86      std::stringstream temp;
87    
88      temp << m_domain->functionSpaceTypeAsString(m_functionSpaceType)
89           << " on " << m_domain->getDescription();
90    
91      return cvtr(temp.str());
92    }
93    #endif
94    
95    
96  int  int
97  FunctionSpace::getTagFromSampleNo(int sampleNo) const  FunctionSpace::getTagFromSampleNo(int sampleNo) const
98  {  {
# Line 122  FunctionSpace& Line 139  FunctionSpace&
139  FunctionSpace::operator=(const FunctionSpace& other)  FunctionSpace::operator=(const FunctionSpace& other)
140  {  {
141    // explicitly defined assignment operator to emphasise pointer copy    // explicitly defined assignment operator to emphasise pointer copy
   m_nullDomainValue=other.m_nullDomainValue;  
142    m_functionSpaceType=other.m_functionSpaceType;    m_functionSpaceType=other.m_functionSpaceType;
143    m_domain=other.m_domain;    m_domain=other.m_domain;
144    return *this;    return *this;
# Line 177  FunctionSpace::setTags(const int newTag, Line 193  FunctionSpace::setTags(const int newTag,
193     }     }
194  }  }
195    
196    int
197    FunctionSpace::getNumberOfTagsInUse() const
198    {
199       return  m_domain->getNumberOfTagsInUse(m_functionSpaceType);
200    }
201    
202    int*
203    FunctionSpace::borrowListOfTagsInUse() const
204    {
205       return  m_domain->borrowListOfTagsInUse(m_functionSpaceType);
206    }
207    
208    
209    
210    boost::python::list
211    FunctionSpace::getListOfTags() const
212    {
213      boost::python::list taglist;
214      int i;
215      int* tags=borrowListOfTagsInUse();
216      for (i=0;i<getNumberOfTagsInUse();++i) taglist.append(tags[i]);
217      return taglist;
218    }
219    
220  }  // end of namespace  }  // end of namespace

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

  ViewVC Help
Powered by ViewVC 1.1.26