/[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 6112 - (show annotations)
Thu Mar 31 09:40:10 2016 UTC (3 years ago) by jfenwick
File MIME type: text/x-python
File size: 4102 byte(s)
Relicense all the things!


1
2 ##############################################################################
3 #
4 # Copyright (c) 2011-2016 by The University of Queensland
5 # http://www.uq.edu.au
6 #
7 # Primary Business: Queensland, Australia
8 # Licensed under the Apache License, version 2.0
9 # http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 # Development 2012-2013 by School of Earth Sciences
13 # Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 #
15 ##############################################################################
16
17 from __future__ import print_function, division
18
19 __copyright__="""Copyright (c) 2011-2016 by The University of Queensland
20 http://www.uq.edu.au
21 Primary Business: Queensland, Australia"""
22 __license__="""Licensed under the Apache License, version 2.0
23 http://www.apache.org/licenses/LICENSE-2.0"""
24 __url__="https://launchpad.net/escript-finley"
25
26
27 from .finleycpp import __Brick_driver, __Rectangle_driver, __ReadMesh_driver, __ReadGmsh_driver
28
29
30 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 ReadMesh.__doc__=__ReadMesh_driver.__doc__
45
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 ReadGmsh.__doc__=__ReadGmsh_driver.__doc__
63
64
65 def Rectangle(n0=1, n1=1, order=1, l0=1.0, l1=1.0, periodic0=False, periodic1=False, integrationOrder=-1,
66 reducedIntegrationOrder=-1, useElementsOnFace=None, useFullElementOrder=0, optimize=0, **kwargs):
67 points=[]
68 tags=[]
69 if 'diracPoints' in kwargs:
70 points=kwargs['diracPoints']
71 if 'diracTags' in kwargs:
72 tags=kwargs['diracTags']
73 faceon=useElementsOnFace
74 if useElementsOnFace is None: #We want to use 1 as the default, but only where it makes sense
75 if useFullElementOrder or order==-1:
76 faceon=0 #Don't use it
77 else:
78 faceon=1
79 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
87 Rectangle.__doc__=__Rectangle_driver.__doc__
88
89 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 integrationOrder=-1, reducedIntegrationOrder=-1, useElementsOnFace=1, useFullElementOrder=0,
91 optimize=0, **kwargs):
92 points=[]
93 tags=[]
94 if 'diracPoints' in kwargs:
95 points=kwargs['diracPoints']
96 if 'diracTags' in kwargs:
97 tags=kwargs['diracTags']
98 faceon=useElementsOnFace
99 if useElementsOnFace is None: #We want to use 1 as the default, but only where it makes sense
100 if useFullElementOrder or order==-1:
101 faceon=0 #Don't use it
102 else:
103 faceon=1
104 args=[n0, n1, n2, order, l0, l1, l2, periodic0, periodic1, periodic2,
105 integrationOrder, reducedIntegrationOrder, faceon, useFullElementOrder,
106 optimize, points, tags];
107 if 'escriptworld' in kwargs:
108 args+=[kwargs['escriptworld']]
109 else:
110 args+=[None]
111 return __Brick_driver(args)
112
113 Brick.__doc__=__Brick_driver.__doc__

  ViewVC Help
Powered by ViewVC 1.1.26