/[escript]/trunk/dudley/py_src/readers.py
ViewVC logotype

Annotation of /trunk/dudley/py_src/readers.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3892 - (hide annotations)
Tue Apr 10 08:57:23 2012 UTC (7 years ago) by jfenwick
File MIME type: text/x-python
File size: 2724 byte(s)
Merged changes across from the attempt2 branch.
This version builds and passes python2 tests.
It also passes most python3 tests.



1 ksteube 1809
2     ########################################################
3 ksteube 1312 #
4 jfenwick 2881 # Copyright (c) 2003-2010 by University of Queensland
5 ksteube 1809 # Earth Systems Science Computational Center (ESSCC)
6     # http://www.uq.edu.au/esscc
7 ksteube 1312 #
8 ksteube 1809 # Primary Business: Queensland, Australia
9     # Licensed under the Open Software License version 3.0
10     # http://www.opensource.org/licenses/osl-3.0.php
11 ksteube 1312 #
12 ksteube 1809 ########################################################
13 ksteube 1312
14 jfenwick 2881 __copyright__="""Copyright (c) 2003-2010 by University of Queensland
15 ksteube 1809 Earth Systems Science Computational Center (ESSCC)
16     http://www.uq.edu.au/esscc
17     Primary Business: Queensland, Australia"""
18     __license__="""Licensed under the Open Software License version 3.0
19     http://www.opensource.org/licenses/osl-3.0.php"""
20 jfenwick 2344 __url__="https://launchpad.net/escript-finley"
21 ksteube 1809
22 gross 934 """
23 caltinay 2180 some mesh handling
24 gross 934
25 jfenwick 2625 :var __author__: name of author
26     :var __licence__: licence agreement
27     :var __url__: url entry point on documentation
28     :var __version__: version
29     :var __date__: date of the version
30 gross 934 """
31    
32 jfenwick 3082 __author__="Lutz Gross, l.gross@uq.edu.au, Joel Fenwick"
33 gross 934
34     from esys.pycad.gmsh import Design as GMSHDesign
35 jfenwick 3892 from .dudleycpp import ReadGmsh
36 gross 934
37 gross 2748 def MakeDomain(design,integrationOrder=-1, reducedIntegrationOrder=-1, optimizeLabeling=True, useMacroElements=False):
38 caltinay 2180 """
39 jfenwick 3088 Creates a Dudley `Domain` from a `esys.pycad.design.Design` object.
40 caltinay 2180 Currently only gmsh is supported.
41 gross 934
42 jfenwick 2625 :param design: the geometry
43     :type design: `esys.pycad.design.Design`
44     :param integrationOrder: integration order. If -1 the default is used.
45     :type integrationOrder: ``int``
46     :param reducedIntegrationOrder: reduced integration order. If -1 the
47 caltinay 2180 default is used.
48 jfenwick 2625 :type reducedIntegrationOrder: ``int``
49     :param optimizeLabeling: if set the labeling of the mesh nodes is optimized
50     :type optimizeLabeling: ``bool``
51 gross 2748 :param useMacroElements: uses macro elements.
52     :type useMacroElements: ``bool``
53 jfenwick 2625 :return: the Finley domain defined by the design
54     :rtype: `Domain`
55 caltinay 2180 """
56 jfenwick 3126 if useMacroElements:
57 jfenwick 3892 raise TypeError("Dudley does not support macro elements")
58 caltinay 2180 if isinstance(design, GMSHDesign):
59 jfenwick 3126 design.setElementOrder(1)
60 gross 2717 ff=design.getFileFormat()
61     design.setFileFormat(design.GMSH)
62 caltinay 2180 mshname=design.getMeshHandler()
63     dom = ReadGmsh(mshname,
64     design.getDim(),
65     integrationOrder,
66     reducedIntegrationOrder,
67 gross 2748 optimizeLabeling,
68     useMacroElements)
69 gross 2717 design.setFileFormat(ff)
70 caltinay 2180 else:
71 jfenwick 3082 raise TypeError("Dudley does not support %s designs."%design.__class__.__name__)
72 caltinay 2180 # fill in the tag map
73     design.getTagMap().passToDomain(dom)
74     return dom
75    

  ViewVC Help
Powered by ViewVC 1.1.26