1 |
|
2 |
/* $Id$ */ |
3 |
|
4 |
/******************************************************* |
5 |
* |
6 |
* Copyright 2007 by University of Queensland |
7 |
* |
8 |
* http://esscc.uq.edu.au |
9 |
* Primary Business: Queensland, Australia |
10 |
* Licensed under the Open Software License version 3.0 |
11 |
* http://www.opensource.org/licenses/osl-3.0.php |
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 |
|
22 |
#include <boost/python/dict.hpp> |
23 |
|
24 |
// |
25 |
// Forward declaration |
26 |
class Data; |
27 |
|
28 |
namespace escript { |
29 |
|
30 |
/** |
31 |
\brief |
32 |
Give a short description of what AbstractTransportProblem does. |
33 |
|
34 |
Description: |
35 |
Give a detailed description of AbstractTransportProblem |
36 |
|
37 |
Template Parameters: |
38 |
For templates describe any conditions that the parameters used in the |
39 |
template must satisfy |
40 |
*/ |
41 |
class AbstractTransportProblem { |
42 |
|
43 |
public: |
44 |
|
45 |
/** |
46 |
\brief |
47 |
Default constructor for AbstractTransportProblem |
48 |
|
49 |
Description: |
50 |
Default constructor for AbstractTransportProblem |
51 |
|
52 |
Preconditions: |
53 |
Describe any preconditions |
54 |
|
55 |
Throws: |
56 |
Describe any exceptions thrown |
57 |
*/ |
58 |
ESCRIPT_DLL_API |
59 |
AbstractTransportProblem(); |
60 |
|
61 |
ESCRIPT_DLL_API |
62 |
AbstractTransportProblem(const double theta, |
63 |
const double dt_max, |
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 |
104 |
*/ |
105 |
ESCRIPT_DLL_API |
106 |
Data solve(Data& source, const double dt, const boost::python::dict& options) const; |
107 |
|
108 |
/** |
109 |
\brief |
110 |
sets the value for u at time t=0. |
111 |
*/ |
112 |
ESCRIPT_DLL_API |
113 |
void setInitialValue(Data& u) const; |
114 |
/** |
115 |
\brief resets the transport operator typically as they have been updated. |
116 |
*/ |
117 |
ESCRIPT_DLL_API |
118 |
virtual void resetTransport() const; |
119 |
|
120 |
protected: |
121 |
|
122 |
private: |
123 |
|
124 |
/** |
125 |
\brief |
126 |
sets solution out by time step dt. |
127 |
*/ |
128 |
ESCRIPT_DLL_API |
129 |
virtual void setToSolution(Data& out,Data& source,const double dt, const boost::python::dict& options) const; |
130 |
|
131 |
/** |
132 |
\brief |
133 |
copies the initial value into the problem |
134 |
*/ |
135 |
ESCRIPT_DLL_API |
136 |
virtual void copyInitialValue(Data& u) const; |
137 |
|
138 |
int m_empty; |
139 |
int m_blocksize; |
140 |
double m_theta; |
141 |
double m_dt_max; |
142 |
FunctionSpace m_functionspace; |
143 |
|
144 |
}; |
145 |
|
146 |
|
147 |
} // end of namespace |
148 |
#endif |