/[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 480 by jgs, Wed Feb 1 05:15:12 2006 UTC revision 1137 by gross, Thu May 10 08:11:31 2007 UTC
# Line 1  Line 1 
1  /* $Id$ */  /* $Id$ */
2  /*  /*
3   ******************************************************************************   ************************************************************
4   *                                                                            *   *          Copyright 2006 by ACcESS MNRF                   *
5   *       COPYRIGHT  ACcESS 2004 -  All Rights Reserved                        *   *                                                          *
6   *                                                                            *   *              http://www.access.edu.au                    *
7   * This software is the property of ACcESS. No part of this code              *   *       Primary Business: Queensland, Australia            *
8   * may be copied in any form or by any means without the expressed written    *   *  Licensed under the Open Software License version 3.0    *
9   * consent of ACcESS.  Copying, use or modification of this software          *   *     http://www.opensource.org/licenses/osl-3.0.php       *
10   * by any unauthorised person is illegal unless that person has a software    *   *                                                          *
11   * license agreement with ACcESS.                                             *   ************************************************************
  *                                                                            *  
  ******************************************************************************  
12  */  */
13    
14  #include "FunctionSpace.h"  #include "FunctionSpace.h"
# Line 27  namespace escript { Line 25  namespace escript {
25    
26  //  //
27  // Create a null domain for use with any default-constructed function space  // Create a null domain for use with any default-constructed function space
28  NullDomain FunctionSpace::m_nullDomainValue;  ESCRIPT_DLL_API NullDomain FunctionSpace::m_nullDomainValue;
29    
30  FunctionSpace::FunctionSpace():  FunctionSpace::FunctionSpace():
31    m_domain(static_cast<AbstractDomain*>(&m_nullDomainValue)),    m_domain(static_cast<AbstractDomain*>(&m_nullDomainValue)),
# Line 71  std::string Line 69  std::string
69  FunctionSpace::toString() const  FunctionSpace::toString() const
70  {  {
71    std::stringstream temp;    std::stringstream temp;
72    temp << "Function space type: "    temp << m_domain->functionSpaceTypeAsString(m_functionSpaceType) << " on " << m_domain->getDescription();
        << m_domain->functionSpaceTypeAsString(m_functionSpaceType)  
        << " on " << m_domain->getDescription();  
73    return temp.str();    return temp.str();
74  }  }
75    
76    const
77    boost::python::str
78    FunctionSpace::str() const
79    {
80      return boost::python::str(toString().c_str());
81    }
82    
83    
84  int  int
85  FunctionSpace::getTagFromSampleNo(int sampleNo) const  FunctionSpace::getTagFromSampleNo(int sampleNo) const
86  {  {
# Line 113  FunctionSpace::getTagFromDataPointNo(int Line 117  FunctionSpace::getTagFromDataPointNo(int
117    return(tagNo);    return(tagNo);
118  }  }
119    
120  int  int*
121  FunctionSpace::getReferenceNoFromSampleNo(int sampleNo) const  FunctionSpace::borrowSampleReferenceIDs() const
122  {  {
123    return m_domain->getReferenceNoFromSampleNo(m_functionSpaceType,sampleNo);    return m_domain->borrowSampleReferenceIDs(m_functionSpaceType);
124  }  }
125    
126  FunctionSpace&  FunctionSpace&
# Line 146  FunctionSpace::getX() const Line 150  FunctionSpace::getX() const
150  {  {
151    Data out=escript::Vector(0,*this,true);    Data out=escript::Vector(0,*this,true);
152    getDomain().setToX(out);    getDomain().setToX(out);
153      out.setProtection();
154    return out;    return out;
155  }  }
156    
# Line 154  FunctionSpace::getNormal() const Line 159  FunctionSpace::getNormal() const
159  {  {
160    Data out=escript::Vector(0,*this,true);    Data out=escript::Vector(0,*this,true);
161    getDomain().setToNormal(out);    getDomain().setToNormal(out);
162      out.setProtection();
163    return out;    return out;
164  }  }
165    
# Line 162  FunctionSpace::getSize() const Line 168  FunctionSpace::getSize() const
168  {  {
169    Data out=escript::Scalar(0,*this,true);    Data out=escript::Scalar(0,*this,true);
170    getDomain().setToSize(out);    getDomain().setToSize(out);
171      out.setProtection();
172    return out;    return out;
173  }  }
174    
175    void
176    FunctionSpace::setTags(const int newTag, const escript::Data& mask) const
177    {
178       if (mask.getFunctionSpace()== *this) {
179              m_domain->setTags(m_functionSpaceType,newTag,mask);
180       } else {
181              throw FunctionSpaceException("illegal function space of mask.");
182       }
183    }
184    
185  }  // end of namespace  }  // end of namespace

Legend:
Removed from v.480  
changed lines
  Added in v.1137

  ViewVC Help
Powered by ViewVC 1.1.26