1 |
gross |
934 |
# $Id$ |
2 |
|
|
""" |
3 |
|
|
some mesh handling |
4 |
|
|
|
5 |
|
|
@var __author__: name of author |
6 |
|
|
@var __licence__: licence agreement |
7 |
|
|
@var __url__: url entry point on documentation |
8 |
|
|
@var __version__: version |
9 |
|
|
@var __date__: date of the version |
10 |
|
|
""" |
11 |
|
|
|
12 |
|
|
__copyright__=""" Copyright (c) 2006, 2007 by ACcESS MNRF |
13 |
|
|
http://www.access.edu.au |
14 |
|
|
Primary Business: Queensland, Australia""" |
15 |
|
|
__license__="""Licensed under the Open Software License version 3.0 |
16 |
|
|
http://www.opensource.org/licenses/osl-3.0.php""" |
17 |
|
|
__author__="Lutz Gross, l.gross@uq.edu.au" |
18 |
|
|
__url__="http://www.iservo.edu.au/esys/escript" |
19 |
|
|
__version__="$Revision$" |
20 |
|
|
__date__="$Date$" |
21 |
|
|
|
22 |
|
|
from esys.escript import * |
23 |
|
|
from esys.pycad.gmsh import Design as GMSHDesign |
24 |
|
|
from finleycpp import ReadGmsh |
25 |
|
|
|
26 |
|
|
def MakeDomain(design,integrationOrder=-1, reducedIntegrationOrder=-1, optimizeLabeling=True): |
27 |
|
|
""" |
28 |
|
|
creates a Finley L{Domain} from a L{esys.pycad.design.Design} object. Currently only |
29 |
|
|
gmsh is supported. |
30 |
|
|
|
31 |
|
|
@param design: the geometry |
32 |
|
|
@type design: L{esys.pycad.design.Design} |
33 |
|
|
@param integrationOrder: integration order. If -1 the default is used. |
34 |
|
|
@type integrationOrder: C{int} |
35 |
|
|
@param reducedIntegrationOrder: reduced integration order. If -1 the default is used. |
36 |
|
|
@type reducedIntegrationOrder: C{int} |
37 |
|
|
@param optimizeLabeling: if set the labeling of the mesh nodes is optimized |
38 |
ksteube |
990 |
@type optimizeLabeling: C{bool} |
39 |
gross |
934 |
@return: the Finley domain defined by the designs |
40 |
|
|
@rtype: L{Domain} |
41 |
|
|
""" |
42 |
|
|
if isinstance(design, GMSHDesign): |
43 |
|
|
mshname=design.getMeshHandler() |
44 |
|
|
dom = ReadGmsh(mshname, |
45 |
|
|
design.getDim(), |
46 |
|
|
integrationOrder, |
47 |
|
|
reducedIntegrationOrder, |
48 |
|
|
optimizeLabeling) |
49 |
|
|
else: |
50 |
|
|
raise TypeError("Finley does not support %s designs."%design.__class__.__name__) |
51 |
gross |
1044 |
# fill in the tag map |
52 |
|
|
design.getTagMap().passToDomain(dom) |
53 |
gross |
934 |
return dom |