/[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 3680 - (show annotations)
Fri Nov 18 04:48:53 2011 UTC (7 years, 8 months ago) by jfenwick
File MIME type: text/plain
File size: 8192 byte(s)
It has memory errors during a getX.

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 BUCKLEY_DLL_API
152 virtual escript::Data getX() const;
153
154 BUCKLEY_DLL_API
155 virtual void setToX(escript::Data& arg) const ;
156
157
158 BUCKLEY_DLL_API
159 virtual int getDim() const
160 {
161 return 3;
162 }
163
164
165 /**
166 \brief
167 return the identifier of the matrix type to be used for the global
168 stiffness matrix when a particular solver package
169 and symmetric matrix is used.
170 */
171 BUCKLEY_DLL_API
172 virtual int getSystemMatrixTypeId(const int solver, const int preconditioner, const int package, const bool symmetry) const;
173
174 /**
175 \brief
176 return the identifier of the matrix type to be used for the global
177 stiffness matrix when a particular solver package
178 and symmetric matrix is used.
179 */
180 BUCKLEY_DLL_API
181 virtual int getTransportTypeId(const int solver, const int preconditioner, const int package, const bool symmetry) const;
182
183 /**
184 \brief
185 copies the integrals of the function defined by arg into integrals.
186 arg has to be defined on this.
187 has to be implemented by the Domain Adapter.
188 */
189 BUCKLEY_DLL_API
190 virtual void setToIntegrals(std::vector<double>& integrals,const escript::Data& arg) const;
191
192 // /**
193 // \brief
194 // Return the domain as const AbstractContinuousDomain&
195 // */
196 // BUCKLEY_DLL_API
197 // static const AbstractContinuousDomain& asAbstractContinuousDomain(const AbstractDomain& domain);
198
199
200
201
202 /**
203 \brief
204 adds a PDE onto the stiffness matrix mat and a rhs
205 */
206 BUCKLEY_DLL_API
207 virtual void addPDEToSystem(
208 escript::AbstractSystemMatrix& mat, escript::Data& rhs,
209 const escript::Data& A, const escript::Data& B, const escript::Data& C,
210 const escript::Data& D, const escript::Data& X, const escript::Data& Y,
211 const escript::Data& d, const escript::Data& y,
212 const escript::Data& d_contact, const escript::Data& y_contact,
213 const escript::Data& d_dirac, const escript::Data& y_dirac) const;
214
215 // We do not require this method at this level since the python side checks to ensure it exists
216 // before calling it.
217
218 // /**
219 // \brief
220 // adds a PDE onto the lumped stiffness matrix matrix
221 // */
222 // BUCKLEY_DLL_API
223 // virtual void addPDEToLumpedSystem(
224 // escript::Data& mat,
225 // const escript::Data& D,
226 // const escript::Data& d) const;
227
228 /**
229 \brief
230 adds a PDE onto the stiffness matrix mat and a rhs
231 */
232 BUCKLEY_DLL_API
233 virtual void addPDEToRHS(escript::Data& rhs,
234 const escript::Data& X, const escript::Data& Y,
235 const escript::Data& y, const escript::Data& y_contact, const escript::Data& y_dirac) const;
236 /**
237 \brief
238 adds a PDE onto a transport problem
239 */
240
241 BUCKLEY_DLL_API
242 virtual void addPDEToTransportProblem(
243 escript::AbstractTransportProblem& tp, escript::Data& source,
244 const escript::Data& M,
245 const escript::Data& A, const escript::Data& B, const escript::Data& C,const escript::Data& D,
246 const escript::Data& X,const escript::Data& Y,
247 const escript::Data& d, const escript::Data& y,
248 const escript::Data& d_contact,const escript::Data& y_contact,
249 const escript::Data& d_dirac,const escript::Data& y_dirac) const;
250
251 /**
252 \brief
253 creates a SystemMatrixAdapter stiffness matrix and initializes it with zeros:
254 */
255 BUCKLEY_DLL_API
256 virtual ASM_ptr newSystemMatrix(
257 const int row_blocksize,
258 const escript::FunctionSpace& row_functionspace,
259 const int column_blocksize,
260 const escript::FunctionSpace& column_functionspace,
261 const int type) const;
262 /**
263 \brief
264 creates a TransportProblemAdapter
265
266 */
267
268 BUCKLEY_DLL_API
269 virtual ATP_ptr newTransportProblem(
270 const bool useBackwardEuler,
271 const int blocksize,
272 const escript::FunctionSpace& functionspace,
273 const int type) const;
274
275 /**
276 \brief
277 Return the number of data points summed across all MPI processes
278 */
279 BUCKLEY_DLL_API
280 virtual int getNumDataPointsGlobal() const;
281
282 /**
283 \brief
284 Return the number of data points per sample, and the number of samples as a pair.
285 \param functionSpaceCode Input -
286 */
287 BUCKLEY_DLL_API
288 virtual std::pair<int,int> getDataShape(int functionSpaceCode) const;
289
290 /**
291 \brief
292 assigns new location to the domain
293 */
294 BUCKLEY_DLL_API
295 virtual void setNewX(const escript::Data& arg);
296
297 /**
298 \brief
299 \param full
300 */
301 BUCKLEY_DLL_API
302 virtual void Print_Mesh_Info(const bool full=false) const;
303
304
305 protected:
306
307 private:
308 OctTree ot;
309 bool modified;
310 mutable const OctCell** leaves;
311 };
312
313 } // end of namespace
314
315 #endif

  ViewVC Help
Powered by ViewVC 1.1.26