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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2881 - (show annotations)
Thu Jan 28 02:03:15 2010 UTC (9 years, 6 months ago) by jfenwick
File MIME type: text/plain
File size: 3832 byte(s)
Don't panic.
Updating copyright stamps

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26