# Contents of /trunk/finley/test/python/FCT_test0.py

Revision 3825 - (show annotations)
Tue Feb 14 06:11:58 2012 UTC (7 years, 11 months ago) by gross
File MIME type: text/x-python
File size: 1681 byte(s)
```don't call MPI withing parallel regions
```
 1 2 ######################################################## 3 # 4 # Copyright (c) 2003-2010 by University of Queensland 5 # Earth Systems Science Computational Center (ESSCC) 6 7 # 8 # Primary Business: Queensland, Australia 9 # Licensed under the Open Software License version 3.0 10 11 # 12 ######################################################## 13 14 __copyright__="""Copyright (c) 2003-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 20 __url__= 21 22 from esys.escript import * 23 from esys.escript.linearPDEs import TransportPDE 24 from esys.finley import Rectangle, Brick 25 #from esys.ripley import Rectangle, Brick 26 from esys.weipa import saveVTK 27 from math import pi, ceil 28 29 NE=50 30 dom=Rectangle(NE,1,l1=1./NE) 31 dom=Rectangle(NE,NE) 32 fc=TransportPDE(dom,numEquations=1) 33 fc.getSolverOptions().setVerbosityOn() 34 fc.getSolverOptions().setODESolver(fc.getSolverOptions().LINEAR_CRANK_NICOLSON) 35 fc.getSolverOptions().setODESolver(fc.getSolverOptions().BACKWARD_EULER) 36 fc.getSolverOptions().setODESolver(fc.getSolverOptions().CRANK_NICOLSON) 37 fc.setValue(M=1,C=[-1,0]) 38 x=dom.getX() 39 u0=whereNegative(x[0]-1./NE) 40 41 c=0 42 t=0 43 44 saveVTK("u.%s.vtu"%c,u=u0) 45 fc.setInitialSolution(u0) 46 dt=fc.getSafeTimeStepSize() 47 48 print "u0 =",u0 49 T_END=dt 50 print "dt = ",dt 51 while t