/[escript]/trunk/escript/src/AbstractTransportProblem.h
ViewVC logotype

Contents of /trunk/escript/src/AbstractTransportProblem.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3259 - (show annotations)
Mon Oct 11 01:48:14 2010 UTC (9 years ago) by jfenwick
File MIME type: text/plain
File size: 3715 byte(s)
Merging dudley and scons updates from branches

1
2 /*******************************************************
3 *
4 * Copyright (c) 2003-2010 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 #if !defined escript_AbstractTransportProblem_H
16 #define escript_AbstractTransportProblem_H
17 #include "system_dep.h"
18
19 #include "FunctionSpace.h"
20 #include "TransportProblemException.h"
21 #include <boost/python/object.hpp>
22
23
24
25 namespace escript {
26
27 //
28 // Forward declaration
29 class Data;
30
31 /**
32 \brief
33 Give a short description of what AbstractTransportProblem does.
34
35 Description:
36 Give a detailed description of AbstractTransportProblem
37
38 Template Parameters:
39 For templates describe any conditions that the parameters used in the
40 template must satisfy
41 */
42 class AbstractTransportProblem {
43
44 public:
45
46 /**
47 \brief
48 Default constructor for AbstractTransportProblem
49
50 Description:
51 Default constructor for AbstractTransportProblem
52
53 Preconditions:
54 Describe any preconditions
55
56 Throws:
57 Describe any exceptions thrown
58 */
59 ESCRIPT_DLL_API
60 AbstractTransportProblem();
61
62 ESCRIPT_DLL_API
63 AbstractTransportProblem(const bool useBackwardEuler,
64 const int blocksize,
65 const FunctionSpace& functionspace);
66
67 /**
68 \brief
69 Destructor.
70 */
71 ESCRIPT_DLL_API
72 virtual ~AbstractTransportProblem();
73
74 ESCRIPT_DLL_API
75 int isEmpty() const;
76
77 /**
78 \brief
79 returns the column function space
80 */
81 ESCRIPT_DLL_API
82 inline FunctionSpace getFunctionSpace() const
83 {
84 if (isEmpty())
85 throw TransportProblemException("Error - Transport Problem is empty.");
86 return m_functionspace;
87 }
88
89 /**
90 \brief
91 returns the block size
92 */
93 ESCRIPT_DLL_API
94 inline int getBlockSize() const
95 {
96 if (isEmpty())
97 throw TransportProblemException("Error - Transport Problem is empty.");
98 return m_blocksize;
99 }
100
101 /**
102 \brief
103 returns the solution u for a time step dt>0 with initial value u0 at time t=0
104 */
105 ESCRIPT_DLL_API
106 Data solve(Data& u0, Data& source, const double dt, boost::python::object& options) const;
107
108
109 /**
110 \brief resets the transport operator typically as they have been updated.
111 */
112 ESCRIPT_DLL_API
113 virtual void resetTransport() const;
114
115 /**
116 \brief
117 inserts constraint u_{,t}=r where q>0 into the problem using a weighting factor
118 */
119 ESCRIPT_DLL_API
120 void insertConstraint(Data& source, Data& q, Data& r, const double factor) const;
121 /*
122 * \brief returns a safe time step size.
123 */
124 ESCRIPT_DLL_API
125 virtual double getSafeTimeStepSize() const;
126 /*
127 * \brief returns the value for unlimited time step size.
128 */
129 ESCRIPT_DLL_API
130 virtual double getUnlimitedTimeStepSize() const;
131
132
133 protected:
134
135 private:
136
137 /**
138 \brief
139 sets solution out by time step dt.
140 */
141 ESCRIPT_DLL_API
142 virtual void setToSolution(Data& out, Data& u0, Data& source, const double dt, boost::python::object& options) const;
143
144 /**
145 \brief
146 copy constraint u_{,t}=r where q>0 into the problem
147 it can be assumed that q and r are not empty and have
148 appropriate shape and function space.
149 */
150 ESCRIPT_DLL_API
151 virtual void copyConstraint(Data& source, Data& q, Data& r, const double factor) const;
152
153 int m_empty;
154 int m_blocksize;
155 bool m_useBackwardEuler;
156 FunctionSpace m_functionspace;
157
158 };
159
160
161 typedef boost::shared_ptr<AbstractTransportProblem> ATP_ptr;
162
163 } // end of namespace
164 #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26