/[escript]/trunk/doc/examples/cookbook/example11m.py
ViewVC logotype

Contents of /trunk/doc/examples/cookbook/example11m.py

Parent Directory Parent Directory | Revision Log Revision Log


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



1
2 ########################################################
3 #
4 # Copyright (c) 2009-2010 by University of Queensland
5 # Earth Systems Science Computational Center (ESSCC)
6 # http://www.uq.edu.au/esscc
7 #
8 # 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 #
12 ########################################################
13
14 __copyright__="""Copyright (c) 2009-2010 by University of Queensland
15 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 __url__="https://launchpad.net/escript-finley"
21
22 """
23 Author: Antony Hallam antony.hallam@uqconnect.edu.au
24 """
25
26
27 ############################################################FILE HEADER
28 # example09m.py
29 # Create a simple 3D model for use in example09. This is the low res
30 # mesh for illustration purposes only.
31 #
32 #######################################################EXTERNAL MODULES
33 from esys.pycad import * #domain constructor
34 from esys.pycad.extras import layer_cake
35 from esys.pycad.gmsh import Design #Finite Element meshing package
36 from esys.finley import MakeDomain #Converter for escript
37 from esys.escript import mkDir, getMPISizeWorld
38 import os
39 ########################################################MPI WORLD CHECK
40 if getMPISizeWorld() > 1:
41 import sys
42 print("This example will not run in an MPI world.")
43 sys.exit(0)
44
45 # make sure path exists
46 save_path= os.path.join("data","example11")
47 mkDir(save_path)
48
49 ################################################ESTABLISHING PARAMETERS
50 #Model Parameters
51 xwidth=500.0 #x width of model
52 ywidth=500.0 #y width of model
53 depth=250.0 #depth of model
54 element_size=5.0
55
56 intfaces=[50,100,200,250]
57
58 #Specify the domain.
59 domaindes=Design(dim=3,element_size=element_size,order=1)
60 cmplx_domain=layer_cake(domaindes,xwidth,ywidth,intfaces)
61 cmplx_domain.setScriptFileName(os.path.join(save_path,"example11lc.geo"))
62 cmplx_domain.setMeshFileName(os.path.join(save_path,"example11lc.msh"))
63 dcmplx=MakeDomain(cmplx_domain)
64 dcmplx.write(os.path.join(save_path,"example11lc.fly"))
65
66
67
68

  ViewVC Help
Powered by ViewVC 1.1.26