print 'NILAI C, b, n MIN', sol['c'].min(),',', sol['b'].min(),',', sol['n'].min() else: print 'NILAI C MAX', sol['c'].max() print 'NILAI C MIN', sol['c'].min() #print sol['tip_cell'] if set['con'] == True: #SAVING PICTURES if set['k'] % 10 == 0: if set['layout'] == '2D': pic.pic_2d_con(coef,set,sol) else: #SAVING PICTURES if set['k'] % 1 == 0: if set['layout'] == '2D': pic.pic_2d(coef,set,sol) #3 if set['layout'] == '3D': pic_3d(coef,set,sol) '''Recording Time''' ttime = time.clock() if ttime >= 3600: #jam jam = int(ttime/3600) sisa = ttime - jam*3600 if sisa == 0: print 'total time of processing:', jam, 'hours', 0, 'minutes', 0, 'seconds' elif sisa > 60: menit = int(sisa/60) detik = sisa - menit*60 if detik == 0:
else: print 'NILAI C MAX', sol['c'].max() print 'NILAI C MIN', sol['c'].min() #print sol['tip_cell'] if set['con'] == True: '''SAVING PICTURES''' if set['k'] % 500 == 0: if set['layout'] == '2D': pic_2d_con(coef,set,sol) else: '''SAVING PICTURES''' if set['k'] % 50 == 0: if set['layout'] == '2D': pic_2d(coef,set,sol) if set['layout'] == '3D': pic_3d(coef,set,sol) '''Recording Time''' ttime = time.clock() if ttime >= 3600: #jam jam = int(ttime/3600) sisa = ttime - jam*3600 if sisa == 0: print 'total time of processing:', jam, 'hours', 0, 'minutes', 0, 'seconds' elif sisa > 60: menit = int(sisa/60) detik = sisa - menit*60 if detik == 0: print 'total time of processing:', jam, 'hours', menit, 'minutes', 0, 'seconds'
else: print 'NILAI C MAX', sol['c'].max() print 'NILAI C MIN', sol['c'].min() #print sol['tip_cell'] if set['con'] == True: #SAVING PICTURES if set['k'] % 500 == 0: if set['layout'] == '2D': pic_2d_con(coef,set,sol) else: #SAVING PICTURES if set['k'] % 50 == 0: if set['layout'] == '2D': pic_2d(coef,set,sol) #3 if set['layout'] == '3D': pic_3d(coef,set,sol) '''Recording Time''' ttime = time.clock() if ttime >= 3600: #jam jam = int(ttime/3600) sisa = ttime - jam*3600 if sisa == 0: print 'total time of processing:', jam, 'hours', 0, 'minutes', 0, 'seconds' elif sisa > 60: menit = int(sisa/60) detik = sisa - menit*60 if detik == 0:
from coef_setting import declare_coef #Ref.1 from initial_conditions import initial_prof #Ref.2 import main_code as main #Ref.4 import picture_2d as pic #Ref.5 '''Import additional functions to support calculation and graphics''' import numpy from timeit import default_timer as timer import time import matplotlib.pyplot as plt plt.ion() #to plot interactively '''declare coefficients & initial settings''' coef, set, sol = declare_coef() #Ref.1 '''Initialize functions for k=0 (first iteration), t=0 (initial time)''' sol = initial_prof(coef, set, sol) #Ref.2 pic.pic_2d(coef, set, sol) #to generate the picture of initial condition #Ref.5 print '''All Coefficients:''' print coef print '''All Set''' print set '''PRINTING RESULT AS CONTROL''' print 'at Time', set['t'] print 'Total Tips:', len(sol['matrix_tip']) print 'Total Stop Tips:', len(sol['sp_stop']) print 'Tip Stop:', sol['sp_stop'] print 'Tip Cell Pos:', sol['tip_cell'] print 'Max Value of c, f', sol['c'].max(), ',', sol['f'].max() print 'Min Value of c, f', sol['c'].min(), ',', sol['f'].min() '''Main part of the Hybrid calculation''' while set['t'] <= set['T']: '''Adaptive time step start here''' #Ref.3