/[escript]/trunk/finley/py_src/finleybench.py
ViewVC logotype

Annotation of /trunk/finley/py_src/finleybench.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 448 - (hide annotations)
Mon Jan 23 03:04:06 2006 UTC (14 years, 9 months ago) by gross
File MIME type: text/x-python
File size: 29700 byte(s)
small typy fixed
1 gross 381 # $Id:$
2    
3     #
4     # COPYRIGHT ACcESS 2004 - All Rights Reserved
5     #
6     # This software is the property of ACcESS. No part of this code
7     # may be copied in any form or by any means without the expressed written
8     # consent of ACcESS. Copying, use or modification of this software
9     # by any unauthorised person is illegal unless that
10     # person has a software license agreement with ACcESS.
11     #
12    
13     """
14     some benchmarks for tetsing the finley solver. The idea is to develop a set of standart benchmarks
15    
16     * Laplace2Dorder1_?k
17 gross 389 * Laplace2Dorder2_?k
18     * Laplace3Dorder1_?k
19 gross 381 * Laplace3Dorder2_?k
20    
21 gross 416
22    
23 gross 381 where ? is approximatively the number of unknowns in 1000.
24    
25     @var __author__: name of author
26     @var __licence__: licence agreement
27     var __url__: url entry point on documentation
28     @var __version__: version
29     @var __date__: date of the version
30     """
31    
32     __author__="Lutz Gross, l.gross@uq.edu.au"
33     __licence__="contact: esys@access.uq.edu.au"
34     __url__="http://www.iservo.edu.au/esys/escript"
35     __version__="$Revision:$"
36     __date__="$Date:$"
37    
38 gross 383 from esys.escript import Lsup,whereZero,kronecker
39 gross 381 from esys.escript.benchmark import BenchmarkProblem, Options, BenchmarkFilter
40     import esys.finley
41 gross 383 from esys.escript.linearPDEs import LinearPDE
42 gross 381 import os
43 gross 446 import math
44 gross 381
45     class FinleyFilter(BenchmarkFilter):
46     """
47     defines a filter for L{FinleyProblem} characteristics
48     """
49     TIME="t [sec]"
50     ERROR="rel. error"
51    
52    
53     def __init__(self,args=None):
54     """
55     sets up the filter
56    
57     @param args: list of value names to be filtered
58     @type args: C{list} of L{TIME}, L{ERROR}
59     """
60     if args==None: args=[FinleyFilter.TIME,FinleyFilter.ERROR]
61     super(FinleyFilter,self).__init__()
62     self.__args=args
63    
64     def getResultNames(self):
65     """
66     return the names of the results produced when run() is called.
67    
68     @return: names the list of the names to be used when the results of the run() call are printed
69     @rtype: C{list} of C{str}
70     """
71     return self.__args
72    
73     def __call__(self,result):
74     """
75     filters out the characteristic values
76    
77     @param result: characteristics rturned by a L{FinleyProblem} run
78     @type result: C{dict}
79     @return: filtered values
80     @rtype: C{list} of C{str}
81     """
82     out=[]
83     for a in self.__args:
84     out.append(result[a])
85     return out
86    
87 gross 383 class FinleyOptions(Options):
88     """
89     finley solver options to be handed over to paso
90 gross 381
91 gross 383 """
92     def __init__(self,solver_method=None,
93     preconditioner=None,
94     package=None,
95     tolerance=None,
96     verbose=False):
97     self.strmap={
98     LinearPDE.DIRECT : "DIRECT",
99     LinearPDE.PCG: "PCG",
100     LinearPDE.CR: "CR",
101     LinearPDE.CGS: "CGS",
102     LinearPDE.BICGSTAB: "BICGSTAB",
103     LinearPDE.SSOR: "SSOR",
104     LinearPDE.ILU0: "ILU0",
105     LinearPDE.ILUT: "ILUT",
106     LinearPDE.JACOBI: "JACOBI",
107     LinearPDE.GMRES: "GMRES",
108     LinearPDE.PRES20: "PRES20",
109     LinearPDE.LUMPING: "LUMPIMG",
110     LinearPDE.NO_REORDERING: "NO_REORDERING",
111     LinearPDE.MINIMUM_FILL_IN: "MINIMUM_FILL_IN",
112     LinearPDE.NESTED_DISSECTION: "NESTED_DISSECTION",
113     LinearPDE.SCSL: "SCSL",
114     LinearPDE.MKL: "MKL",
115     LinearPDE.UMFPACK: "UMFPACK",
116 gross 435 LinearPDE.PASO: "PASO",
117     LinearPDE.RILU: "RILU",
118     LinearPDE.AMG: "AMG"
119 gross 383 }
120     name=""
121     if solver_method==None:
122     solver_method==LinearPDE.PRES20
123     else:
124     name+=self.strmap[solver_method]
125     if preconditioner==None:
126     preconditioner==LinearPDE.JACOBI
127     else:
128     if not name=="": name+="+"
129     name+=self.strmap[preconditioner]
130     if package==None:
131     package==LinearPDE.PASO
132     else:
133     if not name=="": name+=" with "
134     name+=self.strmap[package]
135     if tolerance==None:
136     tolerance=1.e-8
137     else:
138     if not name=="": name+=", "
139     name+="tol = %s"%tolerance
140     self.solver_method=solver_method
141     self.preconditioner=preconditioner
142     self.tolerance=tolerance
143     self.package=package
144     self.verbose=verbose
145     super(FinleyOptions,self).__init__(name=name)
146    
147    
148    
149 gross 381 class FinleyProblem(BenchmarkProblem):
150     """
151     The general benchmark problem for Finley
152     """
153     def run(self,options):
154     """
155     creates a domain and a PDE on this domain, solves it (with the given options) and returns the
156     elapsed time and the error.
157    
158     @param options: paso solver options
159     @type options: L{PasoOptions}
160     @return: elapsed time and the error of calculated solution
161     @rtype: pair of C{float}
162     """
163     domain=self.getDomain()
164     pde,u=self.getTestProblem(domain)
165 gross 383 pde.setTolerance(options.tolerance)
166     pde.setSolverMethod(options.solver_method,options.preconditioner)
167     pde.setSolverPackage(options.package)
168 gross 381 a=os.times()[4]
169 gross 383 uh=pde.getSolution(verbose=options.verbose)
170 gross 381 a=os.times()[4]-a
171     if u==None:
172 gross 383 return {FinleyFilter.TIME : a , FinleyFilter.ERROR : None }
173 gross 381 else:
174     error=Lsup(u-uh)/Lsup(u)
175 gross 383 return {FinleyFilter.TIME : a , FinleyFilter.ERROR : error }
176 gross 381
177     def getTestProblem(self,domain):
178     """
179     returns a PDEto be solved and an exact solution
180    
181     @param domain: the PDE domain
182     @type domain: L{escript.Domain}
183     @return: a linear PDE to be solved an a reference solution
184     @rtype: L{LinearPDE},L{escript.Data}
185     @remark: must be overwritten by a particular problem
186     """
187     raise NotImplementedError
188    
189     def getDomain(self):
190     """
191     returns the domain of the problem
192    
193     @return: a domain
194     @rtype: L{escript.Domain}
195     @remark: must be overwritten by a particular problem
196     """
197     raise NotImplementedError
198    
199     class RegularFinleyProblem(FinleyProblem):
200     """
201     base class for finley problem on a rectangular mesh
202     """
203     def __init__(self,n=1,order=1,dim=2):
204     """
205     sets up a recangular mesh in finley on a unit cube/square
206    
207     @param n: number of elements in each spactial direction
208     @type n: C{int}
209     @param order: element order
210     @type order: 1 or 2
211     @param dim: spatial dimension
212     @type n: 2 or 3
213     """
214     super(RegularFinleyProblem,self).__init__(name=str((order*n+1)**dim))
215     self.__n=n
216     self.__order=order
217     self.__dim=dim
218    
219     def getDomain(self):
220     """
221     returns the unit square/cube with a rectangular mesh
222    
223     @return: a domain
224     @rtype: L{escript.Domain}
225     """
226 gross 383 if self.__dim==2:
227     domain=esys.finley.Rectangle(n0=self.__n,n1=self.__n,order=self.__order)
228 gross 381 else:
229 gross 383 domain=esys.finley.Brick(n0=self.__n,n1=self.__n,n2=self.__n,order=self.__order)
230 gross 381 return domain
231    
232     class LaplaceProblem(RegularFinleyProblem):
233     """
234     base class for the Lapalce eqaution on a rectangular mesh
235     """
236     def getTestProblem(self,domain):
237     """
238     returns a PDE and a test solution on the given domain
239    
240     @param doamin: a domain
241     @type domain: L{escript.Domain}
242     @return: the Laplace equation and a test solution
243     @rtype: C{tuple} of C{LinearPDE} and C{escript.Data}
244     """
245     x=domain.getX()
246     msk=whereZero(x[0])+whereZero(x[0]-1.)
247     u=x[0]
248     for i in range(1,domain.getDim()):
249     msk+=whereZero(x[i])+whereZero(x[i]-1.)
250     u*=(x[i]-i)
251 gross 383 pde=LinearPDE(domain)
252 gross 381 pde.setSymmetryOn()
253 gross 383 pde.setValue(A=kronecker(domain),q=msk,r=u)
254 gross 381 return pde,u
255    
256 gross 416 class AnisotropicProblem(RegularFinleyProblem):
257     """
258     base class for the Anisotropic scalar problem on a rectangular mesh
259     """
260     def __init__(self,n,order,dim,gamma,c):
261     self.c=c
262     self.gamma=gamma
263     super(AnisotropicProblem,self).__init__(n,order,dim)
264    
265    
266     def getTestProblem(self,domain):
267     """
268     returns a PDE and a test solution on the given domain
269    
270     @param doamin: a domain
271     @type domain: L{escript.Domain}
272     @return: the Laplace equation and a test solution
273     @rtype: C{tuple} of C{LinearPDE} and C{escript.Data}
274     """
275     x=domain.getX()
276     msk=whereZero(x[0])+whereZero(x[0]-1.)
277     u=x[0]
278     for i in range(1,domain.getDim()):
279     msk+=whereZero(x[i])+whereZero(x[i]-1.)
280     u*=(x[i]-i)
281    
282     gamma_rad=self.gamma/360.*8*math.atan(1.)
283 gross 448 cg=math.cos(gamma_rad)
284     sg=math.sin(gamma_rad)
285 gross 416 C=kronecker(domain)
286     C[0,0]=cg**2+self.c*sg**2
287     C[1,0]=(self.c-1.)*cg*sg
288     C[0,1]=C[0,1]
289     C[1,1]=sg**2+self.c*cg**2
290     F=2*(1.-self.c)*cg*sg
291     if domain.getDim()==3: F*=x[2]-2.
292     pde=LinearPDE(domain)
293     pde.setSymmetryOn()
294     pde.setValue(A=C,Y=F,q=msk,r=u)
295     return pde,u
296    
297 gross 389 class Laplace2DOrder1_30k(LaplaceProblem):
298     def __init__(self):
299     super(Laplace2DOrder1_30k,self).__init__(n=172,order=1,dim=2)
300     class Laplace2DOrder1_60k(LaplaceProblem):
301     def __init__(self):
302     super(Laplace2DOrder1_60k,self).__init__(n=244,order=1,dim=2)
303     class Laplace2DOrder1_120k(LaplaceProblem):
304     def __init__(self):
305     super(Laplace2DOrder1_120k,self).__init__(n=345,order=1,dim=2)
306     class Laplace2DOrder1_240k(LaplaceProblem):
307     def __init__(self):
308     super(Laplace2DOrder1_240k,self).__init__(n=489,order=1,dim=2)
309     class Laplace2DOrder1_480k(LaplaceProblem):
310     def __init__(self):
311     super(Laplace2DOrder1_480k,self).__init__(n=692,order=1,dim=2)
312     class Laplace2DOrder1_960k(LaplaceProblem):
313     def __init__(self):
314     super(Laplace2DOrder1_960k,self).__init__(n=979,order=1,dim=2)
315     class Laplace2DOrder1_1920k(LaplaceProblem):
316     def __init__(self):
317     super(Laplace2DOrder1_1920k,self).__init__(n=1385,order=1,dim=2)
318     class Laplace2DOrder1_3840k(LaplaceProblem):
319     def __init__(self):
320     super(Laplace2DOrder1_3840k,self).__init__(n=1959,order=1,dim=2)
321     class Laplace2DOrder1_7680k(LaplaceProblem):
322     def __init__(self):
323     super(Laplace2DOrder1_7680k,self).__init__(n=2770,order=1,dim=2)
324     class Laplace2DOrder1_15360k(LaplaceProblem):
325     def __init__(self):
326     super(Laplace2DOrder1_15360k,self).__init__(n=3918,order=1,dim=2)
327 gross 381 class Laplace2DOrder2_30k(LaplaceProblem):
328 gross 389 def __init__(self):
329     super(Laplace2DOrder2_30k,self).__init__(n=86,order=2,dim=2)
330 gross 381 class Laplace2DOrder2_60k(LaplaceProblem):
331 gross 389 def __init__(self):
332     super(Laplace2DOrder2_60k,self).__init__(n=122,order=2,dim=2)
333 gross 381 class Laplace2DOrder2_120k(LaplaceProblem):
334 gross 389 def __init__(self):
335     super(Laplace2DOrder2_120k,self).__init__(n=173,order=2,dim=2)
336 gross 381 class Laplace2DOrder2_240k(LaplaceProblem):
337 gross 389 def __init__(self):
338     super(Laplace2DOrder2_240k,self).__init__(n=244,order=2,dim=2)
339 gross 381 class Laplace2DOrder2_480k(LaplaceProblem):
340 gross 389 def __init__(self):
341     super(Laplace2DOrder2_480k,self).__init__(n=346,order=2,dim=2)
342 gross 381 class Laplace2DOrder2_960k(LaplaceProblem):
343 gross 389 def __init__(self):
344     super(Laplace2DOrder2_960k,self).__init__(n=489,order=2,dim=2)
345     class Laplace2DOrder2_1920k(LaplaceProblem):
346     def __init__(self):
347     super(Laplace2DOrder2_1920k,self).__init__(n=692,order=2,dim=2)
348     class Laplace2DOrder2_3840k(LaplaceProblem):
349     def __init__(self):
350     super(Laplace2DOrder2_3840k,self).__init__(n=979,order=2,dim=2)
351     class Laplace2DOrder2_7680k(LaplaceProblem):
352     def __init__(self):
353     super(Laplace2DOrder2_7680k,self).__init__(n=1385,order=2,dim=2)
354     class Laplace2DOrder2_15360k(LaplaceProblem):
355     def __init__(self):
356     super(Laplace2DOrder2_15360k,self).__init__(n=1959,order=2,dim=2)
357     class Laplace3DOrder1_30k(LaplaceProblem):
358     def __init__(self):
359     super(Laplace3DOrder1_30k,self).__init__(n=30,order=1,dim=3)
360     class Laplace3DOrder1_60k(LaplaceProblem):
361     def __init__(self):
362     super(Laplace3DOrder1_60k,self).__init__(n=38,order=1,dim=3)
363     class Laplace3DOrder1_120k(LaplaceProblem):
364     def __init__(self):
365     super(Laplace3DOrder1_120k,self).__init__(n=48,order=1,dim=3)
366     class Laplace3DOrder1_240k(LaplaceProblem):
367     def __init__(self):
368     super(Laplace3DOrder1_240k,self).__init__(n=61,order=1,dim=3)
369     class Laplace3DOrder1_480k(LaplaceProblem):
370     def __init__(self):
371     super(Laplace3DOrder1_480k,self).__init__(n=77,order=1,dim=3)
372     class Laplace3DOrder1_960k(LaplaceProblem):
373     def __init__(self):
374     super(Laplace3DOrder1_960k,self).__init__(n=98,order=1,dim=3)
375     class Laplace3DOrder1_1920k(LaplaceProblem):
376     def __init__(self):
377     super(Laplace3DOrder1_1920k,self).__init__(n=123,order=1,dim=3)
378     class Laplace3DOrder1_3840k(LaplaceProblem):
379     def __init__(self):
380     super(Laplace3DOrder1_3840k,self).__init__(n=156,order=1,dim=3)
381     class Laplace3DOrder1_7680k(LaplaceProblem):
382     def __init__(self):
383     super(Laplace3DOrder1_7680k,self).__init__(n=196,order=1,dim=3)
384     class Laplace3DOrder1_15360k(LaplaceProblem):
385     def __init__(self):
386     super(Laplace3DOrder1_15360k,self).__init__(n=248,order=1,dim=3)
387     class Laplace3DOrder2_30k(LaplaceProblem):
388     def __init__(self):
389     super(Laplace3DOrder2_30k,self).__init__(n=15,order=2,dim=3)
390     class Laplace3DOrder2_60k(LaplaceProblem):
391     def __init__(self):
392     super(Laplace3DOrder2_60k,self).__init__(n=19,order=2,dim=3)
393     class Laplace3DOrder2_120k(LaplaceProblem):
394     def __init__(self):
395     super(Laplace3DOrder2_120k,self).__init__(n=24,order=2,dim=3)
396     class Laplace3DOrder2_240k(LaplaceProblem):
397     def __init__(self):
398     super(Laplace3DOrder2_240k,self).__init__(n=31,order=2,dim=3)
399     class Laplace3DOrder2_480k(LaplaceProblem):
400     def __init__(self):
401     super(Laplace3DOrder2_480k,self).__init__(n=39,order=2,dim=3)
402     class Laplace3DOrder2_960k(LaplaceProblem):
403     def __init__(self):
404     super(Laplace3DOrder2_960k,self).__init__(n=49,order=2,dim=3)
405     class Laplace3DOrder2_1920k(LaplaceProblem):
406     def __init__(self):
407     super(Laplace3DOrder2_1920k,self).__init__(n=62,order=2,dim=3)
408     class Laplace3DOrder2_3840k(LaplaceProblem):
409     def __init__(self):
410     super(Laplace3DOrder2_3840k,self).__init__(n=78,order=2,dim=3)
411     class Laplace3DOrder2_7680k(LaplaceProblem):
412     def __init__(self):
413     super(Laplace3DOrder2_7680k,self).__init__(n=98,order=2,dim=3)
414     class Laplace3DOrder2_15360k(LaplaceProblem):
415     def __init__(self):
416     super(Laplace3DOrder2_15360k,self).__init__(n=124,order=2,dim=3)
417    
418 gross 416 class Anisotropic2DOrder1Gamma30_30k(AnisotropicProblem):
419     def __init__(self):
420     super(Anisotropic2DOrder1Gamma30_30k,self).__init__(n=172,order=1,dim=2,gamma=30,c=0.001)
421     class Anisotropic2DOrder1Gamma30_60k(AnisotropicProblem):
422     def __init__(self):
423     super(Anisotropic2DOrder1Gamma30_60k,self).__init__(n=244,order=1,dim=2,gamma=30,c=0.001)
424     class Anisotropic2DOrder1Gamma30_120k(AnisotropicProblem):
425     def __init__(self):
426     super(Anisotropic2DOrder1Gamma30_120k,self).__init__(n=345,order=1,dim=2,gamma=30,c=0.001)
427     class Anisotropic2DOrder1Gamma30_240k(AnisotropicProblem):
428     def __init__(self):
429     super(Anisotropic2DOrder1Gamma30_240k,self).__init__(n=489,order=1,dim=2,gamma=30,c=0.001)
430     class Anisotropic2DOrder1Gamma30_480k(AnisotropicProblem):
431     def __init__(self):
432     super(Anisotropic2DOrder1Gamma30_480k,self).__init__(n=692,order=1,dim=2,gamma=30,c=0.001)
433     class Anisotropic2DOrder1Gamma30_960k(AnisotropicProblem):
434     def __init__(self):
435     super(Anisotropic2DOrder1Gamma30_960k,self).__init__(n=979,order=1,dim=2,gamma=30,c=0.001)
436     class Anisotropic2DOrder1Gamma30_1920k(AnisotropicProblem):
437     def __init__(self):
438     super(Anisotropic2DOrder1Gamma30_1920k,self).__init__(n=1385,order=1,dim=2,gamma=30,c=0.001)
439     class Anisotropic2DOrder1Gamma30_3840k(AnisotropicProblem):
440     def __init__(self):
441     super(Anisotropic2DOrder1Gamma30_3840k,self).__init__(n=1959,order=1,dim=2,gamma=30,c=0.001)
442     class Anisotropic2DOrder1Gamma30_7680k(AnisotropicProblem):
443     def __init__(self):
444     super(Anisotropic2DOrder1Gamma30_7680k,self).__init__(n=2770,order=1,dim=2,gamma=30,c=0.001)
445     class Anisotropic2DOrder1Gamma30_15360k(AnisotropicProblem):
446     def __init__(self):
447     super(Anisotropic2DOrder1Gamma30_15360k,self).__init__(n=3918,order=1,dim=2,gamma=30,c=0.001)
448     class Anisotropic2DOrder1Gamma45_30k(AnisotropicProblem):
449     def __init__(self):
450     super(Anisotropic2DOrder1Gamma45_30k,self).__init__(n=172,order=1,dim=2,gamma=45,c=0.001)
451     class Anisotropic2DOrder1Gamma45_60k(AnisotropicProblem):
452     def __init__(self):
453     super(Anisotropic2DOrder1Gamma45_60k,self).__init__(n=244,order=1,dim=2,gamma=45,c=0.001)
454     class Anisotropic2DOrder1Gamma45_120k(AnisotropicProblem):
455     def __init__(self):
456     super(Anisotropic2DOrder1Gamma45_120k,self).__init__(n=345,order=1,dim=2,gamma=45,c=0.001)
457     class Anisotropic2DOrder1Gamma45_240k(AnisotropicProblem):
458     def __init__(self):
459     super(Anisotropic2DOrder1Gamma45_240k,self).__init__(n=489,order=1,dim=2,gamma=45,c=0.001)
460     class Anisotropic2DOrder1Gamma45_480k(AnisotropicProblem):
461     def __init__(self):
462     super(Anisotropic2DOrder1Gamma45_480k,self).__init__(n=692,order=1,dim=2,gamma=45,c=0.001)
463     class Anisotropic2DOrder1Gamma45_960k(AnisotropicProblem):
464     def __init__(self):
465     super(Anisotropic2DOrder1Gamma45_960k,self).__init__(n=979,order=1,dim=2,gamma=45,c=0.001)
466     class Anisotropic2DOrder1Gamma45_1920k(AnisotropicProblem):
467     def __init__(self):
468     super(Anisotropic2DOrder1Gamma45_1920k,self).__init__(n=1385,order=1,dim=2,gamma=45,c=0.001)
469     class Anisotropic2DOrder1Gamma45_3840k(AnisotropicProblem):
470     def __init__(self):
471     super(Anisotropic2DOrder1Gamma45_3840k,self).__init__(n=1959,order=1,dim=2,gamma=45,c=0.001)
472     class Anisotropic2DOrder1Gamma45_7680k(AnisotropicProblem):
473     def __init__(self):
474     super(Anisotropic2DOrder1Gamma45_7680k,self).__init__(n=2770,order=1,dim=2,gamma=45,c=0.001)
475     class Anisotropic2DOrder1Gamma45_15360k(AnisotropicProblem):
476     def __init__(self):
477     super(Anisotropic2DOrder1Gamma45_15360k,self).__init__(n=3918,order=1,dim=2,gamma=45,c=0.001)
478     class Anisotropic2DOrder2Gamma30_30k(AnisotropicProblem):
479     def __init__(self):
480     super(Anisotropic2DOrder2Gamma30_30k,self).__init__(n=86,order=2,dim=2,gamma=30,c=0.001)
481     class Anisotropic2DOrder2Gamma30_60k(AnisotropicProblem):
482     def __init__(self):
483     super(Anisotropic2DOrder2Gamma30_60k,self).__init__(n=122,order=2,dim=2,gamma=30,c=0.001)
484     class Anisotropic2DOrder2Gamma30_120k(AnisotropicProblem):
485     def __init__(self):
486     super(Anisotropic2DOrder2Gamma30_120k,self).__init__(n=173,order=2,dim=2,gamma=30,c=0.001)
487     class Anisotropic2DOrder2Gamma30_240k(AnisotropicProblem):
488     def __init__(self):
489     super(Anisotropic2DOrder2Gamma30_240k,self).__init__(n=244,order=2,dim=2,gamma=30,c=0.001)
490     class Anisotropic2DOrder2Gamma30_480k(AnisotropicProblem):
491     def __init__(self):
492     super(Anisotropic2DOrder2Gamma30_480k,self).__init__(n=346,order=2,dim=2,gamma=30,c=0.001)
493     class Anisotropic2DOrder2Gamma30_960k(AnisotropicProblem):
494     def __init__(self):
495     super(Anisotropic2DOrder2Gamma30_960k,self).__init__(n=489,order=2,dim=2,gamma=30,c=0.001)
496     class Anisotropic2DOrder2Gamma30_1920k(AnisotropicProblem):
497     def __init__(self):
498     super(Anisotropic2DOrder2Gamma30_1920k,self).__init__(n=692,order=2,dim=2,gamma=30,c=0.001)
499     class Anisotropic2DOrder2Gamma30_3840k(AnisotropicProblem):
500     def __init__(self):
501     super(Anisotropic2DOrder2Gamma30_3840k,self).__init__(n=979,order=2,dim=2,gamma=30,c=0.001)
502     class Anisotropic2DOrder2Gamma30_7680k(AnisotropicProblem):
503     def __init__(self):
504     super(Anisotropic2DOrder2Gamma30_7680k,self).__init__(n=1385,order=2,dim=2,gamma=30,c=0.001)
505     class Anisotropic2DOrder2Gamma30_15360k(AnisotropicProblem):
506     def __init__(self):
507     super(Anisotropic2DOrder2Gamma30_15360k,self).__init__(n=1959,order=2,dim=2,gamma=30,c=0.001)
508     class Anisotropic2DOrder2Gamma45_30k(AnisotropicProblem):
509     def __init__(self):
510     super(Anisotropic2DOrder2Gamma45_30k,self).__init__(n=86,order=2,dim=2,gamma=45,c=0.001)
511     class Anisotropic2DOrder2Gamma45_60k(AnisotropicProblem):
512     def __init__(self):
513     super(Anisotropic2DOrder2Gamma45_60k,self).__init__(n=122,order=2,dim=2,gamma=45,c=0.001)
514     class Anisotropic2DOrder2Gamma45_120k(AnisotropicProblem):
515     def __init__(self):
516     super(Anisotropic2DOrder2Gamma45_120k,self).__init__(n=173,order=2,dim=2,gamma=45,c=0.001)
517     class Anisotropic2DOrder2Gamma45_240k(AnisotropicProblem):
518     def __init__(self):
519     super(Anisotropic2DOrder2Gamma45_240k,self).__init__(n=244,order=2,dim=2,gamma=45,c=0.001)
520     class Anisotropic2DOrder2Gamma45_480k(AnisotropicProblem):
521     def __init__(self):
522     super(Anisotropic2DOrder2Gamma45_480k,self).__init__(n=346,order=2,dim=2,gamma=45,c=0.001)
523     class Anisotropic2DOrder2Gamma45_960k(AnisotropicProblem):
524     def __init__(self):
525     super(Anisotropic2DOrder2Gamma45_960k,self).__init__(n=489,order=2,dim=2,gamma=45,c=0.001)
526     class Anisotropic2DOrder2Gamma45_1920k(AnisotropicProblem):
527     def __init__(self):
528     super(Anisotropic2DOrder2Gamma45_1920k,self).__init__(n=692,order=2,dim=2,gamma=45,c=0.001)
529     class Anisotropic2DOrder2Gamma45_3840k(AnisotropicProblem):
530     def __init__(self):
531     super(Anisotropic2DOrder2Gamma45_3840k,self).__init__(n=979,order=2,dim=2,gamma=45,c=0.001)
532     class Anisotropic2DOrder2Gamma45_7680k(AnisotropicProblem):
533     def __init__(self):
534     super(Anisotropic2DOrder2Gamma45_7680k,self).__init__(n=1385,order=2,dim=2,gamma=45,c=0.001)
535     class Anisotropic2DOrder2Gamma45_15360k(AnisotropicProblem):
536     def __init__(self):
537     super(Anisotropic2DOrder2Gamma45_15360k,self).__init__(n=1959,order=2,dim=2,gamma=45,c=0.001)
538     class Anisotropic3DOrder1Gamma30_30k(AnisotropicProblem):
539     def __init__(self):
540     super(Anisotropic3DOrder1Gamma30_30k,self).__init__(n=30,order=1,dim=3,gamma=30,c=0.001)
541     class Anisotropic3DOrder1Gamma30_60k(AnisotropicProblem):
542     def __init__(self):
543     super(Anisotropic3DOrder1Gamma30_60k,self).__init__(n=38,order=1,dim=3,gamma=30,c=0.001)
544     class Anisotropic3DOrder1Gamma30_120k(AnisotropicProblem):
545     def __init__(self):
546     super(Anisotropic3DOrder1Gamma30_120k,self).__init__(n=48,order=1,dim=3,gamma=30,c=0.001)
547     class Anisotropic3DOrder1Gamma30_240k(AnisotropicProblem):
548     def __init__(self):
549     super(Anisotropic3DOrder1Gamma30_240k,self).__init__(n=61,order=1,dim=3,gamma=30,c=0.001)
550     class Anisotropic3DOrder1Gamma30_480k(AnisotropicProblem):
551     def __init__(self):
552     super(Anisotropic3DOrder1Gamma30_480k,self).__init__(n=77,order=1,dim=3,gamma=30,c=0.001)
553     class Anisotropic3DOrder1Gamma30_960k(AnisotropicProblem):
554     def __init__(self):
555     super(Anisotropic3DOrder1Gamma30_960k,self).__init__(n=98,order=1,dim=3,gamma=30,c=0.001)
556     class Anisotropic3DOrder1Gamma30_1920k(AnisotropicProblem):
557     def __init__(self):
558     super(Anisotropic3DOrder1Gamma30_1920k,self).__init__(n=123,order=1,dim=3,gamma=30,c=0.001)
559     class Anisotropic3DOrder1Gamma30_3840k(AnisotropicProblem):
560     def __init__(self):
561     super(Anisotropic3DOrder1Gamma30_3840k,self).__init__(n=156,order=1,dim=3,gamma=30,c=0.001)
562     class Anisotropic3DOrder1Gamma30_7680k(AnisotropicProblem):
563     def __init__(self):
564     super(Anisotropic3DOrder1Gamma30_7680k,self).__init__(n=196,order=1,dim=3,gamma=30,c=0.001)
565     class Anisotropic3DOrder1Gamma30_15360k(AnisotropicProblem):
566     def __init__(self):
567     super(Anisotropic3DOrder1Gamma30_15360k,self).__init__(n=248,order=1,dim=3,gamma=30,c=0.001)
568     class Anisotropic3DOrder1Gamma45_30k(AnisotropicProblem):
569     def __init__(self):
570     super(Anisotropic3DOrder1Gamma45_30k,self).__init__(n=30,order=1,dim=3,gamma=45,c=0.001)
571     class Anisotropic3DOrder1Gamma45_60k(AnisotropicProblem):
572     def __init__(self):
573     super(Anisotropic3DOrder1Gamma45_60k,self).__init__(n=38,order=1,dim=3,gamma=45,c=0.001)
574     class Anisotropic3DOrder1Gamma45_120k(AnisotropicProblem):
575     def __init__(self):
576     super(Anisotropic3DOrder1Gamma45_120k,self).__init__(n=48,order=1,dim=3,gamma=45,c=0.001)
577     class Anisotropic3DOrder1Gamma45_240k(AnisotropicProblem):
578     def __init__(self):
579     super(Anisotropic3DOrder1Gamma45_240k,self).__init__(n=61,order=1,dim=3,gamma=45,c=0.001)
580     class Anisotropic3DOrder1Gamma45_480k(AnisotropicProblem):
581     def __init__(self):
582     super(Anisotropic3DOrder1Gamma45_480k,self).__init__(n=77,order=1,dim=3,gamma=45,c=0.001)
583     class Anisotropic3DOrder1Gamma45_960k(AnisotropicProblem):
584     def __init__(self):
585     super(Anisotropic3DOrder1Gamma45_960k,self).__init__(n=98,order=1,dim=3,gamma=45,c=0.001)
586     class Anisotropic3DOrder1Gamma45_1920k(AnisotropicProblem):
587     def __init__(self):
588     super(Anisotropic3DOrder1Gamma45_1920k,self).__init__(n=123,order=1,dim=3,gamma=45,c=0.001)
589     class Anisotropic3DOrder1Gamma45_3840k(AnisotropicProblem):
590     def __init__(self):
591     super(Anisotropic3DOrder1Gamma45_3840k,self).__init__(n=156,order=1,dim=3,gamma=45,c=0.001)
592     class Anisotropic3DOrder1Gamma45_7680k(AnisotropicProblem):
593     def __init__(self):
594     super(Anisotropic3DOrder1Gamma45_7680k,self).__init__(n=196,order=1,dim=3,gamma=45,c=0.001)
595     class Anisotropic3DOrder1Gamma45_15360k(AnisotropicProblem):
596     def __init__(self):
597     super(Anisotropic3DOrder1Gamma45_15360k,self).__init__(n=248,order=1,dim=3,gamma=45,c=0.001)
598     class Anisotropic3DOrder2Gamma30_30k(AnisotropicProblem):
599     def __init__(self):
600     super(Anisotropic3DOrder2Gamma30_30k,self).__init__(n=15,order=2,dim=3,gamma=30,c=0.001)
601     class Anisotropic3DOrder2Gamma30_60k(AnisotropicProblem):
602     def __init__(self):
603     super(Anisotropic3DOrder2Gamma30_60k,self).__init__(n=19,order=2,dim=3,gamma=30,c=0.001)
604     class Anisotropic3DOrder2Gamma30_120k(AnisotropicProblem):
605     def __init__(self):
606     super(Anisotropic3DOrder2Gamma30_120k,self).__init__(n=24,order=2,dim=3,gamma=30,c=0.001)
607     class Anisotropic3DOrder2Gamma30_240k(AnisotropicProblem):
608     def __init__(self):
609     super(Anisotropic3DOrder2Gamma30_240k,self).__init__(n=31,order=2,dim=3,gamma=30,c=0.001)
610     class Anisotropic3DOrder2Gamma30_480k(AnisotropicProblem):
611     def __init__(self):
612     super(Anisotropic3DOrder2Gamma30_480k,self).__init__(n=39,order=2,dim=3,gamma=30,c=0.001)
613     class Anisotropic3DOrder2Gamma30_960k(AnisotropicProblem):
614     def __init__(self):
615     super(Anisotropic3DOrder2Gamma30_960k,self).__init__(n=49,order=2,dim=3,gamma=30,c=0.001)
616     class Anisotropic3DOrder2Gamma30_1920k(AnisotropicProblem):
617     def __init__(self):
618     super(Anisotropic3DOrder2Gamma30_1920k,self).__init__(n=62,order=2,dim=3,gamma=30,c=0.001)
619     class Anisotropic3DOrder2Gamma30_3840k(AnisotropicProblem):
620     def __init__(self):
621     super(Anisotropic3DOrder2Gamma30_3840k,self).__init__(n=78,order=2,dim=3,gamma=30,c=0.001)
622     class Anisotropic3DOrder2Gamma30_7680k(AnisotropicProblem):
623     def __init__(self):
624     super(Anisotropic3DOrder2Gamma30_7680k,self).__init__(n=98,order=2,dim=3,gamma=30,c=0.001)
625     class Anisotropic3DOrder2Gamma30_15360k(AnisotropicProblem):
626     def __init__(self):
627     super(Anisotropic3DOrder2Gamma30_15360k,self).__init__(n=124,order=2,dim=3,gamma=30,c=0.001)
628     class Anisotropic3DOrder2Gamma45_30k(AnisotropicProblem):
629     def __init__(self):
630     super(Anisotropic3DOrder2Gamma45_30k,self).__init__(n=15,order=2,dim=3,gamma=45,c=0.001)
631     class Anisotropic3DOrder2Gamma45_60k(AnisotropicProblem):
632     def __init__(self):
633     super(Anisotropic3DOrder2Gamma45_60k,self).__init__(n=19,order=2,dim=3,gamma=45,c=0.001)
634     class Anisotropic3DOrder2Gamma45_120k(AnisotropicProblem):
635     def __init__(self):
636     super(Anisotropic3DOrder2Gamma45_120k,self).__init__(n=24,order=2,dim=3,gamma=45,c=0.001)
637     class Anisotropic3DOrder2Gamma45_240k(AnisotropicProblem):
638     def __init__(self):
639     super(Anisotropic3DOrder2Gamma45_240k,self).__init__(n=31,order=2,dim=3,gamma=45,c=0.001)
640     class Anisotropic3DOrder2Gamma45_480k(AnisotropicProblem):
641     def __init__(self):
642     super(Anisotropic3DOrder2Gamma45_480k,self).__init__(n=39,order=2,dim=3,gamma=45,c=0.001)
643     class Anisotropic3DOrder2Gamma45_960k(AnisotropicProblem):
644     def __init__(self):
645     super(Anisotropic3DOrder2Gamma45_960k,self).__init__(n=49,order=2,dim=3,gamma=45,c=0.001)
646     class Anisotropic3DOrder2Gamma45_1920k(AnisotropicProblem):
647     def __init__(self):
648     super(Anisotropic3DOrder2Gamma45_1920k,self).__init__(n=62,order=2,dim=3,gamma=45,c=0.001)
649     class Anisotropic3DOrder2Gamma45_3840k(AnisotropicProblem):
650     def __init__(self):
651     super(Anisotropic3DOrder2Gamma45_3840k,self).__init__(n=78,order=2,dim=3,gamma=45,c=0.001)
652     class Anisotropic3DOrder2Gamma45_7680k(AnisotropicProblem):
653     def __init__(self):
654     super(Anisotropic3DOrder2Gamma45_7680k,self).__init__(n=98,order=2,dim=3,gamma=45,c=0.001)
655     class Anisotropic3DOrder2Gamma45_15360k(AnisotropicProblem):
656     def __init__(self):
657     super(Anisotropic3DOrder2Gamma45_15360k,self).__init__(n=124,order=2,dim=3,gamma=45,c=0.001)
658    
659 gross 389 if __name__=="__main__":
660     test=""
661     n0=30000
662     for d in [2,3]:
663 gross 416 for o in [1,2]:
664     for g in [30,45]:
665 gross 389 for i in range(10):
666     dofs=n0*2**i
667     n=int((float(dofs)**(1./float(d))-1)/o+0.5)
668 gross 416 name="Anisotropic%sDOrder%sGamma%s_%sk"%(d,o,g,dofs/1000)
669     print "class %s(AnisotropicProblem):"%name
670 gross 389 print " def __init__(self):"
671 gross 416 print " super(%s,self).__init__(n=%s,order=%s,dim=%s,gamma=%s,c=0.001)"%(name,n,o,d,g)
672 gross 389 test+="addProblem(%s())\n"%name
673     print test
674    

  ViewVC Help
Powered by ViewVC 1.1.26