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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3911 - (show annotations)
Thu Jun 14 01:01:03 2012 UTC (7 years, 5 months ago) by jfenwick
File MIME type: text/plain
File size: 3565 byte(s)
Copyright changes
1
2 /*******************************************************
3 *
4 * Copyright (c) 2003-2012 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 int blocksize,
64 const FunctionSpace& functionspace);
65
66 /**
67 \brief
68 Destructor.
69 */
70 ESCRIPT_DLL_API
71 virtual ~AbstractTransportProblem();
72
73 ESCRIPT_DLL_API
74 int isEmpty() const;
75
76 /**
77 \brief
78 returns the column function space
79 */
80 ESCRIPT_DLL_API
81 inline FunctionSpace getFunctionSpace() const
82 {
83 if (isEmpty())
84 throw TransportProblemException("Error - Transport Problem is empty.");
85 return m_functionspace;
86 }
87
88 /**
89 \brief
90 returns the block size
91 */
92 ESCRIPT_DLL_API
93 inline int getBlockSize() const
94 {
95 if (isEmpty())
96 throw TransportProblemException("Error - Transport Problem is empty.");
97 return m_blocksize;
98 }
99
100 /**
101 \brief
102 returns the solution u for a time step dt>0 with initial value u0 at time t=0
103 */
104 ESCRIPT_DLL_API
105 Data solve(Data& u0, Data& source, const double dt, boost::python::object& options) const;
106
107
108 /**
109 \brief resets the transport operator typically as they have been updated.
110 */
111 ESCRIPT_DLL_API
112 virtual void resetTransport() const;
113
114 /**
115 \brief
116 inserts constraint u_{,t}=r where q>0 into the problem
117 */
118 ESCRIPT_DLL_API
119 void insertConstraint(Data& source, Data& q, Data& r) const;
120 /*
121 * \brief returns a safe time step size.
122 */
123 ESCRIPT_DLL_API
124 virtual double getSafeTimeStepSize() const;
125 /*
126 * \brief returns the value for unlimited time step size.
127 */
128 ESCRIPT_DLL_API
129 virtual double getUnlimitedTimeStepSize() const;
130
131
132 protected:
133
134 private:
135
136 /**
137 \brief
138 sets solution out by time step dt.
139 */
140 ESCRIPT_DLL_API
141 virtual void setToSolution(Data& out, Data& u0, Data& source, const double dt, boost::python::object& options) const;
142
143 /**
144 \brief
145 copy constraint u_{,t}=r where q>0 into the problem
146 it can be assumed that q and r are not empty and have
147 appropriate shape and function space.
148 */
149 ESCRIPT_DLL_API
150 virtual void copyConstraint(Data& source, Data& q, Data& r) const;
151
152 int m_empty;
153 int m_blocksize;
154 FunctionSpace m_functionspace;
155
156 };
157
158
159 typedef boost::shared_ptr<AbstractTransportProblem> ATP_ptr;
160
161 } // end of namespace
162 #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26