/[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 615 by elspeth, Wed Mar 22 02:12:00 2006 UTC revision 1388 by trankine, Fri Jan 11 07:45:58 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  NullDomain FunctionSpace::m_nullDomainValue;  ESCRIPT_DLL_API NullDomain FunctionSpace::m_nullDomainValue;
31    
32  FunctionSpace::FunctionSpace():  FunctionSpace::FunctionSpace():
33    m_domain(static_cast<AbstractDomain*>(&m_nullDomainValue)),    m_domain(static_cast<AbstractDomain*>(&m_nullDomainValue)),
# Line 69  std::string Line 71  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();    return temp.str();
77  }  }
# Line 111  FunctionSpace::getTagFromDataPointNo(int Line 112  FunctionSpace::getTagFromDataPointNo(int
112    return(tagNo);    return(tagNo);
113  }  }
114    
115  int  int*
116  FunctionSpace::getReferenceNoFromSampleNo(int sampleNo) const  FunctionSpace::borrowSampleReferenceIDs() const
117  {  {
118    return m_domain->getReferenceNoFromSampleNo(m_functionSpaceType,sampleNo);    return m_domain->borrowSampleReferenceIDs(m_functionSpaceType);
119  }  }
120    
121  FunctionSpace&  FunctionSpace&
# Line 144  FunctionSpace::getX() const Line 145  FunctionSpace::getX() const
145  {  {
146    Data out=escript::Vector(0,*this,true);    Data out=escript::Vector(0,*this,true);
147    getDomain().setToX(out);    getDomain().setToX(out);
148      out.setProtection();
149    return out;    return out;
150  }  }
151    
# Line 152  FunctionSpace::getNormal() const Line 154  FunctionSpace::getNormal() const
154  {  {
155    Data out=escript::Vector(0,*this,true);    Data out=escript::Vector(0,*this,true);
156    getDomain().setToNormal(out);    getDomain().setToNormal(out);
157      out.setProtection();
158    return out;    return out;
159  }  }
160    
# Line 160  FunctionSpace::getSize() const Line 163  FunctionSpace::getSize() const
163  {  {
164    Data out=escript::Scalar(0,*this,true);    Data out=escript::Scalar(0,*this,true);
165    getDomain().setToSize(out);    getDomain().setToSize(out);
166      out.setProtection();
167    return out;    return out;
168  }  }
169    
170    void
171    FunctionSpace::setTags(const int newTag, const escript::Data& mask) const
172    {
173       if (mask.getFunctionSpace()== *this) {
174              m_domain->setTags(m_functionSpaceType,newTag,mask);
175       } else {
176              throw FunctionSpaceException("illegal function space of mask.");
177       }
178    }
179    
180  }  // end of namespace  }  // end of namespace

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

  ViewVC Help
Powered by ViewVC 1.1.26