/[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 5863 - (hide annotations)
Wed Jan 13 02:25:48 2016 UTC (3 years, 3 months ago) by jfenwick
File MIME type: text/x-python
File size: 4122 byte(s)
Copyright dates updated.
\version for doxygen to read

1 jfenwick 3558
2 jfenwick 3981 ##############################################################################
3 jfenwick 3558 #
4 jfenwick 5863 # Copyright (c) 2011-2016 by The 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 sshaw 5706 from __future__ import print_function, division
18    
19 jfenwick 5863 __copyright__="""Copyright (c) 2011-2016 by The University of Queensland
20 jfenwick 3981 http://www.uq.edu.au
21 jfenwick 3558 Primary Business: Queensland, Australia"""
22     __license__="""Licensed under the Open Software License version 3.0
23     http://www.opensource.org/licenses/osl-3.0.php"""
24     __url__="https://launchpad.net/escript-finley"
25    
26    
27 jfenwick 4945 from .finleycpp import __Brick_driver, __Rectangle_driver, __ReadMesh_driver, __ReadGmsh_driver
28 jfenwick 3558
29    
30 jfenwick 4945 def ReadMesh(filename, integrationOrder=-1, reducedIntegrationOrder=-1, optimize=True, **kwargs):
31     points=[]
32     tags=[]
33     if 'diracPoints' in kwargs:
34     points=kwargs['diracPoints']
35     if 'diracTags' in kwargs:
36     tags=kwargs['diracTags']
37     args=[filename, integrationOrder, reducedIntegrationOrder, optimize, points, tags];
38     if 'escriptworld' in kwargs:
39     args+=[kwargs['escriptworld']]
40     else:
41     args+=[None]
42     return __ReadMesh_driver(args)
43    
44 jfenwick 5539 ReadMesh.__doc__=__ReadMesh_driver.__doc__
45 jfenwick 4945
46     def ReadGmsh(fileName, numDim, integrationOrder=-1, reducedIntegrationOrder=-1, optimize=True,
47     useMacroElements=False, **kwargs):
48     points=[]
49     tags=[]
50     if 'diracPoints' in kwargs:
51     points=kwargs['diracPoints']
52     if 'diracTags' in kwargs:
53     tags=kwargs['diracTags']
54     args=[fileName, numDim, integrationOrder, reducedIntegrationOrder, optimize,
55     useMacroElements, points, tags];
56     if 'escriptworld' in kwargs:
57     args+=[kwargs['escriptworld']]
58     else:
59     args+=[None]
60     return __ReadGmsh_driver(args)
61    
62 jfenwick 5539 ReadGmsh.__doc__=__ReadGmsh_driver.__doc__
63 jfenwick 4945
64 jfenwick 5539
65 jfenwick 3558 def Rectangle(n0=1, n1=1, order=1, l0=1.0, l1=1.0, periodic0=False, periodic1=False, integrationOrder=-1,
66 jfenwick 3907 reducedIntegrationOrder=-1, useElementsOnFace=None, useFullElementOrder=0, optimize=0, **kwargs):
67 jfenwick 3558 points=[]
68     tags=[]
69     if 'diracPoints' in kwargs:
70 jfenwick 3892 points=kwargs['diracPoints']
71 jfenwick 3558 if 'diracTags' in kwargs:
72 jfenwick 3892 tags=kwargs['diracTags']
73 jfenwick 3907 faceon=useElementsOnFace
74 sshaw 5705 if useElementsOnFace is None: #We want to use 1 as the default, but only where it makes sense
75 jfenwick 3907 if useFullElementOrder or order==-1:
76 sshaw 5705 faceon=0 #Don't use it
77 jfenwick 4018 else:
78     faceon=1
79 jfenwick 4934 args=[n0, n1, order, l0, l1, periodic0, periodic1, integrationOrder,
80     reducedIntegrationOrder, faceon, useFullElementOrder, optimize, points, tags];
81     if 'escriptworld' in kwargs:
82     args+=[kwargs['escriptworld']]
83     else:
84     args+=[None]
85     return __Rectangle_driver(args)
86 jfenwick 3558
87 jfenwick 5539 Rectangle.__doc__=__Rectangle_driver.__doc__
88    
89 jfenwick 3558 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,
90 jfenwick 3901 integrationOrder=-1, reducedIntegrationOrder=-1, useElementsOnFace=1, useFullElementOrder=0,
91 jfenwick 3558 optimize=0, **kwargs):
92     points=[]
93     tags=[]
94     if 'diracPoints' in kwargs:
95 jfenwick 3892 points=kwargs['diracPoints']
96 jfenwick 3558 if 'diracTags' in kwargs:
97 jfenwick 3892 tags=kwargs['diracTags']
98 jfenwick 3907 faceon=useElementsOnFace
99 sshaw 5705 if useElementsOnFace is None: #We want to use 1 as the default, but only where it makes sense
100 jfenwick 3907 if useFullElementOrder or order==-1:
101 sshaw 5705 faceon=0 #Don't use it
102 jfenwick 4018 else:
103 jfenwick 4934 faceon=1
104     args=[n0, n1, n2, order, l0, l1, l2, periodic0, periodic1, periodic2,
105 jfenwick 3907 integrationOrder, reducedIntegrationOrder, faceon, useFullElementOrder,
106 jfenwick 4934 optimize, points, tags];
107     if 'escriptworld' in kwargs:
108     args+=[kwargs['escriptworld']]
109     else:
110     args+=[None]
111     return __Brick_driver(args)
112 jfenwick 5539
113     Brick.__doc__=__Brick_driver.__doc__

  ViewVC Help
Powered by ViewVC 1.1.26