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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4018 - (show 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
2 ##############################################################################
3 #
4 # Copyright (c) 2011-2012 by University of Queensland
5 # http://www.uq.edu.au
6 #
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 # Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 # Development since 2012 by School of Earth Sciences
13 #
14 ##############################################################################
15
16 __copyright__="""Copyright (c) 2011-2012 by University of Queensland
17 http://www.uq.edu.au
18 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 from .finleycpp import __Brick_driver, __Rectangle_driver
25
26
27 def Rectangle(n0=1, n1=1, order=1, l0=1.0, l1=1.0, periodic0=False, periodic1=False, integrationOrder=-1,
28 reducedIntegrationOrder=-1, useElementsOnFace=None, useFullElementOrder=0, optimize=0, **kwargs):
29 points=[]
30 tags=[]
31 if 'diracPoints' in kwargs:
32 points=kwargs['diracPoints']
33 if 'diracTags' in kwargs:
34 tags=kwargs['diracTags']
35 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 faceon=0 #Don't use it
39 else:
40 faceon=1
41 return __Rectangle_driver([n0, n1, order, l0, l1, periodic0, periodic1, integrationOrder,
42 reducedIntegrationOrder, faceon, useFullElementOrder, optimize, points, tags])
43
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 integrationOrder=-1, reducedIntegrationOrder=-1, useElementsOnFace=1, useFullElementOrder=0,
46 optimize=0, **kwargs):
47 points=[]
48 tags=[]
49 if 'diracPoints' in kwargs:
50 points=kwargs['diracPoints']
51 if 'diracTags' in kwargs:
52 tags=kwargs['diracTags']
53 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 faceon=0 #Don't use it
57 else:
58 faceon=1
59 return __Brick_driver([n0, n1, n2, order, l0, l1, l2, periodic0, periodic1, periodic2,
60 integrationOrder, reducedIntegrationOrder, faceon, useFullElementOrder,
61 optimize, points, tags])

  ViewVC Help
Powered by ViewVC 1.1.26