COOLFluiD  Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
check.py
Go to the documentation of this file.
1 def cf_check(test):
2  """if the first argument is False it raise an exception with a default message, you can specify the message in the second argument (optional)"""
3  if not test:
4  raise Exception('check failed')
5 
6 def cf_check(test,message):
7  if not test:
8  raise Exception(message)
9 
10 def cf_check_close(a,b,close):
11  """if the absolute difference between the two firsts argument is smaller then the third argument it raise an exception with a default message, you can specify the message in the fourth argument (optional)"""
12  if abs(a-b)>close:
13  raise Exception('check close failed (first value:'+str(a)+', second value:'+str(b)+')')
14 
15 def cf_check_close(a,b,close,message):
16  if abs(a-b)>close:
17  raise Exception(message+' (first value:'+str(a)+', second value:'+str(b)+')')
18 
19 def cf_check_equal(a,b):
20  """if the two firsts arguments are not equal it raise an exception with a default message, you can specify the message in the third argumnt (optional)"""
21  if not a==b:
22  raise Exception('check equal failed (first value:'+str(a)+', second value:'+str(b)+')')
23 
24 def cf_check_equal(a,b,message):
25  if not a==b:
26  raise Exception(message+' (first value:'+str(a)+', second value:'+str(b)+')')
27 
28 def cf_error():
29  """raise an exception with a default message, tou can specify the message in the first argument (optional)"""
30  raise Exception('error occured')
31 
32 def cf_error(message):
33  raise Exception(message)
def cf_error()
Definition: check.py:28
def cf_check_close(a, b, close)
Definition: check.py:10
def cf_check_equal(a, b)
Definition: check.py:19
def cf_check(test)
Definition: check.py:1
Send comments to:
COOLFluiD Web Admin