/[escript]/branches/refine/buckley/src/BuckleyDomain.h
ViewVC logotype

Contents of /branches/refine/buckley/src/BuckleyDomain.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3671 - (show annotations)
Wed Nov 16 04:01:53 2011 UTC (9 years, 11 months ago) by jfenwick
File MIME type: text/plain
File size: 7927 byte(s)
Rename complete
1
2 /*******************************************************
3 *
4 * Copyright (c) 2011 by University of Queensland
5 * 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
14
15 #ifndef rdomain_20111025_H
16 #define rdomain_20111025_H
17
18 #include <escript/Data.h>
19 #include <escript/AbstractContinuousDomain.h>
20
21 #include "OctTree.h"
22 #include "system_dep.h"
23 #include "BuckleyException.h"
24
25 namespace buckley {
26
27
28 typedef int ASM_ptr;
29 typedef int ATP_ptr; // not what they are supposed to be
30
31
32 // This should inherit from AbstractContinuousDomain
33 class BuckleyDomain : public escript::AbstractDomain
34 {
35
36 public:
37
38 BUCKLEY_DLL_API
39 BuckleyDomain(double xside=1, double yside=1, double zside=1);
40
41 BUCKLEY_DLL_API
42 virtual ~BuckleyDomain();
43
44 /**
45 \brief
46 Returns true if the given integer is a valid function space type
47 for this domain.
48 */
49 BUCKLEY_DLL_API
50 virtual bool isValidFunctionSpaceType(int functionSpaceType) const;
51
52 /**
53 \brief
54 Return a description for this domain
55 */
56 BUCKLEY_DLL_API
57 virtual std::string getDescription() const;
58
59 /**
60 \brief
61 Return a continuous FunctionSpace code
62 */
63 BUCKLEY_DLL_API
64 virtual int getContinuousFunctionCode() const;
65
66 /**
67 \brief
68 Return a continuous on reduced order FunctionSpace code
69 */
70 BUCKLEY_DLL_API
71 virtual int getReducedContinuousFunctionCode() const;
72
73 /**
74 \brief
75 Return a function FunctionSpace code
76 */
77 BUCKLEY_DLL_API
78 virtual int getFunctionCode() const;
79
80 /**
81 \brief
82 Return a function FunctionSpace code with reduced integration order
83 */
84 BUCKLEY_DLL_API
85 virtual int getReducedFunctionCode() const;
86
87 /**
88 \brief
89 Return a function on boundary FunctionSpace code
90 */
91 BUCKLEY_DLL_API
92 virtual int getFunctionOnBoundaryCode() const;
93
94 /**
95 \brief
96 Return a code for a function on boundary FunctionSpace with reduced integration order
97 */
98 BUCKLEY_DLL_API
99 virtual int getReducedFunctionOnBoundaryCode() const;
100
101
102 /**
103 \brief
104 Return a FunctionOnContactZero code
105 */
106 BUCKLEY_DLL_API
107 virtual int getFunctionOnContactZeroCode() const;
108
109 /**
110 \brief
111 Return a FunctionOnContactZero for reduced integration order code
112 */
113 BUCKLEY_DLL_API
114 virtual int getReducedFunctionOnContactZeroCode() const;
115
116 /**
117 \brief
118 Return a FunctionOnContactOne code
119 */
120 BUCKLEY_DLL_API
121 virtual int getFunctionOnContactOneCode() const;
122
123 /**
124 \brief
125 Return a FunctionOnContactOne for reduced integration order code
126 */
127 BUCKLEY_DLL_API
128 virtual int getReducedFunctionOnContactOneCode() const;
129
130 /**
131 \brief
132 Return a Solution code
133 */
134 BUCKLEY_DLL_API
135 virtual int getSolutionCode() const;
136
137 /**
138 \brief
139 Return a ReducedSolution code
140 */
141 BUCKLEY_DLL_API
142 virtual int getReducedSolutionCode() const;
143
144 /**
145 \brief
146 Return a DiracDeltaFunctions code
147 */
148 BUCKLEY_DLL_API
149 virtual int getDiracDeltaFunctionsCode() const;
150
151 /**
152 \brief
153 return the identifier of the matrix type to be used for the global
154 stiffness matrix when a particular solver package
155 and symmetric matrix is used.
156 */
157 BUCKLEY_DLL_API
158 virtual int getSystemMatrixTypeId(const int solver, const int preconditioner, const int package, const bool symmetry) const;
159
160 /**
161 \brief
162 return the identifier of the matrix type to be used for the global
163 stiffness matrix when a particular solver package
164 and symmetric matrix is used.
165 */
166 BUCKLEY_DLL_API
167 virtual int getTransportTypeId(const int solver, const int preconditioner, const int package, const bool symmetry) const;
168
169 /**
170 \brief
171 copies the integrals of the function defined by arg into integrals.
172 arg has to be defined on this.
173 has to be implemented by the Domain Adapter.
174 */
175 BUCKLEY_DLL_API
176 virtual void setToIntegrals(std::vector<double>& integrals,const escript::Data& arg) const;
177
178 // /**
179 // \brief
180 // Return the domain as const AbstractContinuousDomain&
181 // */
182 // BUCKLEY_DLL_API
183 // static const AbstractContinuousDomain& asAbstractContinuousDomain(const AbstractDomain& domain);
184
185
186
187
188 /**
189 \brief
190 adds a PDE onto the stiffness matrix mat and a rhs
191 */
192 BUCKLEY_DLL_API
193 virtual void addPDEToSystem(
194 escript::AbstractSystemMatrix& mat, escript::Data& rhs,
195 const escript::Data& A, const escript::Data& B, const escript::Data& C,
196 const escript::Data& D, const escript::Data& X, const escript::Data& Y,
197 const escript::Data& d, const escript::Data& y,
198 const escript::Data& d_contact, const escript::Data& y_contact,
199 const escript::Data& d_dirac, const escript::Data& y_dirac) const;
200
201 // We do not require this method at this level since the python side checks to ensure it exists
202 // before calling it.
203
204 // /**
205 // \brief
206 // adds a PDE onto the lumped stiffness matrix matrix
207 // */
208 // BUCKLEY_DLL_API
209 // virtual void addPDEToLumpedSystem(
210 // escript::Data& mat,
211 // const escript::Data& D,
212 // const escript::Data& d) const;
213
214 /**
215 \brief
216 adds a PDE onto the stiffness matrix mat and a rhs
217 */
218 BUCKLEY_DLL_API
219 virtual void addPDEToRHS(escript::Data& rhs,
220 const escript::Data& X, const escript::Data& Y,
221 const escript::Data& y, const escript::Data& y_contact, const escript::Data& y_dirac) const;
222 /**
223 \brief
224 adds a PDE onto a transport problem
225 */
226
227 BUCKLEY_DLL_API
228 virtual void addPDEToTransportProblem(
229 escript::AbstractTransportProblem& tp, escript::Data& source,
230 const escript::Data& M,
231 const escript::Data& A, const escript::Data& B, const escript::Data& C,const escript::Data& D,
232 const escript::Data& X,const escript::Data& Y,
233 const escript::Data& d, const escript::Data& y,
234 const escript::Data& d_contact,const escript::Data& y_contact,
235 const escript::Data& d_dirac,const escript::Data& y_dirac) const;
236
237 /**
238 \brief
239 creates a SystemMatrixAdapter stiffness matrix and initializes it with zeros:
240 */
241 BUCKLEY_DLL_API
242 virtual ASM_ptr newSystemMatrix(
243 const int row_blocksize,
244 const escript::FunctionSpace& row_functionspace,
245 const int column_blocksize,
246 const escript::FunctionSpace& column_functionspace,
247 const int type) const;
248 /**
249 \brief
250 creates a TransportProblemAdapter
251
252 */
253
254 BUCKLEY_DLL_API
255 virtual ATP_ptr newTransportProblem(
256 const bool useBackwardEuler,
257 const int blocksize,
258 const escript::FunctionSpace& functionspace,
259 const int type) const;
260
261 /**
262 \brief
263 Return the number of data points summed across all MPI processes
264 */
265 BUCKLEY_DLL_API
266 virtual int getNumDataPointsGlobal() const;
267
268 /**
269 \brief
270 Return the number of data points per sample, and the number of samples as a pair.
271 \param functionSpaceCode Input -
272 */
273 BUCKLEY_DLL_API
274 virtual std::pair<int,int> getDataShape(int functionSpaceCode) const;
275
276 /**
277 \brief
278 assigns new location to the domain
279 */
280 BUCKLEY_DLL_API
281 virtual void setNewX(const escript::Data& arg);
282
283 /**
284 \brief
285 \param full
286 */
287 BUCKLEY_DLL_API
288 virtual void Print_Mesh_Info(const bool full=false) const;
289
290
291 protected:
292
293 private:
294 OctTree ot;
295 };
296
297 } // end of namespace
298
299 #endif

  ViewVC Help
Powered by ViewVC 1.1.26