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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4018 - (hide annotations)
Thu Oct 11 04:43:39 2012 UTC (6 years, 6 months ago) by jfenwick
File MIME type: text/x-python
File size: 2504 byte(s)
Used "new" raise syntax in a few places
Fixed some tabbing
Fixed some funnies involving changes to xrange/range
added a quick and nasty __hash__ function to Symbol
   def __hash__(self):
        return id(self)
This does mean that __hash__ and == do not match exactly.   Not sure if that matters for our purposes
1 jfenwick 3558
2 jfenwick 3981 ##############################################################################
3 jfenwick 3558 #
4 jfenwick 3911 # Copyright (c) 2011-2012 by University of Queensland
5 jfenwick 3981 # http://www.uq.edu.au
6 jfenwick 3558 #
7     # Primary Business: Queensland, Australia
8     # Licensed under the Open Software License version 3.0
9     # http://www.opensource.org/licenses/osl-3.0.php
10     #
11 jfenwick 3981 # Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12     # Development since 2012 by School of Earth Sciences
13     #
14     ##############################################################################
15 jfenwick 3558
16 jfenwick 3911 __copyright__="""Copyright (c) 2011-2012 by University of Queensland
17 jfenwick 3981 http://www.uq.edu.au
18 jfenwick 3558 Primary Business: Queensland, Australia"""
19     __license__="""Licensed under the Open Software License version 3.0
20     http://www.opensource.org/licenses/osl-3.0.php"""
21     __url__="https://launchpad.net/escript-finley"
22    
23    
24 jfenwick 3892 from .finleycpp import __Brick_driver, __Rectangle_driver
25 jfenwick 3558
26    
27     def Rectangle(n0=1, n1=1, order=1, l0=1.0, l1=1.0, periodic0=False, periodic1=False, integrationOrder=-1,
28 jfenwick 3907 reducedIntegrationOrder=-1, useElementsOnFace=None, useFullElementOrder=0, optimize=0, **kwargs):
29 jfenwick 3558 points=[]
30     tags=[]
31     if 'diracPoints' in kwargs:
32 jfenwick 3892 points=kwargs['diracPoints']
33 jfenwick 3558 if 'diracTags' in kwargs:
34 jfenwick 3892 tags=kwargs['diracTags']
35 jfenwick 3907 faceon=useElementsOnFace
36     if useElementsOnFace is None: #We want to use 1 as the default, but only where it makes sense
37     if useFullElementOrder or order==-1:
38 jfenwick 4018 faceon=0 #Don't use it
39     else:
40     faceon=1
41 jfenwick 3558 return __Rectangle_driver([n0, n1, order, l0, l1, periodic0, periodic1, integrationOrder,
42 jfenwick 3907 reducedIntegrationOrder, faceon, useFullElementOrder, optimize, points, tags])
43 jfenwick 3558
44     def Brick(n0=1, n1=1, n2=1, order=1, l0=1.0, l1=1.0, l2=1.0, periodic0=0, periodic1=0, periodic2=0,
45 jfenwick 3901 integrationOrder=-1, reducedIntegrationOrder=-1, useElementsOnFace=1, useFullElementOrder=0,
46 jfenwick 3558 optimize=0, **kwargs):
47     points=[]
48     tags=[]
49     if 'diracPoints' in kwargs:
50 jfenwick 3892 points=kwargs['diracPoints']
51 jfenwick 3558 if 'diracTags' in kwargs:
52 jfenwick 3892 tags=kwargs['diracTags']
53 jfenwick 3907 faceon=useElementsOnFace
54     if useElementsOnFace is None: #We want to use 1 as the default, but only where it makes sense
55     if useFullElementOrder or order==-1:
56 jfenwick 4018 faceon=0 #Don't use it
57     else:
58     faceon=1
59 jfenwick 3558 return __Brick_driver([n0, n1, n2, order, l0, l1, l2, periodic0, periodic1, periodic2,
60 jfenwick 3907 integrationOrder, reducedIntegrationOrder, faceon, useFullElementOrder,
61 jfenwick 3892 optimize, points, tags])

  ViewVC Help
Powered by ViewVC 1.1.26