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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2548 - (hide annotations)
Mon Jul 20 06:20:06 2009 UTC (10 years, 8 months ago) by jfenwick
File MIME type: text/plain
File size: 3832 byte(s)
Updating copyright notices
1 elspeth 615
2 ksteube 1312 /*******************************************************
3 ksteube 1811 *
4 jfenwick 2548 * Copyright (c) 2003-2009 by University of Queensland
5 ksteube 1811 * 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 ksteube 1312
14 ksteube 1811
15 gross 1364 #if !defined escript_AbstractTransportProblem_H
16     #define escript_AbstractTransportProblem_H
17 woo409 757 #include "system_dep.h"
18 jgs 82
19 jgs 474 #include "FunctionSpace.h"
20 gross 1364 #include "TransportProblemException.h"
21 gross 2474 #include <boost/python/object.hpp>
22 jgs 474
23 jgs 480 //
24     // Forward declaration
25     class Data;
26    
27 jgs 82 namespace escript {
28    
29     /**
30     \brief
31 gross 1364 Give a short description of what AbstractTransportProblem does.
32 jgs 82
33     Description:
34 gross 1364 Give a detailed description of AbstractTransportProblem
35 jgs 82
36     Template Parameters:
37     For templates describe any conditions that the parameters used in the
38     template must satisfy
39     */
40 gross 1364 class AbstractTransportProblem {
41 jgs 82
42     public:
43    
44     /**
45     \brief
46 gross 1364 Default constructor for AbstractTransportProblem
47 jgs 82
48     Description:
49 gross 1364 Default constructor for AbstractTransportProblem
50 jgs 82
51     Preconditions:
52     Describe any preconditions
53    
54     Throws:
55     Describe any exceptions thrown
56     */
57 woo409 757 ESCRIPT_DLL_API
58 gross 1364 AbstractTransportProblem();
59 jgs 82
60 woo409 757 ESCRIPT_DLL_API
61 gross 1364 AbstractTransportProblem(const double theta,
62     const int blocksize,
63     const FunctionSpace& functionspace);
64    
65 jgs 82 /**
66     \brief
67     Destructor.
68     */
69 woo409 757 ESCRIPT_DLL_API
70 gross 1364 virtual ~AbstractTransportProblem();
71 jgs 82
72 woo409 757 ESCRIPT_DLL_API
73 jgs 82 int isEmpty() const;
74    
75     /**
76     \brief
77     returns the column function space
78     */
79 woo409 757 ESCRIPT_DLL_API
80 gross 1364 inline FunctionSpace getFunctionSpace() const
81 jgs 82 {
82     if (isEmpty())
83 gross 1367 throw TransportProblemException("Error - Transport Problem is empty.");
84 gross 1364 return m_functionspace;
85 jgs 82 }
86    
87     /**
88     \brief
89 gross 1364 returns the block size
90 jgs 82 */
91 woo409 757 ESCRIPT_DLL_API
92 gross 1364 inline int getBlockSize() const
93 jgs 82 {
94     if (isEmpty())
95 gross 1367 throw TransportProblemException("Error - Transport Problem is empty.");
96 gross 1364 return m_blocksize;
97 jgs 82 }
98    
99     /**
100 gross 1364 \brief
101     returns the solution u for a time step dt>0
102 jgs 82 */
103 woo409 757 ESCRIPT_DLL_API
104 gross 2474 Data solve(Data& source, const double dt, boost::python::object& options) const;
105 jgs 82
106     /**
107     \brief
108 gross 1364 sets the value for u at time t=0.
109 jgs 82 */
110 woo409 757 ESCRIPT_DLL_API
111 gross 1364 void setInitialValue(Data& u) const;
112 gross 1417
113 jgs 102 /**
114 gross 1364 \brief resets the transport operator typically as they have been updated.
115 jgs 102 */
116 woo409 757 ESCRIPT_DLL_API
117 gross 1364 virtual void resetTransport() const;
118 jgs 123
119 gross 1407 /**
120 gross 1417 \brief
121 gross 2197 inserts constraint u_{,t}=r where q>0 into the problem using a weighting factor
122 gross 1417 */
123     ESCRIPT_DLL_API
124 gross 2197 void insertConstraint(Data& source, Data& q, Data& r, const double factor) const;
125 gross 1859 /*
126     * \brief returns a safe time step size.
127     */
128 gross 1407 ESCRIPT_DLL_API
129     virtual double getSafeTimeStepSize() const;
130 gross 1859 /*
131     * \brief returns the value for unlimited time step size.
132     */
133     ESCRIPT_DLL_API
134     virtual double getUnlimitedTimeStepSize() const;
135 gross 1407
136    
137 jgs 82 protected:
138    
139     private:
140    
141     /**
142     \brief
143 gross 1364 sets solution out by time step dt.
144 jgs 82 */
145 woo409 757 ESCRIPT_DLL_API
146 gross 2474 virtual void setToSolution(Data& out,Data& source,const double dt, boost::python::object& options) const;
147 jgs 82
148     /**
149     \brief
150 gross 1364 copies the initial value into the problem
151 jgs 82 */
152 woo409 757 ESCRIPT_DLL_API
153 gross 1364 virtual void copyInitialValue(Data& u) const;
154 gross 1417 /**
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 gross 2197 virtual void copyConstraint(Data& source, Data& q, Data& r, const double factor) const;
162 jgs 82
163     int m_empty;
164 gross 1364 int m_blocksize;
165     double m_theta;
166     FunctionSpace m_functionspace;
167 jgs 82
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