/[escript]/trunk/escript/src/FunctionSpaceFactory.cpp
ViewVC logotype

Diff of /trunk/escript/src/FunctionSpaceFactory.cpp

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

revision 1312 by ksteube, Mon Sep 24 06:18:44 2007 UTC revision 2548 by jfenwick, Mon Jul 20 06:20:06 2009 UTC
# Line 1  Line 1 
1    
 /* $Id$ */  
   
2  /*******************************************************  /*******************************************************
3   *  *
4   *           Copyright 2003-2007 by ACceSS MNRF  * Copyright (c) 2003-2009 by University of Queensland
5   *       Copyright 2007 by University of Queensland  * Earth Systems Science Computational Center (ESSCC)
6   *  * http://www.uq.edu.au/esscc
7   *                http://esscc.uq.edu.au  *
8   *        Primary Business: Queensland, Australia  * Primary Business: Queensland, Australia
9   *  Licensed under the Open Software License version 3.0  * Licensed under the Open Software License version 3.0
10   *     http://www.opensource.org/licenses/osl-3.0.php  * http://www.opensource.org/licenses/osl-3.0.php
11   *  *
12   *******************************************************/  *******************************************************/
13    
14    
15  #include "FunctionSpaceFactory.h"  #include "FunctionSpaceFactory.h"
16  #include "AbstractContinuousDomain.h"  #include "AbstractContinuousDomain.h"
17    #include "FunctionSpaceException.h"
18    
19  namespace escript {  namespace escript {
20    
21    #define CTS_CHECK const AbstractContinuousDomain* temp=dynamic_cast<const AbstractContinuousDomain*>(&domain);\
22    if (temp==0)\
23    {\
24       throw FunctionSpaceException("This method will only make FunctionSpaces for ContinuousDomains.");\
25    }
26    
27    
28  FunctionSpace continuousFunction(const AbstractDomain& domain)  FunctionSpace continuousFunction(const AbstractDomain& domain)
29  {  {
30    const AbstractContinuousDomain& temp=AbstractContinuousDomain::asAbstractContinuousDomain(domain);    CTS_CHECK
31    return FunctionSpace(domain,temp.getContinuousFunctionCode());    return FunctionSpace(domain.getPtr(),temp->getContinuousFunctionCode());
32  }  }
33    
34  FunctionSpace reducedContinuousFunction(const AbstractDomain& domain)  FunctionSpace reducedContinuousFunction(const AbstractDomain& domain)
35  {  {
36    const AbstractContinuousDomain& temp=AbstractContinuousDomain::asAbstractContinuousDomain(domain);    CTS_CHECK
37    return FunctionSpace(domain,temp.getReducedContinuousFunctionCode());    return FunctionSpace(domain.getPtr(),temp->getReducedContinuousFunctionCode());
38  }  }
39    
40  FunctionSpace function(const AbstractDomain& domain)  FunctionSpace function(const AbstractDomain& domain)
41  {  {
42    const AbstractContinuousDomain& temp=AbstractContinuousDomain::asAbstractContinuousDomain(domain);    CTS_CHECK
43    return FunctionSpace(domain,temp.getFunctionCode());    return FunctionSpace(domain.getPtr(),temp->getFunctionCode());
44  }  }
45    
46  FunctionSpace reducedFunction(const AbstractDomain& domain)  FunctionSpace reducedFunction(const AbstractDomain& domain)
47  {  {
48    const AbstractContinuousDomain& temp=AbstractContinuousDomain::asAbstractContinuousDomain(domain);    CTS_CHECK
49    return FunctionSpace(domain,temp.getReducedFunctionCode());    return FunctionSpace(domain.getPtr(),temp->getReducedFunctionCode());
50  }  }
51    
52  FunctionSpace functionOnBoundary(const AbstractDomain& domain)  FunctionSpace functionOnBoundary(const AbstractDomain& domain)
53  {  {
54    const AbstractContinuousDomain& temp=AbstractContinuousDomain::asAbstractContinuousDomain(domain);    CTS_CHECK
55    return FunctionSpace(domain,temp.getFunctionOnBoundaryCode());    return FunctionSpace(domain.getPtr(),temp->getFunctionOnBoundaryCode());
56  }  }
57    
58  FunctionSpace reducedFunctionOnBoundary(const AbstractDomain& domain)  FunctionSpace reducedFunctionOnBoundary(const AbstractDomain& domain)
59  {  {
60    const AbstractContinuousDomain& temp=AbstractContinuousDomain::asAbstractContinuousDomain(domain);    CTS_CHECK
61    return FunctionSpace(domain,temp.getReducedFunctionOnBoundaryCode());    return FunctionSpace(domain.getPtr(),temp->getReducedFunctionOnBoundaryCode());
62  }  }
63    
64  FunctionSpace functionOnContactZero(const AbstractDomain& domain)  FunctionSpace functionOnContactZero(const AbstractDomain& domain)
65  {  {
66    const AbstractContinuousDomain& temp=AbstractContinuousDomain::asAbstractContinuousDomain(domain);    CTS_CHECK
67    return FunctionSpace(domain,temp.getFunctionOnContactZeroCode());    return FunctionSpace(domain.getPtr(),temp->getFunctionOnContactZeroCode());
68  }  }
69    
70  FunctionSpace reducedFunctionOnContactZero(const AbstractDomain& domain)  FunctionSpace reducedFunctionOnContactZero(const AbstractDomain& domain)
71  {  {
72    const AbstractContinuousDomain& temp=AbstractContinuousDomain::asAbstractContinuousDomain(domain);    CTS_CHECK
73    return FunctionSpace(domain,temp.getReducedFunctionOnContactZeroCode());    return FunctionSpace(domain.getPtr(),temp->getReducedFunctionOnContactZeroCode());
74  }  }
75    
76  FunctionSpace functionOnContactOne(const AbstractDomain& domain)  FunctionSpace functionOnContactOne(const AbstractDomain& domain)
77  {  {
78    const AbstractContinuousDomain& temp=AbstractContinuousDomain::asAbstractContinuousDomain(domain);    CTS_CHECK
79    return FunctionSpace(domain,temp.getFunctionOnContactOneCode());    return FunctionSpace(domain.getPtr(),temp->getFunctionOnContactOneCode());
80  }  }
81    
82  FunctionSpace reducedFunctionOnContactOne(const AbstractDomain& domain)  FunctionSpace reducedFunctionOnContactOne(const AbstractDomain& domain)
83  {  {
84    const AbstractContinuousDomain& temp=AbstractContinuousDomain::asAbstractContinuousDomain(domain);    CTS_CHECK
85    return FunctionSpace(domain,temp.getReducedFunctionOnContactOneCode());    return FunctionSpace(domain.getPtr(),temp->getReducedFunctionOnContactOneCode());
86  }  }
87    
88  FunctionSpace solution(const AbstractDomain& domain)  FunctionSpace solution(const AbstractDomain& domain)
89  {  {
90    const AbstractContinuousDomain& temp=AbstractContinuousDomain::asAbstractContinuousDomain(domain);    CTS_CHECK
91    return FunctionSpace(domain,temp.getSolutionCode());    return FunctionSpace(domain.getPtr(),temp->getSolutionCode());
92  }  }
93    
94  FunctionSpace reducedSolution(const AbstractDomain& domain)  FunctionSpace reducedSolution(const AbstractDomain& domain)
95  {  {
96    const AbstractContinuousDomain& temp=AbstractContinuousDomain::asAbstractContinuousDomain(domain);    CTS_CHECK
97    return FunctionSpace(domain,temp.getReducedSolutionCode());    return FunctionSpace(domain.getPtr(),temp->getReducedSolutionCode());
98  }  }
99    
100  FunctionSpace diracDeltaFunction(const AbstractDomain& domain)  FunctionSpace diracDeltaFunction(const AbstractDomain& domain)
101  {  {
102    const AbstractContinuousDomain& temp=AbstractContinuousDomain::asAbstractContinuousDomain(domain);    CTS_CHECK
103    return FunctionSpace(domain,temp.getDiracDeltaFunctionCode());    return FunctionSpace(domain.getPtr(),temp->getDiracDeltaFunctionCode());
104  }  }
105    
106  }  // end of namespace  }  // end of namespace

Legend:
Removed from v.1312  
changed lines
  Added in v.2548

  ViewVC Help
Powered by ViewVC 1.1.26