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