/[escript]/branches/windows_from_1383_trunk/escript/src/FunctionSpace.cpp
ViewVC logotype

Diff of /branches/windows_from_1383_trunk/escript/src/FunctionSpace.cpp

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

revision 1418 by trankine, Fri Jan 11 07:40:29 2008 UTC revision 1419 by trankine, Tue Feb 26 07:29:41 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 67  FunctionSpace::getDomain() const Line 67  FunctionSpace::getDomain() const
67    return *m_domain;    return *m_domain;
68  }  }
69    
70  std::string  const std::string &
71  FunctionSpace::toString() const  FunctionSpace::toString() const
72  {  {
73      if( type_str.empty() )
74      {
75        std::stringstream temp;
76        temp << m_domain->functionSpaceTypeAsString(m_functionSpaceType)
77             << " on " << m_domain->getDescription();
78    
79        type_str = temp.str();
80      }
81      return type_str;
82    }
83    
84    
85    #ifdef DEBUG
86    PyObject *
87    FunctionSpace::toPyString() const
88    {
89    std::stringstream temp;    std::stringstream temp;
90    
91    temp << m_domain->functionSpaceTypeAsString(m_functionSpaceType)    temp << m_domain->functionSpaceTypeAsString(m_functionSpaceType)
92         << " on " << m_domain->getDescription();         << " on " << m_domain->getDescription();
93    return temp.str();  
94      boost::python::to_python_value<const std::string &> cvtr;
95    
96      return cvtr(temp.str());
97  }  }
98    #endif
99    
100  int  int
101  FunctionSpace::getTagFromSampleNo(int sampleNo) const  FunctionSpace::getTagFromSampleNo(int sampleNo) const
# Line 122  FunctionSpace& Line 143  FunctionSpace&
143  FunctionSpace::operator=(const FunctionSpace& other)  FunctionSpace::operator=(const FunctionSpace& other)
144  {  {
145    // explicitly defined assignment operator to emphasise pointer copy    // explicitly defined assignment operator to emphasise pointer copy
   m_nullDomainValue=other.m_nullDomainValue;  
146    m_functionSpaceType=other.m_functionSpaceType;    m_functionSpaceType=other.m_functionSpaceType;
147    m_domain=other.m_domain;    m_domain=other.m_domain;
148    return *this;    return *this;

Legend:
Removed from v.1418  
changed lines
  Added in v.1419

  ViewVC Help
Powered by ViewVC 1.1.26