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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26