Escript  Revision_4320
AbstractTransportProblem.h
Go to the documentation of this file.
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"
23 #include <boost/python/object.hpp>
24 
25 
26 
27 namespace escript {
28 
29 //
30 // Forward declaration
31 class Data;
32 
45 
46  public:
47 
63 
65  AbstractTransportProblem(const int blocksize,
66  const FunctionSpace& functionspace);
67 
73  virtual ~AbstractTransportProblem();
74 
76  int isEmpty() const;
77 
84  {
85  if (isEmpty())
86  throw TransportProblemException("Error - Transport Problem is empty.");
87  return m_functionspace;
88  }
89 
95  inline int getBlockSize() const
96  {
97  if (isEmpty())
98  throw TransportProblemException("Error - Transport Problem is empty.");
99  return m_blocksize;
100  }
101 
107  Data solve(Data& u0, Data& source, const double dt, boost::python::object& options) const;
108 
109 
114  virtual void resetTransport() const;
115 
121  void insertConstraint(Data& source, Data& q, Data& r) const;
122  /*
123  * \brief returns a safe time step size.
124  */
126  virtual double getSafeTimeStepSize() const;
127  /*
128  * \brief returns the value for unlimited time step size.
129  */
131  virtual double getUnlimitedTimeStepSize() const;
132 
133 
134  protected:
135 
136  private:
137 
143  virtual void setToSolution(Data& out, Data& u0, Data& source, const double dt, boost::python::object& options) const;
144 
152  virtual void copyConstraint(Data& source, Data& q, Data& r) const;
153 
154  int m_empty;
157 
158 };
159 
160 
161 typedef boost::shared_ptr<AbstractTransportProblem> ATP_ptr;
162 
163 } // end of namespace
164 #endif