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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4154 - (show annotations)
Tue Jan 22 09:30:23 2013 UTC (6 years, 8 months ago) by jfenwick
File MIME type: text/plain
File size: 3684 byte(s)
Round 1 of copyright fixes
1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2013 by University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Open Software License version 3.0
9 * http://www.opensource.org/licenses/osl-3.0.php
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development since 2012 by School of Earth Sciences
13 *
14 *****************************************************************************/
15
16
17 #if !defined escript_AbstractTransportProblem_H
18 #define escript_AbstractTransportProblem_H
19 #include "system_dep.h"
20
21 #include "FunctionSpace.h"
22 #include "TransportProblemException.h"
23 #include <boost/python/object.hpp>
24
25
26
27 namespace escript {
28
29 //
30 // Forward declaration
31 class Data;
32
33 /**
34 \brief
35 Give a short description of what AbstractTransportProblem does.
36
37 Description:
38 Give a detailed description of AbstractTransportProblem
39
40 Template Parameters:
41 For templates describe any conditions that the parameters used in the
42 template must satisfy
43 */
44 class AbstractTransportProblem {
45
46 public:
47
48 /**
49 \brief
50 Default constructor for AbstractTransportProblem
51
52 Description:
53 Default constructor for AbstractTransportProblem
54
55 Preconditions:
56 Describe any preconditions
57
58 Throws:
59 Describe any exceptions thrown
60 */
61 ESCRIPT_DLL_API
62 AbstractTransportProblem();
63
64 ESCRIPT_DLL_API
65 AbstractTransportProblem(const int blocksize,
66 const FunctionSpace& functionspace);
67
68 /**
69 \brief
70 Destructor.
71 */
72 ESCRIPT_DLL_API
73 virtual ~AbstractTransportProblem();
74
75 ESCRIPT_DLL_API
76 int isEmpty() const;
77
78 /**
79 \brief
80 returns the column function space
81 */
82 ESCRIPT_DLL_API
83 inline FunctionSpace getFunctionSpace() const
84 {
85 if (isEmpty())
86 throw TransportProblemException("Error - Transport Problem is empty.");
87 return m_functionspace;
88 }
89
90 /**
91 \brief
92 returns the block size
93 */
94 ESCRIPT_DLL_API
95 inline int getBlockSize() const
96 {
97 if (isEmpty())
98 throw TransportProblemException("Error - Transport Problem is empty.");
99 return m_blocksize;
100 }
101
102 /**
103 \brief
104 returns the solution u for a time step dt>0 with initial value u0 at time t=0
105 */
106 ESCRIPT_DLL_API
107 Data solve(Data& u0, Data& source, const double dt, boost::python::object& options) const;
108
109
110 /**
111 \brief resets the transport operator typically as they have been updated.
112 */
113 ESCRIPT_DLL_API
114 virtual void resetTransport() const;
115
116 /**
117 \brief
118 inserts constraint u_{,t}=r where q>0 into the problem
119 */
120 ESCRIPT_DLL_API
121 void insertConstraint(Data& source, Data& q, Data& r) const;
122 /*
123 * \brief returns a safe time step size.
124 */
125 ESCRIPT_DLL_API
126 virtual double getSafeTimeStepSize() const;
127 /*
128 * \brief returns the value for unlimited time step size.
129 */
130 ESCRIPT_DLL_API
131 virtual double getUnlimitedTimeStepSize() const;
132
133
134 protected:
135
136 private:
137
138 /**
139 \brief
140 sets solution out by time step dt.
141 */
142 ESCRIPT_DLL_API
143 virtual void setToSolution(Data& out, Data& u0, Data& source, const double dt, boost::python::object& options) const;
144
145 /**
146 \brief
147 copy constraint u_{,t}=r where q>0 into the problem
148 it can be assumed that q and r are not empty and have
149 appropriate shape and function space.
150 */
151 ESCRIPT_DLL_API
152 virtual void copyConstraint(Data& source, Data& q, Data& r) const;
153
154 int m_empty;
155 int m_blocksize;
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