/[escript]/branches/subworld2/escriptcore/src/AbstractTransportProblem.h
ViewVC logotype

Contents of /branches/subworld2/escriptcore/src/AbstractTransportProblem.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5504 - (show annotations)
Wed Mar 4 22:58:13 2015 UTC (4 years, 1 month ago) by jfenwick
File MIME type: text/plain
File size: 3752 byte(s)
Again with a more up to date copy


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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26