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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2089 - (show annotations)
Mon Nov 24 06:07:29 2008 UTC (10 years, 10 months ago) by jfenwick
File size: 2846 byte(s)
Resolve mantis issue 216.

Removed the asAbstractContinuousDomain(X) member which did not take cast 
failure into account.
Rewrote the few places where it was used.



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 "FunctionSpaceFactory.h"
16 #include "AbstractContinuousDomain.h"
17 #include "FunctionSpaceException.h"
18
19 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)
29 {
30 CTS_CHECK
31 return FunctionSpace(domain.getPtr(),temp->getContinuousFunctionCode());
32 }
33
34 FunctionSpace reducedContinuousFunction(const AbstractDomain& domain)
35 {
36 CTS_CHECK
37 return FunctionSpace(domain.getPtr(),temp->getReducedContinuousFunctionCode());
38 }
39
40 FunctionSpace function(const AbstractDomain& domain)
41 {
42 CTS_CHECK
43 return FunctionSpace(domain.getPtr(),temp->getFunctionCode());
44 }
45
46 FunctionSpace reducedFunction(const AbstractDomain& domain)
47 {
48 CTS_CHECK
49 return FunctionSpace(domain.getPtr(),temp->getReducedFunctionCode());
50 }
51
52 FunctionSpace functionOnBoundary(const AbstractDomain& domain)
53 {
54 CTS_CHECK
55 return FunctionSpace(domain.getPtr(),temp->getFunctionOnBoundaryCode());
56 }
57
58 FunctionSpace reducedFunctionOnBoundary(const AbstractDomain& domain)
59 {
60 CTS_CHECK
61 return FunctionSpace(domain.getPtr(),temp->getReducedFunctionOnBoundaryCode());
62 }
63
64 FunctionSpace functionOnContactZero(const AbstractDomain& domain)
65 {
66 CTS_CHECK
67 return FunctionSpace(domain.getPtr(),temp->getFunctionOnContactZeroCode());
68 }
69
70 FunctionSpace reducedFunctionOnContactZero(const AbstractDomain& domain)
71 {
72 CTS_CHECK
73 return FunctionSpace(domain.getPtr(),temp->getReducedFunctionOnContactZeroCode());
74 }
75
76 FunctionSpace functionOnContactOne(const AbstractDomain& domain)
77 {
78 CTS_CHECK
79 return FunctionSpace(domain.getPtr(),temp->getFunctionOnContactOneCode());
80 }
81
82 FunctionSpace reducedFunctionOnContactOne(const AbstractDomain& domain)
83 {
84 CTS_CHECK
85 return FunctionSpace(domain.getPtr(),temp->getReducedFunctionOnContactOneCode());
86 }
87
88 FunctionSpace solution(const AbstractDomain& domain)
89 {
90 CTS_CHECK
91 return FunctionSpace(domain.getPtr(),temp->getSolutionCode());
92 }
93
94 FunctionSpace reducedSolution(const AbstractDomain& domain)
95 {
96 CTS_CHECK
97 return FunctionSpace(domain.getPtr(),temp->getReducedSolutionCode());
98 }
99
100 FunctionSpace diracDeltaFunction(const AbstractDomain& domain)
101 {
102 CTS_CHECK
103 return FunctionSpace(domain.getPtr(),temp->getDiracDeltaFunctionCode());
104 }
105
106 } // end of namespace

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26