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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3658 - (show annotations)
Fri Nov 11 06:55:48 2011 UTC (10 years ago) by jfenwick
Original Path: branches/refine/refine/src/RDomain.h
File MIME type: text/plain
File size: 7824 byte(s)
the refine domain is hooked into scons but doesn't do anything useful yet.

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

  ViewVC Help
Powered by ViewVC 1.1.26