Esempio n. 1
0
def plot():
    
    system                          =   'spiral_w_wave_sqr'
    nr, nphi, phiperiod             =   20, 40, pi/3
    
    from os import listdir
    
    input_file_folder_consts        =   '/space/tohekorh/Spiral/bender_input/calc/consts/' \
                                           + '%s/phiper=%.2f/nr-nphi=%i-%i/'  \
                                            %(system, phiperiod, nr, nphi)
        #input_file_folder_moldy     =   '/space/tohekorh/Spiral/bender_input/calc/moldy/'

    
    for input_folder in listdir(input_file_folder_consts):
        input_file_folder   = input_file_folder_consts + input_folder + '/'
        
        if input_folder != 'store':
            for input_file in listdir(input_file_folder):
                if input_file[-3:] == 'txt':
                    if has_been_calculated(input_file_folder + input_file, 'read'):
                        in_file =  input_file_folder + input_file
                        if query_yes_no("plot this " + input_file, 'no'):
                            #study_height_synopsis(in_file)
                            #plot_e_surfaces(in_file, show = True)
                            #study_height_synopsis(in_file)
                            study_consts_proximity(in_file, acc = 30)
                        #ue              =   parse_u_from_file(input_file_folder +  input_file)
                        #params          =   read_bender_output(input_file_folder +  input_file)[0]
                        #ue.set_const(params[("consts")])
                        #energies        =   deform_energies(ue)
                        #E_b, E_s, E_b_surf, E_s_surf, normals  = energies.calc_energies()
                        
    write_total_synopsis(nr, nphi, phiperiod, system, input_file_folder_consts)
    
    study_total_synopsis(nr, nphi, phiperiod, system)
Esempio n. 2
0
def run():
    
    from os import listdir

    system_sets  =  get_sys_sets() 
    
    for system_set in system_sets:
        
        system                          =   system_set[0] 
        [nr, nphi], phiperiod           =   system_set[1:3]
        moldy                           =   system_set[3]
        print nr,nphi, moldy
        
        gc.enable()
        
        input_file_folder_consts        =   '/space/tohekorh/Spiral/bender_input/calc/%s/' %moldy \
                                               + '%s/phiper=%.2f/nr-nphi=%i-%i/'  \
                                                %(system, phiperiod, nr, nphi)
            #input_file_folder_moldy     =   '/space/tohekorh/Spiral/bender_input/calc/moldy/'
        
        path_log    =   '/space/tohekorh/Spiral/bender_output/%s/' %system   
        
        if not exists(path_log):
            makedirs(path_log)

        
        for input_folder in listdir(input_file_folder_consts):
            input_file_folder   = input_file_folder_consts + input_folder + '/'
            
            if input_folder != 'store':
                for input_file in listdir(input_file_folder):
                    if input_file[-3:] == 'txt':
                        if not has_been_calculated(input_file_folder + input_file, 'read'):
                            logfile     =   open(path_log + 'logfile.txt', 'a')
                            in_file     =   input_file_folder + input_file
                            logfile.write(str(datetime.now()) + ' \n') 
                            logfile.write(str(system_set) + ' \n')
                            try:   
                            #if query_yes_no('system = %s, moldy = %s' %(system, moldy) + " run this " + input_file, 'no'):
                                param_set   =   parse_input(input_file_folder + input_file)
                                
                                run_bender(param_set, in_file)
                                
                                unreached   = gc.collect()
                                del gc.garbage[:]
                                print 'in collect there was %i unreached objects' %unreached
                                logfile.write(input_file + ' SUCCESS! \n\n')
                                has_been_calculated(in_file, 'write_ok')
                                
                            except Exception as e:
                                logfile.write(str(e) + ' \n')
                                logfile.write(input_file + ' ERROR! \n\n')
                                has_been_calculated(in_file, 'write_not_ok')
                                
                            logfile.close()
        
        if system != 'spiral':
            write_total_synopsis(nr, nphi, phiperiod, system, input_file_folder_consts)
            study_total_synopsis(nr, nphi, phiperiod, system)