-
Notifications
You must be signed in to change notification settings - Fork 3
/
burn.py
executable file
·49 lines (35 loc) · 1007 Bytes
/
burn.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env python
"""
burn.py
A model of burning materials
"""
import sys
import os
from time import clock
# add path to scripts
sys.path.insert(0, "/home/fenics/shared/scripts")
import meshing
import model
import solution
# read input file module from command line
input_file = os.path.splitext(sys.argv[1])[0]
data = __import__(input_file)
# create directory in "./output_name/" for storing results
out_path = r"./output_" + data.name
if not os.path.exists(out_path):
os.makedirs(out_path)
print ""
print " --- Burning " + data.name + " --- "
print ""
# build mesh and boundary
mesh_objects = meshing.define_objects( data )
# define transport problem
[ problem, z, z0 ] = model.define_problem( data, mesh_objects )
start = clock()
# solve coupled problem in time
solution.solve( data, out_path, mesh_objects, problem, z, z0 )
elapsed = clock() - start
print ""
print " --- Finished burning " + data.name + " --- "
print " Total wall-clock time = ", elapsed, " s"
print ""