# Contents of /trunk/doc/examples/geotutorial/steadystate_variablek.py

Revision 3346 - (show annotations)
Fri Nov 12 01:19:02 2010 UTC (12 years, 4 months ago) by caltinay
File MIME type: text/x-python
File size: 1644 byte(s)
```Replaced usage of esys.escript.util.saveVTK by weipa.saveVTK in all python
scripts.

```
 1 ######################################################## 2 # 3 # Copyright (c) 2003-2010 by University of Queensland 4 # Earth Systems Science Computational Center (ESSCC) 5 6 # 7 # Primary Business: Queensland, Australia 8 # Licensed under the Open Software License version 3.0 9 10 # 11 ######################################################## 12 13 __copyright__="""Copyright (c) 2003-2010 by University of Queensland 14 Earth Systems Science Computational Center (ESSCC) 15 http://www.uq.edu.au/esscc 16 Primary Business: Queensland, Australia""" 17 __license__="""Licensed under the Open Software License version 3.0 18 19 __url__= 20 21 # import tools 22 from esys.escript import * 23 from esys.escript.linearPDEs import LinearPDE 24 from esys.dudley import Rectangle 25 from esys.weipa import saveVTK 26 # dimensions: 27 L0=1.;L1=1.; 28 # height of k interface: 29 H=L1*0.75 30 # bottom temperature: 31 T_bot=100 32 # location, size and value of heat source 33 xc=[0.3,0.4]; r=0.1; Qc=3000 34 # two values for k 35 k0=1; k1=10 36 # create domain: 37 mydomain=Rectangle(l0=L0,l1=L1,n0=20,n1=20) 38 x=mydomain.getX() 39 # set variable k 40 k=k0+(k1-k0)*wherePositive(x[1]-H) 41 # boundary temperature 42 T_D=T_bot/L1*(L1-x[1]) 43 # heat source 44 Q=Qc*whereNegative(length(x-xc)-r) 45 # create PDE and set coefficients: 46 mypde=LinearPDE(mydomain) 47 mypde.setSymmetryOn() 48 # set PDE coefficients: 49 mypde.setValue(A=k*kronecker(mydomain),Y=Q, r=T_D, \ 50 q=whereZero(x[1])+whereZero(x[1]-L1)) 51 # get temperature: 52 T=mypde.getSolution() 53 # save as VTK for visualisation: 54 saveVTK("u.vtu",T=T) 55

 ViewVC Help Powered by ViewVC 1.1.26