/[escript]/trunk/finley/src/CPPAdapter/TransportProblemAdapter.h
ViewVC logotype

Contents of /trunk/finley/src/CPPAdapter/TransportProblemAdapter.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1407 - (show annotations)
Mon Feb 4 06:45:48 2008 UTC (11 years, 5 months ago) by gross
File MIME type: text/plain
File size: 3403 byte(s)
new upwinding algorithm (still fails)
1 /* $Id$ */
2
3 /*******************************************************
4 *
5 * Copyright 2007 by University of Queensland
6 *
7 * http://esscc.uq.edu.au
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
14 #if !defined finley_TransportProblemAdapter_H
15 #define finley_TransportProblemAdapter_H
16 #include "system_dep.h"
17
18 extern "C" {
19 #include "paso/SolverFCT.h"
20 #include "paso/Options.h"
21 }
22
23 #include "FinleyAdapterException.h"
24 #include "FinleyError.h"
25
26 #include "escript/AbstractTransportProblem.h"
27 #include "escript/Data.h"
28 #include "escript/UtilC.h"
29
30 #include <boost/python/dict.hpp>
31 #include <boost/shared_ptr.hpp>
32 #include <boost/python/extract.hpp>
33
34 namespace finley {
35
36 class TransportProblemAdapter:public escript::AbstractTransportProblem {
37
38 /**
39 \brief
40 Wrapper for Paso_FCTransportProblem.
41
42 Description:
43 Wrapper for Paso_FCTransportProblem.
44 */
45
46 public:
47
48 /**
49 /brief
50 Default Constructor for TransportProblemAdapter.
51 NB: Only throws an exception.
52 */
53 FINLEY_DLL_API
54 TransportProblemAdapter();
55
56 /**
57 /brief
58 Constructor for TransportProblemAdapter.
59 */
60 FINLEY_DLL_API
61 TransportProblemAdapter(Paso_FCTransportProblem* transport_problem,
62 const double theta,
63 const int block_size,
64 const escript::FunctionSpace& functionspace);
65
66 /**
67 \brief
68 Destructor for TransportProblemAdapter. As specified in the constructor
69 this deallocates the pointer given to the constructor.
70 */
71 FINLEY_DLL_API
72 ~TransportProblemAdapter();
73
74 /**
75 \brief
76 Returns the pointer to the transport problem.
77 */
78 FINLEY_DLL_API
79 Paso_FCTransportProblem* getPaso_FCTransportProblem() const;
80
81 /**
82 \brief
83 Returns the transport problem as a const AbstractTransportProblem&.
84 */
85 inline const escript::AbstractTransportProblem& asAbstractTransportProblem() const
86 {
87 return dynamic_cast<const escript::AbstractTransportProblem&>(*this);
88 }
89
90 /**
91 \brief
92 Returns a transport problem as a const TransportProblemAdapter&.
93 */
94 inline static const TransportProblemAdapter& asTransportProblemAdapter(const AbstractTransportProblem& transportproblem)
95 {
96 return dynamic_cast<const TransportProblemAdapter&>(transportproblem);
97 }
98
99 /**
100 * \brief resets the transport operator typically as they have been updated.
101 * */
102 FINLEY_DLL_API
103 virtual void resetTransport() const;
104
105 /**
106 * \brief returns a save time step size.
107 * */
108 FINLEY_DLL_API
109 virtual double getSafeTimeStepSize() const;
110
111 protected:
112
113 private:
114
115 /**
116 * \brief
117 * sets solution out by time step dt.
118 * */
119 FINLEY_DLL_API
120 virtual void setToSolution(escript::Data& out,escript::Data& source,const double dt, const boost::python::dict& options) const;
121
122 /**
123 * \brief
124 * copies the initial value into the problem
125 * */
126 FINLEY_DLL_API
127 virtual void copyInitialValue(escript::Data& u) const;
128
129 //
130 // pointer to the externally created finley mesh - transport_problem.
131 //
132 boost::shared_ptr<Paso_FCTransportProblem> m_transport_problem;
133
134 };
135
136 } // end of namespace
137 #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26