/[escript]/trunk/modellib/test/python/run_temp.py
ViewVC logotype

Contents of /trunk/modellib/test/python/run_temp.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1312 - (show annotations)
Mon Sep 24 06:18:44 2007 UTC (12 years, 10 months ago) by ksteube
File MIME type: text/x-python
File size: 2088 byte(s)
The MPI branch is hereby closed. All future work should be in trunk.

Previously in revision 1295 I merged the latest changes to trunk into trunk-mpi-branch.
In this revision I copied all files from trunk-mpi-branch over the corresponding
trunk files. I did not use 'svn merge', it was a copy.

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 # small test problem fro temperture advection:
19 #
20 # T=x0*x1*exp(-t), v=[1,-1]
21 #
22 __copyright__=""" Copyright (c) 2006 by ACcESS MNRF
23 http://www.access.edu.au
24 Primary Business: Queensland, Australia"""
25 __license__="""Licensed under the Open Software License version 3.0
26 http://www.opensource.org/licenses/osl-3.0.php"""
27
28 from esys.escript.modelframe import Link,Simulation
29 from esys.modellib.geometry import RectangularDomain,ScalarConstrainerOverBox
30 from esys.modellib.input import Sequencer
31 from esys.modellib.probe import Probe,EvaluateExpression
32 from esys.modellib.temperature import TemperatureAdvection
33 import numarray
34 import os
35
36 dom=RectangularDomain()
37 dom.order=2
38
39 sqe=Sequencer()
40 sqe.t=0
41 sqe.t_end=0.05
42
43 constraints=ScalarConstrainerOverBox()
44 constraints.domain=Link(dom)
45 constraints.top=1
46 constraints.bottom=1
47 constraints.right=1
48 constraints.left=1
49
50 source=EvaluateExpression()
51 source.domain=Link(dom)
52 source.expression="(x[1]-x[0])*exp(-t)-exp(-t)*x[0]*x[1]"
53 source.t=Link(sqe)
54 boundaryvalue=EvaluateExpression()
55 boundaryvalue.domain=Link(dom)
56 boundaryvalue.expression="x[0]*x[1]*exp(-t)"
57 boundaryvalue.t=Link(sqe)
58
59 tt=TemperatureAdvection()
60 tt.domain=Link(dom)
61 tt.temperature=Link(boundaryvalue,"out")
62 tt.velocity=numarray.array([1,-1])
63 tt.thermal_source=Link(source,"out")
64 tt.location_fixed_temperature=Link(constraints,"location_of_constraint")
65 tt.fixed_temperature=Link(boundaryvalue,"out")
66 tt.safety_factor=0.1
67
68 probe=Probe()
69 probe.expression="x[0]*x[1]*exp(-t)"
70 probe.t=Link(sqe)
71 probe.value=Link(tt,"temperature")
72
73
74 s=Simulation([sqe,constraints,tt,probe],debug=True)
75 s.writeXML()
76 s.run()

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26