/[escript]/branches/arrexp_2137_win_merge/escript/src/NullDomain.cpp
ViewVC logotype

Diff of /branches/arrexp_2137_win_merge/escript/src/NullDomain.cpp

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

trunk/escript/src/NullDomain.cpp revision 964 by gross, Tue Feb 13 05:10:26 2007 UTC branches/arrexp_2137_win_merge/escript/src/NullDomain.cpp revision 2213 by jfenwick, Wed Jan 14 00:23:39 2009 UTC
# Line 1  Line 1 
 /*  
  ************************************************************  
  *          Copyright 2006 by ACcESS MNRF                   *  
  *                                                          *  
  *              http://www.access.edu.au                    *  
  *       Primary Business: Queensland, Australia            *  
  *  Licensed under the Open Software License version 3.0    *  
  *     http://www.opensource.org/licenses/osl-3.0.php       *  
  *                                                          *  
  ************************************************************  
 */  
1    
2    /*******************************************************
3    *
4    * Copyright (c) 2003-2008 by University of Queensland
5    * Earth Systems Science Computational Center (ESSCC)
6    * http://www.uq.edu.au/esscc
7    *
8    * Primary Business: Queensland, Australia
9    * Licensed under the Open Software License version 3.0
10    * http://www.opensource.org/licenses/osl-3.0.php
11    *
12    *******************************************************/
13    
14    
15    #include "DomainException.h"
16  #include "NullDomain.h"  #include "NullDomain.h"
17    #include "Data.h"
18    
19  namespace escript {  namespace escript {
20    
21    namespace {
22    int defaultList[1]={0};     // an array to return in borrowListOfTagsInUse();
23    int NullDomainFS=1;     // Null domains only support 1 functionspace type.
24                // The choice of =1 as the value is arbitrary
25    }
26    
27    
28  NullDomain::NullDomain() {  NullDomain::NullDomain() {
29  }  }
30    
31  bool NullDomain::isValidFunctionSpaceType(int functionSpaceType) const  bool NullDomain::isValidFunctionSpaceType(int functionSpaceType) const
32  {  {
33    //     return (functionSpaceType==NullDomainFS);
   // allow anything  
   return true;  
34  }  }
35    
36  std::string NullDomain::getDescription() const  std::string NullDomain::getDescription() const
37  {  {
38    return "NullDomain";    return "NullDomain";
39  }  }
40    
41    std::string NullDomain::functionSpaceTypeAsString(int functionSpaceType) const
42    {
43        return "Default_FunctionSpace";
44    }
45    
46    void NullDomain::interpolateOnDomain(Data& target,const Data& source) const
47    {
48       if (source.getFunctionSpace().getDomain().get()!=this)  
49          throw DomainException("Error - Illegal domain of interpolant.");
50       if (target.getFunctionSpace().getDomain().get()!=this)
51          throw DomainException("Error - Illegal domain of interpolation target.");
52       target=source;
53    }
54    
55    bool NullDomain::probeInterpolationOnDomain(int functionSpaceType_source,int functionSpaceType_target) const
56    {
57       if ((functionSpaceType_source!=functionSpaceType_target) || (functionSpaceType_target!=NullDomainFS))
58       {
59        throw DomainException("Error - Illegal function type for NullDomain.");
60       }
61       return true;
62    }
63    
64    void NullDomain::interpolateACross(Data& target, const Data& source) const
65    {
66       throw DomainException("Error - interpolation to the NullDomain not supported.");
67    }
68    
69    bool NullDomain::probeInterpolationACross(int functionSpaceType_source,const AbstractDomain& targetDomain, int functionSpaceType_target) const
70    {
71       return false;
72    }
73    
74  int NullDomain::getContinuousFunctionCode() const  int NullDomain::getContinuousFunctionCode() const
75  {  {
76    //    return NullDomainFS;
   // return an arbitary value  
   return 1;  
77  }  }
78    
79  int NullDomain::getFunctionCode() const  int NullDomain::getFunctionCode() const
80  {  {
81    //    return NullDomainFS;
   // return an arbitary value  
   return 1;  
82  }  }
83    
84  int NullDomain::getFunctionOnBoundaryCode() const  int NullDomain::getFunctionOnBoundaryCode() const
85  {  {
86    //    return NullDomainFS;
   // return an arbitary value  
   return 1;  
87  }  }
88    
89  int NullDomain::getFunctionOnContactZeroCode() const  int NullDomain::getFunctionOnContactZeroCode() const
90  {  {
91    //    return NullDomainFS;
   // return an arbitary value  
   return 1;  
92  }  }
93    
94  int NullDomain::getFunctionOnContactOneCode() const  int NullDomain::getFunctionOnContactOneCode() const
95  {  {
96    //    return NullDomainFS;
   // return an arbitary value  
   return 1;  
97  }  }
98    
99  int NullDomain::getSolutionCode() const  int NullDomain::getSolutionCode() const
100  {  {
101    //    return NullDomainFS;
   // return an arbitary value  
   return 1;  
102  }  }
103    
104  int NullDomain::getReducedSolutionCode() const  int NullDomain::getReducedSolutionCode() const
105  {  {
106    //    return NullDomainFS;
   // return an arbitary value  
   return 1;  
107  }  }
108    
109  int NullDomain::getDiracDeltaFunctionCode() const  int NullDomain::getDiracDeltaFunctionCode() const
110  {  {
111    //    return NullDomainFS;
   // return an arbitary value  
   return 1;  
112  }  }
113    
114  std::pair<int,int> NullDomain::getDataShape(int functionSpaceCode) const  std::pair<int,int> NullDomain::getDataShape(int functionSpaceCode) const
# Line 130  bool NullDomain::operator!=(const Abstra Line 156  bool NullDomain::operator!=(const Abstra
156    return(!(*this==other));    return(!(*this==other));
157  }  }
158    
159    
160    
161    bool NullDomain::canTag(int functionSpaceCode) const
162    {
163      return true;
164    }
165    
166    int NullDomain::getNumberOfTagsInUse(int functionSpaceCode) const
167    {
168      return 1; // this is not arbitrary. It allows us to report that the default tag is in use
169    }
170    
171    int* NullDomain::borrowListOfTagsInUse(int functionSpaceCode) const
172    {
173      return defaultList;
174    }
175    
176    
177    
178  }  // end of namespace  }  // end of namespace

Legend:
Removed from v.964  
changed lines
  Added in v.2213

  ViewVC Help
Powered by ViewVC 1.1.26