COOLFluiD  Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
utest-python-table.py
Go to the documentation of this file.
1 from coolfluid import *
2 
3 root = Core.root()
4 env = Core.environment()
5 
6 env.options().set('assertion_backtrace', False)
7 env.options().set('exception_backtrace', False)
8 env.options().set('regist_signal_handlers', False)
9 env.options().set('exception_log_level', 0)
10 env.options().set('log_level', 4)
11 env.options().set('exception_outputs', False)
12 
13 table = root.create_component("table", "cf3.common.Table<unsigned>")
14 
15 cf_check_equal(len(table),0,'Created table was not size 0')
16 
17 table.set_row_size(2)
18 table.resize(10)
19 
20 cf_check_equal(len(table),10,'Incorrect table size')
21 
22 cf_check_equal(len(table[0]),2,'Incorrect table column count')
23 
24 table[0] = [1, 2]
25 print 'First table row is', table[0]
26 
27 cf_check(table[0][0] == 1 and table[0][1] == 2,'First table row is incorrect')
28 
29 table[1] = table[0]
30 print table[1]
31 
32 cf_check(table[1][0] == 1 and table[1][1] == 2,'Second table row is incorrect')
33 
34 table[0][0] += 1
35 print table[0]
36 cf_check_equal(table[0][0],2,'Table increment failed')
37 
38 print 'Full table:'
39 print table
def cf_check_equal(a, b)
Definition: check.py:19
def cf_check(test)
Definition: check.py:1
Send comments to:
COOLFluiD Web Admin