def myCalcs(self, D ): if self.args['vectors']: D.foldMovieToUC(self.args['vectors']) self.countBins(D.frame_data, D.frame_seed) if self.missedLocations: data = {'coords':self.missedLocations,'atoms':['N' for i in self.missedLocations]} xyz(self.args['path'] + '/'+ self.feed +'/'+ 'gridMissedLocs.xyz', data) self.output_results()
def makegrid(): numBins = tuple([600, 600, 1]) abc = tuple([60.066, 59.697, 13.383]) # unit cell dimensions labels = np.chararray(shape=numBins, unicode=True, itemsize=5) data = {'atoms': [], 'coords': []} print('bin size = ', [abc[0] / numBins[0], abc[1] / numBins[1], abc[2] / numBins[2]]) for i in range(numBins[0]): for j in range(numBins[1]): for k in range(numBins[2]): coords = [ i * abc[0] / numBins[0], j * abc[1] / numBins[1], k * abc[2] / numBins[2] ] if micropore(coords): data['atoms'].append('D') elif mesopore(coords): data['atoms'].append('F') elif surface(coords): data['atoms'].append('H') data['coords'].append(coords) xyz('/home/siepmann/josep180/Work/OFS/SPP/SPPgridcheck7.xyz', data)
def makegrid(): numBins = tuple([1, 500, 1]) abc = tuple([40.106, 100.0, 40.145]) # unit cell dimensions labels = np.chararray(shape=numBins, unicode=True, itemsize=5) data = {'atoms': [], 'coords': []} print('bin size = ', [abc[0] / numBins[0], abc[1] / numBins[1], abc[2] / numBins[2]]) for i in range(numBins[0]): for j in range(numBins[1]): for k in range(numBins[2]): coords = [ i * abc[0] / numBins[0], j * abc[1] / numBins[1], k * abc[2] / numBins[2] ] if micropore(coords): data['atoms'].append('D') elif mesopore(coords): data['atoms'].append('F') elif surface(coords): data['atoms'].append('H') data['coords'].append(coords) xyz('/home/siepmann/josep180/Work/BTX/MFI-nanogrid.xyz', data)
def myCalcs(self, D): if self.args['vectors']: D.foldMovieToUC(self.args['vectors']) self.countBins(D.frame_data, D.frame_seed) if self.missedLocations: data = { 'coords': self.missedLocations, 'atoms': ['N' for i in self.missedLocations] } xyz( self.args['path'] + '/' + self.feed + '/' + 'gridMissedLocs.xyz', data) # print(Regions) # sys.stdout.write(repr(Regions)) # flag='' # if self.filter_function: # flag = '_filtered' # xyz('%s/%s/movie_coords_mol%s_box%s%s_sim%s_%s.xyz'%(self.args['path'], self.feed, # mol_num, self.args['box'],flag, ''.join(map(str,self.args['indep'])), # '-'.join(self.args['bead'])), xyz_data) outputDB(self.args['path'], [self.feed], self.args['type'], {self.args['name']: self})
# pbc_coords = [[x[i],y[i]] for i in pbc_coords] # coords = fold_coords(pbc_coords,[a,b]) # my_ax.plot(coords[:,0],coords[:,1],'-.',color='red') from MCFlow.file_formatting import reader, writer from MCFlow.calc_tools import calculate_distance, pbc, fold_coords import numpy as np import pprint rcut = 5.0 / 2. a, b, c = [20.022, 19.899, 13.383] center = [10.011, 4.9748, 0.] x, y, z = center sphere = [[x, y, z], [a / 2 - x, b / 2 + y, c / 2 + z], [x, b / 2 - y, z], [a / 2 + x, y, c / 2 - z], [a - x, b - y, c - z], [a / 2 + x, b / 2 - y, c / 2 - z], [a - x, b / 2 + y, c - z], [a / 2 - x, b - y, c / 2 + z]] if __name__ == '__main__': new_data = {'atoms': [], 'coords': []} old_data = reader.xyz('energy_grid_114_O_merged1.5.xyz') for atom, xyz in zip(old_data['atoms'], old_data['coords']): for my_center in sphere: if calculate_distance(xyz, my_center, [a, b, c]) < rcut: atom = 'H' new_data['atoms'].append(atom) new_data['coords'].append(xyz) writer.xyz('new_channels.xyz', new_data)