/[escript]/trunk/dudley/benchmarks/dudleybench.py
ViewVC logotype

Diff of /trunk/dudley/benchmarks/dudleybench.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 415 by gross, Tue Dec 20 03:17:28 2005 UTC revision 416 by gross, Wed Jan 4 05:38:35 2006 UTC
# Line 18  some benchmarks for tetsing the finley s Line 18  some benchmarks for tetsing the finley s
18    * Laplace3Dorder1_?k    * Laplace3Dorder1_?k
19    * Laplace3Dorder2_?k    * Laplace3Dorder2_?k
20    
21    
22    
23  where ? is approximatively the number of unknowns in 1000.  where ? is approximatively the number of unknowns in 1000.
24    
25  @var __author__: name of author  @var __author__: name of author
# Line 248  class LaplaceProblem(RegularFinleyProble Line 250  class LaplaceProblem(RegularFinleyProble
250           pde.setValue(A=kronecker(domain),q=msk,r=u)           pde.setValue(A=kronecker(domain),q=msk,r=u)
251           return pde,u           return pde,u
252    
253    class AnisotropicProblem(RegularFinleyProblem):
254        """
255        base class for the Anisotropic scalar problem on a rectangular mesh
256        """
257        def __init__(self,n,order,dim,gamma,c):
258            self.c=c
259            self.gamma=gamma
260            super(AnisotropicProblem,self).__init__(n,order,dim)
261    
262    
263        def getTestProblem(self,domain):
264             """
265             returns a PDE and a test solution on the given domain
266        
267             @param doamin: a domain
268             @type domain: L{escript.Domain}
269             @return: the Laplace equation and a test solution
270             @rtype: C{tuple} of C{LinearPDE} and C{escript.Data}
271             """
272             x=domain.getX()
273             msk=whereZero(x[0])+whereZero(x[0]-1.)
274             u=x[0]
275             for i in range(1,domain.getDim()):
276                msk+=whereZero(x[i])+whereZero(x[i]-1.)
277                u*=(x[i]-i)
278    
279             gamma_rad=self.gamma/360.*8*math.atan(1.)
280             cg=maths.cos(self.gamma_rad)
281             sg=maths.sin(self.gamma_rad)
282             C=kronecker(domain)
283             C[0,0]=cg**2+self.c*sg**2
284             C[1,0]=(self.c-1.)*cg*sg
285             C[0,1]=C[0,1]
286             C[1,1]=sg**2+self.c*cg**2
287             F=2*(1.-self.c)*cg*sg
288             if domain.getDim()==3: F*=x[2]-2.
289             pde=LinearPDE(domain)
290             pde.setSymmetryOn()
291             pde.setValue(A=C,Y=F,q=msk,r=u)
292             return pde,u
293    
294  class Laplace2DOrder1_30k(LaplaceProblem):  class Laplace2DOrder1_30k(LaplaceProblem):
295     def __init__(self):     def __init__(self):
296        super(Laplace2DOrder1_30k,self).__init__(n=172,order=1,dim=2)        super(Laplace2DOrder1_30k,self).__init__(n=172,order=1,dim=2)
# Line 369  class Laplace3DOrder2_15360k(LaplaceProb Line 412  class Laplace3DOrder2_15360k(LaplaceProb
412     def __init__(self):     def __init__(self):
413        super(Laplace3DOrder2_15360k,self).__init__(n=124,order=2,dim=3)        super(Laplace3DOrder2_15360k,self).__init__(n=124,order=2,dim=3)
414    
415    class Anisotropic2DOrder1Gamma30_30k(AnisotropicProblem):
416       def __init__(self):
417          super(Anisotropic2DOrder1Gamma30_30k,self).__init__(n=172,order=1,dim=2,gamma=30,c=0.001)
418    class Anisotropic2DOrder1Gamma30_60k(AnisotropicProblem):
419       def __init__(self):
420          super(Anisotropic2DOrder1Gamma30_60k,self).__init__(n=244,order=1,dim=2,gamma=30,c=0.001)
421    class Anisotropic2DOrder1Gamma30_120k(AnisotropicProblem):
422       def __init__(self):
423          super(Anisotropic2DOrder1Gamma30_120k,self).__init__(n=345,order=1,dim=2,gamma=30,c=0.001)
424    class Anisotropic2DOrder1Gamma30_240k(AnisotropicProblem):
425       def __init__(self):
426          super(Anisotropic2DOrder1Gamma30_240k,self).__init__(n=489,order=1,dim=2,gamma=30,c=0.001)
427    class Anisotropic2DOrder1Gamma30_480k(AnisotropicProblem):
428       def __init__(self):
429          super(Anisotropic2DOrder1Gamma30_480k,self).__init__(n=692,order=1,dim=2,gamma=30,c=0.001)
430    class Anisotropic2DOrder1Gamma30_960k(AnisotropicProblem):
431       def __init__(self):
432          super(Anisotropic2DOrder1Gamma30_960k,self).__init__(n=979,order=1,dim=2,gamma=30,c=0.001)
433    class Anisotropic2DOrder1Gamma30_1920k(AnisotropicProblem):
434       def __init__(self):
435          super(Anisotropic2DOrder1Gamma30_1920k,self).__init__(n=1385,order=1,dim=2,gamma=30,c=0.001)
436    class Anisotropic2DOrder1Gamma30_3840k(AnisotropicProblem):
437       def __init__(self):
438          super(Anisotropic2DOrder1Gamma30_3840k,self).__init__(n=1959,order=1,dim=2,gamma=30,c=0.001)
439    class Anisotropic2DOrder1Gamma30_7680k(AnisotropicProblem):
440       def __init__(self):
441          super(Anisotropic2DOrder1Gamma30_7680k,self).__init__(n=2770,order=1,dim=2,gamma=30,c=0.001)
442    class Anisotropic2DOrder1Gamma30_15360k(AnisotropicProblem):
443       def __init__(self):
444          super(Anisotropic2DOrder1Gamma30_15360k,self).__init__(n=3918,order=1,dim=2,gamma=30,c=0.001)
445    class Anisotropic2DOrder1Gamma45_30k(AnisotropicProblem):
446       def __init__(self):
447          super(Anisotropic2DOrder1Gamma45_30k,self).__init__(n=172,order=1,dim=2,gamma=45,c=0.001)
448    class Anisotropic2DOrder1Gamma45_60k(AnisotropicProblem):
449       def __init__(self):
450          super(Anisotropic2DOrder1Gamma45_60k,self).__init__(n=244,order=1,dim=2,gamma=45,c=0.001)
451    class Anisotropic2DOrder1Gamma45_120k(AnisotropicProblem):
452       def __init__(self):
453          super(Anisotropic2DOrder1Gamma45_120k,self).__init__(n=345,order=1,dim=2,gamma=45,c=0.001)
454    class Anisotropic2DOrder1Gamma45_240k(AnisotropicProblem):
455       def __init__(self):
456          super(Anisotropic2DOrder1Gamma45_240k,self).__init__(n=489,order=1,dim=2,gamma=45,c=0.001)
457    class Anisotropic2DOrder1Gamma45_480k(AnisotropicProblem):
458       def __init__(self):
459          super(Anisotropic2DOrder1Gamma45_480k,self).__init__(n=692,order=1,dim=2,gamma=45,c=0.001)
460    class Anisotropic2DOrder1Gamma45_960k(AnisotropicProblem):
461       def __init__(self):
462          super(Anisotropic2DOrder1Gamma45_960k,self).__init__(n=979,order=1,dim=2,gamma=45,c=0.001)
463    class Anisotropic2DOrder1Gamma45_1920k(AnisotropicProblem):
464       def __init__(self):
465          super(Anisotropic2DOrder1Gamma45_1920k,self).__init__(n=1385,order=1,dim=2,gamma=45,c=0.001)
466    class Anisotropic2DOrder1Gamma45_3840k(AnisotropicProblem):
467       def __init__(self):
468          super(Anisotropic2DOrder1Gamma45_3840k,self).__init__(n=1959,order=1,dim=2,gamma=45,c=0.001)
469    class Anisotropic2DOrder1Gamma45_7680k(AnisotropicProblem):
470       def __init__(self):
471          super(Anisotropic2DOrder1Gamma45_7680k,self).__init__(n=2770,order=1,dim=2,gamma=45,c=0.001)
472    class Anisotropic2DOrder1Gamma45_15360k(AnisotropicProblem):
473       def __init__(self):
474          super(Anisotropic2DOrder1Gamma45_15360k,self).__init__(n=3918,order=1,dim=2,gamma=45,c=0.001)
475    class Anisotropic2DOrder2Gamma30_30k(AnisotropicProblem):
476       def __init__(self):
477          super(Anisotropic2DOrder2Gamma30_30k,self).__init__(n=86,order=2,dim=2,gamma=30,c=0.001)
478    class Anisotropic2DOrder2Gamma30_60k(AnisotropicProblem):
479       def __init__(self):
480          super(Anisotropic2DOrder2Gamma30_60k,self).__init__(n=122,order=2,dim=2,gamma=30,c=0.001)
481    class Anisotropic2DOrder2Gamma30_120k(AnisotropicProblem):
482       def __init__(self):
483          super(Anisotropic2DOrder2Gamma30_120k,self).__init__(n=173,order=2,dim=2,gamma=30,c=0.001)
484    class Anisotropic2DOrder2Gamma30_240k(AnisotropicProblem):
485       def __init__(self):
486          super(Anisotropic2DOrder2Gamma30_240k,self).__init__(n=244,order=2,dim=2,gamma=30,c=0.001)
487    class Anisotropic2DOrder2Gamma30_480k(AnisotropicProblem):
488       def __init__(self):
489          super(Anisotropic2DOrder2Gamma30_480k,self).__init__(n=346,order=2,dim=2,gamma=30,c=0.001)
490    class Anisotropic2DOrder2Gamma30_960k(AnisotropicProblem):
491       def __init__(self):
492          super(Anisotropic2DOrder2Gamma30_960k,self).__init__(n=489,order=2,dim=2,gamma=30,c=0.001)
493    class Anisotropic2DOrder2Gamma30_1920k(AnisotropicProblem):
494       def __init__(self):
495          super(Anisotropic2DOrder2Gamma30_1920k,self).__init__(n=692,order=2,dim=2,gamma=30,c=0.001)
496    class Anisotropic2DOrder2Gamma30_3840k(AnisotropicProblem):
497       def __init__(self):
498          super(Anisotropic2DOrder2Gamma30_3840k,self).__init__(n=979,order=2,dim=2,gamma=30,c=0.001)
499    class Anisotropic2DOrder2Gamma30_7680k(AnisotropicProblem):
500       def __init__(self):
501          super(Anisotropic2DOrder2Gamma30_7680k,self).__init__(n=1385,order=2,dim=2,gamma=30,c=0.001)
502    class Anisotropic2DOrder2Gamma30_15360k(AnisotropicProblem):
503       def __init__(self):
504          super(Anisotropic2DOrder2Gamma30_15360k,self).__init__(n=1959,order=2,dim=2,gamma=30,c=0.001)
505    class Anisotropic2DOrder2Gamma45_30k(AnisotropicProblem):
506       def __init__(self):
507          super(Anisotropic2DOrder2Gamma45_30k,self).__init__(n=86,order=2,dim=2,gamma=45,c=0.001)
508    class Anisotropic2DOrder2Gamma45_60k(AnisotropicProblem):
509       def __init__(self):
510          super(Anisotropic2DOrder2Gamma45_60k,self).__init__(n=122,order=2,dim=2,gamma=45,c=0.001)
511    class Anisotropic2DOrder2Gamma45_120k(AnisotropicProblem):
512       def __init__(self):
513          super(Anisotropic2DOrder2Gamma45_120k,self).__init__(n=173,order=2,dim=2,gamma=45,c=0.001)
514    class Anisotropic2DOrder2Gamma45_240k(AnisotropicProblem):
515       def __init__(self):
516          super(Anisotropic2DOrder2Gamma45_240k,self).__init__(n=244,order=2,dim=2,gamma=45,c=0.001)
517    class Anisotropic2DOrder2Gamma45_480k(AnisotropicProblem):
518       def __init__(self):
519          super(Anisotropic2DOrder2Gamma45_480k,self).__init__(n=346,order=2,dim=2,gamma=45,c=0.001)
520    class Anisotropic2DOrder2Gamma45_960k(AnisotropicProblem):
521       def __init__(self):
522          super(Anisotropic2DOrder2Gamma45_960k,self).__init__(n=489,order=2,dim=2,gamma=45,c=0.001)
523    class Anisotropic2DOrder2Gamma45_1920k(AnisotropicProblem):
524       def __init__(self):
525          super(Anisotropic2DOrder2Gamma45_1920k,self).__init__(n=692,order=2,dim=2,gamma=45,c=0.001)
526    class Anisotropic2DOrder2Gamma45_3840k(AnisotropicProblem):
527       def __init__(self):
528          super(Anisotropic2DOrder2Gamma45_3840k,self).__init__(n=979,order=2,dim=2,gamma=45,c=0.001)
529    class Anisotropic2DOrder2Gamma45_7680k(AnisotropicProblem):
530       def __init__(self):
531          super(Anisotropic2DOrder2Gamma45_7680k,self).__init__(n=1385,order=2,dim=2,gamma=45,c=0.001)
532    class Anisotropic2DOrder2Gamma45_15360k(AnisotropicProblem):
533       def __init__(self):
534          super(Anisotropic2DOrder2Gamma45_15360k,self).__init__(n=1959,order=2,dim=2,gamma=45,c=0.001)
535    class Anisotropic3DOrder1Gamma30_30k(AnisotropicProblem):
536       def __init__(self):
537          super(Anisotropic3DOrder1Gamma30_30k,self).__init__(n=30,order=1,dim=3,gamma=30,c=0.001)
538    class Anisotropic3DOrder1Gamma30_60k(AnisotropicProblem):
539       def __init__(self):
540          super(Anisotropic3DOrder1Gamma30_60k,self).__init__(n=38,order=1,dim=3,gamma=30,c=0.001)
541    class Anisotropic3DOrder1Gamma30_120k(AnisotropicProblem):
542       def __init__(self):
543          super(Anisotropic3DOrder1Gamma30_120k,self).__init__(n=48,order=1,dim=3,gamma=30,c=0.001)
544    class Anisotropic3DOrder1Gamma30_240k(AnisotropicProblem):
545       def __init__(self):
546          super(Anisotropic3DOrder1Gamma30_240k,self).__init__(n=61,order=1,dim=3,gamma=30,c=0.001)
547    class Anisotropic3DOrder1Gamma30_480k(AnisotropicProblem):
548       def __init__(self):
549          super(Anisotropic3DOrder1Gamma30_480k,self).__init__(n=77,order=1,dim=3,gamma=30,c=0.001)
550    class Anisotropic3DOrder1Gamma30_960k(AnisotropicProblem):
551       def __init__(self):
552          super(Anisotropic3DOrder1Gamma30_960k,self).__init__(n=98,order=1,dim=3,gamma=30,c=0.001)
553    class Anisotropic3DOrder1Gamma30_1920k(AnisotropicProblem):
554       def __init__(self):
555          super(Anisotropic3DOrder1Gamma30_1920k,self).__init__(n=123,order=1,dim=3,gamma=30,c=0.001)
556    class Anisotropic3DOrder1Gamma30_3840k(AnisotropicProblem):
557       def __init__(self):
558          super(Anisotropic3DOrder1Gamma30_3840k,self).__init__(n=156,order=1,dim=3,gamma=30,c=0.001)
559    class Anisotropic3DOrder1Gamma30_7680k(AnisotropicProblem):
560       def __init__(self):
561          super(Anisotropic3DOrder1Gamma30_7680k,self).__init__(n=196,order=1,dim=3,gamma=30,c=0.001)
562    class Anisotropic3DOrder1Gamma30_15360k(AnisotropicProblem):
563       def __init__(self):
564          super(Anisotropic3DOrder1Gamma30_15360k,self).__init__(n=248,order=1,dim=3,gamma=30,c=0.001)
565    class Anisotropic3DOrder1Gamma45_30k(AnisotropicProblem):
566       def __init__(self):
567          super(Anisotropic3DOrder1Gamma45_30k,self).__init__(n=30,order=1,dim=3,gamma=45,c=0.001)
568    class Anisotropic3DOrder1Gamma45_60k(AnisotropicProblem):
569       def __init__(self):
570          super(Anisotropic3DOrder1Gamma45_60k,self).__init__(n=38,order=1,dim=3,gamma=45,c=0.001)
571    class Anisotropic3DOrder1Gamma45_120k(AnisotropicProblem):
572       def __init__(self):
573          super(Anisotropic3DOrder1Gamma45_120k,self).__init__(n=48,order=1,dim=3,gamma=45,c=0.001)
574    class Anisotropic3DOrder1Gamma45_240k(AnisotropicProblem):
575       def __init__(self):
576          super(Anisotropic3DOrder1Gamma45_240k,self).__init__(n=61,order=1,dim=3,gamma=45,c=0.001)
577    class Anisotropic3DOrder1Gamma45_480k(AnisotropicProblem):
578       def __init__(self):
579          super(Anisotropic3DOrder1Gamma45_480k,self).__init__(n=77,order=1,dim=3,gamma=45,c=0.001)
580    class Anisotropic3DOrder1Gamma45_960k(AnisotropicProblem):
581       def __init__(self):
582          super(Anisotropic3DOrder1Gamma45_960k,self).__init__(n=98,order=1,dim=3,gamma=45,c=0.001)
583    class Anisotropic3DOrder1Gamma45_1920k(AnisotropicProblem):
584       def __init__(self):
585          super(Anisotropic3DOrder1Gamma45_1920k,self).__init__(n=123,order=1,dim=3,gamma=45,c=0.001)
586    class Anisotropic3DOrder1Gamma45_3840k(AnisotropicProblem):
587       def __init__(self):
588          super(Anisotropic3DOrder1Gamma45_3840k,self).__init__(n=156,order=1,dim=3,gamma=45,c=0.001)
589    class Anisotropic3DOrder1Gamma45_7680k(AnisotropicProblem):
590       def __init__(self):
591          super(Anisotropic3DOrder1Gamma45_7680k,self).__init__(n=196,order=1,dim=3,gamma=45,c=0.001)
592    class Anisotropic3DOrder1Gamma45_15360k(AnisotropicProblem):
593       def __init__(self):
594          super(Anisotropic3DOrder1Gamma45_15360k,self).__init__(n=248,order=1,dim=3,gamma=45,c=0.001)
595    class Anisotropic3DOrder2Gamma30_30k(AnisotropicProblem):
596       def __init__(self):
597          super(Anisotropic3DOrder2Gamma30_30k,self).__init__(n=15,order=2,dim=3,gamma=30,c=0.001)
598    class Anisotropic3DOrder2Gamma30_60k(AnisotropicProblem):
599       def __init__(self):
600          super(Anisotropic3DOrder2Gamma30_60k,self).__init__(n=19,order=2,dim=3,gamma=30,c=0.001)
601    class Anisotropic3DOrder2Gamma30_120k(AnisotropicProblem):
602       def __init__(self):
603          super(Anisotropic3DOrder2Gamma30_120k,self).__init__(n=24,order=2,dim=3,gamma=30,c=0.001)
604    class Anisotropic3DOrder2Gamma30_240k(AnisotropicProblem):
605       def __init__(self):
606          super(Anisotropic3DOrder2Gamma30_240k,self).__init__(n=31,order=2,dim=3,gamma=30,c=0.001)
607    class Anisotropic3DOrder2Gamma30_480k(AnisotropicProblem):
608       def __init__(self):
609          super(Anisotropic3DOrder2Gamma30_480k,self).__init__(n=39,order=2,dim=3,gamma=30,c=0.001)
610    class Anisotropic3DOrder2Gamma30_960k(AnisotropicProblem):
611       def __init__(self):
612          super(Anisotropic3DOrder2Gamma30_960k,self).__init__(n=49,order=2,dim=3,gamma=30,c=0.001)
613    class Anisotropic3DOrder2Gamma30_1920k(AnisotropicProblem):
614       def __init__(self):
615          super(Anisotropic3DOrder2Gamma30_1920k,self).__init__(n=62,order=2,dim=3,gamma=30,c=0.001)
616    class Anisotropic3DOrder2Gamma30_3840k(AnisotropicProblem):
617       def __init__(self):
618          super(Anisotropic3DOrder2Gamma30_3840k,self).__init__(n=78,order=2,dim=3,gamma=30,c=0.001)
619    class Anisotropic3DOrder2Gamma30_7680k(AnisotropicProblem):
620       def __init__(self):
621          super(Anisotropic3DOrder2Gamma30_7680k,self).__init__(n=98,order=2,dim=3,gamma=30,c=0.001)
622    class Anisotropic3DOrder2Gamma30_15360k(AnisotropicProblem):
623       def __init__(self):
624          super(Anisotropic3DOrder2Gamma30_15360k,self).__init__(n=124,order=2,dim=3,gamma=30,c=0.001)
625    class Anisotropic3DOrder2Gamma45_30k(AnisotropicProblem):
626       def __init__(self):
627          super(Anisotropic3DOrder2Gamma45_30k,self).__init__(n=15,order=2,dim=3,gamma=45,c=0.001)
628    class Anisotropic3DOrder2Gamma45_60k(AnisotropicProblem):
629       def __init__(self):
630          super(Anisotropic3DOrder2Gamma45_60k,self).__init__(n=19,order=2,dim=3,gamma=45,c=0.001)
631    class Anisotropic3DOrder2Gamma45_120k(AnisotropicProblem):
632       def __init__(self):
633          super(Anisotropic3DOrder2Gamma45_120k,self).__init__(n=24,order=2,dim=3,gamma=45,c=0.001)
634    class Anisotropic3DOrder2Gamma45_240k(AnisotropicProblem):
635       def __init__(self):
636          super(Anisotropic3DOrder2Gamma45_240k,self).__init__(n=31,order=2,dim=3,gamma=45,c=0.001)
637    class Anisotropic3DOrder2Gamma45_480k(AnisotropicProblem):
638       def __init__(self):
639          super(Anisotropic3DOrder2Gamma45_480k,self).__init__(n=39,order=2,dim=3,gamma=45,c=0.001)
640    class Anisotropic3DOrder2Gamma45_960k(AnisotropicProblem):
641       def __init__(self):
642          super(Anisotropic3DOrder2Gamma45_960k,self).__init__(n=49,order=2,dim=3,gamma=45,c=0.001)
643    class Anisotropic3DOrder2Gamma45_1920k(AnisotropicProblem):
644       def __init__(self):
645          super(Anisotropic3DOrder2Gamma45_1920k,self).__init__(n=62,order=2,dim=3,gamma=45,c=0.001)
646    class Anisotropic3DOrder2Gamma45_3840k(AnisotropicProblem):
647       def __init__(self):
648          super(Anisotropic3DOrder2Gamma45_3840k,self).__init__(n=78,order=2,dim=3,gamma=45,c=0.001)
649    class Anisotropic3DOrder2Gamma45_7680k(AnisotropicProblem):
650       def __init__(self):
651          super(Anisotropic3DOrder2Gamma45_7680k,self).__init__(n=98,order=2,dim=3,gamma=45,c=0.001)
652    class Anisotropic3DOrder2Gamma45_15360k(AnisotropicProblem):
653       def __init__(self):
654          super(Anisotropic3DOrder2Gamma45_15360k,self).__init__(n=124,order=2,dim=3,gamma=45,c=0.001)
655    
656  if __name__=="__main__":  if __name__=="__main__":
657     test=""     test=""
658     n0=30000     n0=30000
659     for d in [2,3]:     for d in [2,3]:
660       for o in [1,2]:      for o in [1,2]:
661          for g in [30,45]:
662          for i in range(10):          for i in range(10):
663               dofs=n0*2**i               dofs=n0*2**i
664               n=int((float(dofs)**(1./float(d))-1)/o+0.5)               n=int((float(dofs)**(1./float(d))-1)/o+0.5)
665               name="Laplace%sDOrder%s_%sk"%(d,o,dofs/1000)               name="Anisotropic%sDOrder%sGamma%s_%sk"%(d,o,g,dofs/1000)
666               print "class %s(LaplaceProblem):"%name               print "class %s(AnisotropicProblem):"%name
667               print "   def __init__(self):"               print "   def __init__(self):"
668               print "      super(%s,self).__init__(n=%s,order=%s,dim=%s)"%(name,n,o,d)               print "      super(%s,self).__init__(n=%s,order=%s,dim=%s,gamma=%s,c=0.001)"%(name,n,o,d,g)
669               test+="addProblem(%s())\n"%name               test+="addProblem(%s())\n"%name
670     print test     print test
671    

Legend:
Removed from v.415  
changed lines
  Added in v.416

  ViewVC Help
Powered by ViewVC 1.1.26