/[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 783 by gross, Tue Jul 18 01:32:50 2006 UTC revision 1426 by trankine, Wed Feb 27 06:12:15 2008 UTC
# Line 1  Line 1 
1    
2  /* $Id$ */  /* $Id$ */
3  /*  
4   ************************************************************  /*******************************************************
5   *          Copyright 2006 by ACcESS MNRF                   *   *
6   *                                                          *   *           Copyright 2003-2007 by ACceSS MNRF
7   *              http://www.access.edu.au                    *   *       Copyright 2007 by University of Queensland
8   *       Primary Business: Queensland, Australia            *   *
9   *  Licensed under the Open Software License version 3.0    *   *                http://esscc.uq.edu.au
10   *     http://www.opensource.org/licenses/osl-3.0.php       *   *        Primary Business: Queensland, Australia
11   *                                                          *   *  Licensed under the Open Software License version 3.0
12   ************************************************************   *     http://www.opensource.org/licenses/osl-3.0.php
13  */   *
14     *******************************************************/
15    
16  #include "FunctionSpace.h"  #include "FunctionSpace.h"
17  #include "FunctionSpaceException.h"  #include "FunctionSpaceException.h"
# Line 25  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 65  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    std::stringstream temp;    std::stringstream temp;
74    temp << "Function space type: "    temp << m_domain->functionSpaceTypeAsString(m_functionSpaceType)
        << m_domain->functionSpaceTypeAsString(m_functionSpaceType)  
75         << " on " << m_domain->getDescription();         << " on " << m_domain->getDescription();
76    return temp.str();  
77      type_str = temp.str();
78    
79      return type_str;
80  }  }
81    
82    
83    #ifdef DEBUG_PY_STRINGS
84    PyObject *
85    FunctionSpace::toPyString() const
86    {
87      boost::python::to_python_value<const std::string &> cvtr;
88      std::stringstream temp;
89    
90      temp << m_domain->functionSpaceTypeAsString(m_functionSpaceType)
91           << " on " << m_domain->getDescription();
92    
93      //toString();
94      type_str = temp.str();
95    
96      return cvtr(type_str);
97    }
98    #endif
99    
100    
101  int  int
102  FunctionSpace::getTagFromSampleNo(int sampleNo) const  FunctionSpace::getTagFromSampleNo(int sampleNo) const
103  {  {
# Line 111  FunctionSpace::getTagFromDataPointNo(int Line 134  FunctionSpace::getTagFromDataPointNo(int
134    return(tagNo);    return(tagNo);
135  }  }
136    
137  int  int*
138  FunctionSpace::getReferenceNoFromSampleNo(int sampleNo) const  FunctionSpace::borrowSampleReferenceIDs() const
139  {  {
140    return m_domain->getReferenceNoFromSampleNo(m_functionSpaceType,sampleNo);    return m_domain->borrowSampleReferenceIDs(m_functionSpaceType);
141  }  }
142    
143  FunctionSpace&  FunctionSpace&
144  FunctionSpace::operator=(const FunctionSpace& other)  FunctionSpace::operator=(const FunctionSpace& other)
145  {  {
146    // explicitly defined assignment operator to emphasise pointer copy    // explicitly defined assignment operator to emphasise pointer copy
   m_nullDomainValue=other.m_nullDomainValue;  
147    m_functionSpaceType=other.m_functionSpaceType;    m_functionSpaceType=other.m_functionSpaceType;
148    m_domain=other.m_domain;    m_domain=other.m_domain;
149    return *this;    return *this;

Legend:
Removed from v.783  
changed lines
  Added in v.1426

  ViewVC Help
Powered by ViewVC 1.1.26