setup.directorymaker(logger, targetdir) setup.directorymaker(logger, '{0}{1}/'.format(targetdir, 'fullpostfiles')) setup.directorymaker(logger, '{0}{1}/'.format(targetdir, 'truncpostfiles')) #####First we'll calculate your isotherm and write a pressure.dat file in your target directory satP = setup.pSat(logger, species[-1], T) istm = setup.isothermcalculator(logger, satP, iso_length, minrelpress, maxrelpress) setup.PressureFileWriter(logger, species[-1], T, satP, istm, targetdir) #goes in the directory above your individual one, gets symbolic linked later ##### Now to make some control files for you setup.GcmcControlChanger(logger, species[-1], sorb_el_list, T, n, framework, '{0}'.format(targetdir), n_iterations, restart, ctrl_file_name, pressure) for i, value in enumerate(istm): #now I make the extra .ctr files to give you final .xyz files for each simulaiton setup.GcmcControlChanger(logger, species[-1], sorb_el_list, T, '1', framework, '{0}'.format(targetdir), '1', 'RESTARTFILE {0}.{1}.res.{2}'.format(framework, species[-1], i+1), '{0}kpa_restart.ctr'.format(value), value) #makes your control files for all of your pressure points setup.PostControlChanger(logger, species[-1], T, n, framework, '{0}'.format(targetdir), '0') setup.PostControlChanger(logger, species[-1], T, n, framework, '{0}'.format(targetdir), '60') setup.GcmcRunWriter(logger, species[-1], T, framework, parentdir, '{0}'.format(targetdir), istm, '')#the last variable is the relative location of your interactions files setup.AtmAtmMover(logger, sorb_el_list, forcefield, coultype, hicut, frameowrk, targetdir) setup.SorbSorbWriter(logger, species[-1], sorb_el_list,framework,targetdir, pmap, emap) setup.IntraWriter(logger, species[-1], sorb_el_list, framework, targetdir) logger.info(''' ################################################################## So I've done the following: Created the directory {0} which will run your simulation. Calculated and written an isotherm between {1} and {2} kPa, then placed in it in {0}. Created a gcmc.ctr file, 2 post control files, and a run.gcmc in {0}. Finally I wrote an atom_atom_file, sorb_sorb_file, and intramolecular_file into {0}. You're good to go! ################################################################## '''.format(targetdir, satP*10**minrelpress, satP*10**maxrelpress))
satP = setup.pSat(logger, species[i], T) istm = setup.isothermcalculator(logger, satP, iso_length, minrelpress, maxrelpress) setup.PressureFileWriter(logger, species[i], T, satP, istm, '{0}{1:02d}/'.format(targetdir, j)) #goes in the directory above your individual one, gets symbolic linked later workingdir += n_per_species ##### Now to make some control files for you workingdir = 1 for i in range(1, n_species+1): for directory in range(workingdir, workingdir+n_per_species): setup.GcmcControlChanger(logger, species[i], sorb_el_list, T, n, framework, '{0}{1:02d}/'.format(targetdir, directory), n_iterations, restart, ctrl_file_name, pressure) for j, value in enumerate(istm): #now I make the extra .ctr files to give you final .xyz files for each simulaiton setup.GcmcControlChanger(logger, species[i], sorb_el_list, T, '1', framework, '{0}{1:02d}/'.format(targetdir, directory), '1', 'RESTARTFILE {0}.{1}.res.{2}'.format(framework, species[-1], j+1), '{0}kpa_restart.ctr'.format(value), value) #makes your control files for all of your pressure points setup.PostControlChanger(logger, species[i], T, n, framework, '{0}{1:02d}/'.format(targetdir, directory), '0') setup.PostControlChanger(logger, species[i], T, n, framework, '{0}{1:02d}/'.format(targetdir, directory), '60') setup.GcmcRunWriter(logger, species[i], T, framework, parentdir, '{0}{1:02d}/'.format(targetdir, directory), istm, '')#the last variable is the relative location of your interactions files setup.AtmAtmMover(logger, sorb_el_list, forcefield, coultype, hicut, frameowrk, '{0}{1:02d}/'.format(targetdir, directory)) setup.SorbSorbWriter(logger, species[i], sorb_el_list,framework,'{0}{1:02d}/'.format(targetdir, directory), pmap, emap) setup.IntraWriter(logger, species[i], sorb_el_list, framework, '{0}{1:02d}/'.format(targetdir, directory)) setup.TaskfarmRunWriter(logger, 'multiple', T, framework, parentdir, targetdir, Taskfarm_total) logger.info(''' ################################################################## So I've done the following: Created the directory {0} and {1} subdirectories for taskfarming. Calculated and written isotherms for all {2} species you've got, {3} times over each. Created a gcmc.ctr file, 2 post control files, and a run.gcmc file for each subdirectory. Created a taskfarm document and a backup, and finally run.taskfarmer in {0}. It might complain about not having a python script, but don't worry about that. Finally I wrote an atom_atom_file, sorb_sorb_file, and intramolecular_file into each subdirectory. You're good to go!
line.split() ) == 8: #should be 8 (index x y z name charge ? ?), but you might have added comments logger.info(line.split()[4]) el_list.add(line.split()[4]) logger.info("Atom list found is: " + str(el_list)) else: logger.warning( 'I didn\'t find a file named {0}.mol, so I don\'t have any sorbent atoms to write!' .format(species)) sorb_el_list = [ ] #i want to differentiate between framework elements and sorbent elements here, so I rename them as X_s for i in el_list: sorb_el_list.append( "{0}_{1}".format(i.split("_")[0], 's') ) #Sometimes I'll call them X_something esle to denote their forcefield for instance. This hould cut it back to just X_s logger.info( 'The list of sorbent atoms I\'ve found are: {0}'.format(sorb_el_list)) ################ ############### setup.AtmAtmMover( logger, #this variablwe logs out to the one made by this file sorb_el_list, #Your elements to be considered in the fluid forcefield, #Your forcefield tag for these elements coultype, #Your fluid-fluid coulombic interaction model cutoff, #Your nonbonded interaction cutoff distance framework, #Your framework name, to look up in musicpy.Forcefield.MOF_el_list targetdir #Where the atom_atom_interaction file will be spit out to )