/[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 4934 - (hide annotations)
Tue May 13 00:28:11 2014 UTC (4 years, 11 months ago) by jfenwick
File MIME type: text/x-python
File size: 2792 byte(s)
This commit is brought to you by the number 4934 and the tool "meld".
Merge of partially complete split world code from branch.



1 jfenwick 3558
2 jfenwick 3981 ##############################################################################
3 jfenwick 3558 #
4 jfenwick 4657 # Copyright (c) 2011-2014 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 jfenwick 4657 # Development 2012-2013 by School of Earth Sciences
13     # Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 jfenwick 3981 #
15     ##############################################################################
16 jfenwick 3558
17 jfenwick 4657 __copyright__="""Copyright (c) 2011-2014 by University of Queensland
18 jfenwick 3981 http://www.uq.edu.au
19 jfenwick 3558 Primary Business: Queensland, Australia"""
20     __license__="""Licensed under the Open Software License version 3.0
21     http://www.opensource.org/licenses/osl-3.0.php"""
22     __url__="https://launchpad.net/escript-finley"
23    
24    
25 jfenwick 3892 from .finleycpp import __Brick_driver, __Rectangle_driver
26 jfenwick 3558
27    
28     def Rectangle(n0=1, n1=1, order=1, l0=1.0, l1=1.0, periodic0=False, periodic1=False, integrationOrder=-1,
29 jfenwick 3907 reducedIntegrationOrder=-1, useElementsOnFace=None, useFullElementOrder=0, optimize=0, **kwargs):
30 jfenwick 3558 points=[]
31     tags=[]
32     if 'diracPoints' in kwargs:
33 jfenwick 3892 points=kwargs['diracPoints']
34 jfenwick 3558 if 'diracTags' in kwargs:
35 jfenwick 3892 tags=kwargs['diracTags']
36 jfenwick 3907 faceon=useElementsOnFace
37     if useElementsOnFace is None: #We want to use 1 as the default, but only where it makes sense
38     if useFullElementOrder or order==-1:
39 jfenwick 4018 faceon=0 #Don't use it
40     else:
41     faceon=1
42 jfenwick 4934 args=[n0, n1, order, l0, l1, periodic0, periodic1, integrationOrder,
43     reducedIntegrationOrder, faceon, useFullElementOrder, optimize, points, tags];
44     if 'escriptworld' in kwargs:
45     args+=[kwargs['escriptworld']]
46     else:
47     args+=[None]
48     return __Rectangle_driver(args)
49 jfenwick 3558
50     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,
51 jfenwick 3901 integrationOrder=-1, reducedIntegrationOrder=-1, useElementsOnFace=1, useFullElementOrder=0,
52 jfenwick 3558 optimize=0, **kwargs):
53     points=[]
54     tags=[]
55     if 'diracPoints' in kwargs:
56 jfenwick 3892 points=kwargs['diracPoints']
57 jfenwick 3558 if 'diracTags' in kwargs:
58 jfenwick 3892 tags=kwargs['diracTags']
59 jfenwick 3907 faceon=useElementsOnFace
60     if useElementsOnFace is None: #We want to use 1 as the default, but only where it makes sense
61     if useFullElementOrder or order==-1:
62 jfenwick 4018 faceon=0 #Don't use it
63     else:
64 jfenwick 4934 faceon=1
65     args=[n0, n1, n2, order, l0, l1, l2, periodic0, periodic1, periodic2,
66 jfenwick 3907 integrationOrder, reducedIntegrationOrder, faceon, useFullElementOrder,
67 jfenwick 4934 optimize, points, tags];
68     if 'escriptworld' in kwargs:
69     args+=[kwargs['escriptworld']]
70     else:
71     args+=[None]
72     return __Brick_driver(args)

  ViewVC Help
Powered by ViewVC 1.1.26