/[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 3682 - (show annotations)
Mon Nov 21 01:56:45 2011 UTC (9 years, 8 months ago) by jfenwick
File MIME type: text/plain
File size: 8352 byte(s)
Fixed some cases which allowed domain objects to be created without wrappers

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

  ViewVC Help
Powered by ViewVC 1.1.26