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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3793 - (hide annotations)
Wed Feb 1 07:39:43 2012 UTC (7 years, 7 months ago) by gross
File MIME type: text/plain
File size: 3632 byte(s)
new implementation of FCT solver with some modifications to the python interface
1 elspeth 615
2 ksteube 1312 /*******************************************************
3 ksteube 1811 *
4 jfenwick 2881 * Copyright (c) 2003-2010 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 jfenwick 3259
24    
25     namespace escript {
26    
27 jgs 480 //
28     // Forward declaration
29     class Data;
30    
31 jgs 82 /**
32     \brief
33 gross 1364 Give a short description of what AbstractTransportProblem does.
34 jgs 82
35     Description:
36 gross 1364 Give a detailed description of AbstractTransportProblem
37 jgs 82
38     Template Parameters:
39     For templates describe any conditions that the parameters used in the
40     template must satisfy
41     */
42 gross 1364 class AbstractTransportProblem {
43 jgs 82
44     public:
45    
46     /**
47     \brief
48 gross 1364 Default constructor for AbstractTransportProblem
49 jgs 82
50     Description:
51 gross 1364 Default constructor for AbstractTransportProblem
52 jgs 82
53     Preconditions:
54     Describe any preconditions
55    
56     Throws:
57     Describe any exceptions thrown
58     */
59 woo409 757 ESCRIPT_DLL_API
60 gross 1364 AbstractTransportProblem();
61 jgs 82
62 woo409 757 ESCRIPT_DLL_API
63 gross 3793 AbstractTransportProblem(const int blocksize,
64 gross 1364 const FunctionSpace& functionspace);
65    
66 jgs 82 /**
67     \brief
68     Destructor.
69     */
70 woo409 757 ESCRIPT_DLL_API
71 gross 1364 virtual ~AbstractTransportProblem();
72 jgs 82
73 woo409 757 ESCRIPT_DLL_API
74 jgs 82 int isEmpty() const;
75    
76     /**
77     \brief
78     returns the column function space
79     */
80 woo409 757 ESCRIPT_DLL_API
81 gross 1364 inline FunctionSpace getFunctionSpace() const
82 jgs 82 {
83     if (isEmpty())
84 gross 1367 throw TransportProblemException("Error - Transport Problem is empty.");
85 gross 1364 return m_functionspace;
86 jgs 82 }
87    
88     /**
89     \brief
90 gross 1364 returns the block size
91 jgs 82 */
92 woo409 757 ESCRIPT_DLL_API
93 gross 1364 inline int getBlockSize() const
94 jgs 82 {
95     if (isEmpty())
96 gross 1367 throw TransportProblemException("Error - Transport Problem is empty.");
97 gross 1364 return m_blocksize;
98 jgs 82 }
99    
100     /**
101 gross 1364 \brief
102 gross 2987 returns the solution u for a time step dt>0 with initial value u0 at time t=0
103 jgs 82 */
104 woo409 757 ESCRIPT_DLL_API
105 gross 2987 Data solve(Data& u0, Data& source, const double dt, boost::python::object& options) const;
106 jgs 82
107 gross 1417
108 jgs 102 /**
109 gross 1364 \brief resets the transport operator typically as they have been updated.
110 jgs 102 */
111 woo409 757 ESCRIPT_DLL_API
112 gross 1364 virtual void resetTransport() const;
113 jgs 123
114 gross 1407 /**
115 gross 1417 \brief
116 gross 2197 inserts constraint u_{,t}=r where q>0 into the problem using a weighting factor
117 gross 1417 */
118     ESCRIPT_DLL_API
119 gross 2197 void insertConstraint(Data& source, Data& q, Data& r, const double factor) const;
120 gross 1859 /*
121     * \brief returns a safe time step size.
122     */
123 gross 1407 ESCRIPT_DLL_API
124     virtual double getSafeTimeStepSize() const;
125 gross 1859 /*
126     * \brief returns the value for unlimited time step size.
127     */
128     ESCRIPT_DLL_API
129     virtual double getUnlimitedTimeStepSize() const;
130 gross 1407
131    
132 jgs 82 protected:
133    
134     private:
135    
136     /**
137     \brief
138 gross 1364 sets solution out by time step dt.
139 jgs 82 */
140 woo409 757 ESCRIPT_DLL_API
141 gross 2987 virtual void setToSolution(Data& out, Data& u0, Data& source, const double dt, boost::python::object& options) const;
142 jgs 82
143     /**
144     \brief
145 gross 1417 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 gross 2197 virtual void copyConstraint(Data& source, Data& q, Data& r, const double factor) const;
151 jgs 82
152     int m_empty;
153 gross 1364 int m_blocksize;
154     FunctionSpace m_functionspace;
155 jgs 82
156     };
157    
158    
159 jfenwick 3259 typedef boost::shared_ptr<AbstractTransportProblem> ATP_ptr;
160    
161 jgs 82 } // 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