def get_HW14_water_kwargs(): """Return kwargs for initializing a SolvationGPAW instance. Parameters for water as a solvent as in A. Held and M. Walter, J. Chem. Phys. 141, 174108 (2014). """ from ase.units import Pascal, m from ase.data.vdw import vdw_radii u0 = 0.180 epsinf = 78.36 st = 18.4 * 1e-3 * Pascal * m T = 298.15 vdw_radii = vdw_radii.copy() vdw_radii[1] = 1.09 atomic_radii = lambda atoms: [vdw_radii[n] for n in atoms.numbers] kwargs = { 'cavity': EffectivePotentialCavity(effective_potential=Power12Potential( atomic_radii, u0), temperature=T, surface_calculator=GradientSurface()), 'dielectric': LinearDielectric(epsinf=epsinf), 'interactions': [SurfaceInteraction(surface_tension=st)] } return kwargs
now = datetime.datetime timestamp = now.now().strftime('%Y%-m%-d%-I%-M%-S') pydir = os.path.dirname(os.path.abspath(__file__)) pj = os.path.join shell = ase.io.read(pj(pydir, "xyz/{}4x.xyz".format(sv))) solvent = ase.io.read(pj(pydir, "xyz/{}.xyz".format(sv))) solventparams = pickle.load(open(pj(pydir, "parameters.pkl"), "r")) #Solvent parameters for DMSO (J. Chem. Phys. 141, 174108 (2014)) params = solventparams[sv] name, nd, u0, gamma, epsinf = params['name'], params['number density'], params[ 'u0 (eV)'], params['gamma (dyne/cm)'], params['dielectric constant'] gamma = gamma * Pascal * m T = 298.15 #Kelvin vdw_radii = vdw_radii.copy() vdw_radii[1] = 1.09 atomic_radii = lambda atoms: [vdw_radii[n] for n in atoms.numbers ] #create callable for GPAW calculator #DFT calculation parameters xc = 'PBE' beef = 'BEEF-vdW' cell = vac * np.array([1, 1, 1]) parprint('completed') #Each calculation will be converged with PBE, then, using same calculator, be run with BEEF. #This enables the PBE WFs to be used as initial guesses for BEEF convergence, hopefully enabling large box sizes. #Data is stored in a dictionary with key: input sys.argv string "s" indicating ion-species. value : tuple of one value and one array, #indicating Gsol and dGsol. output = {}
import time import numpy as np from os.path import join, abspath from ase.data.colors import cpk_colors, jmol_colors from ase.data.vdw import vdw_radii from CalcTrollASE.AtomUtilities import cellCenter my_radii = vdw_radii.copy() my_radii[74] = 2.50 VALENCE_DICT = {'H': 1, 'Si': 4, 'C':4, 'B':3, 'Ge':4, 'Ag': 11, 'O':6} DEFAULT_FONTSIZE = 10 def chargeDifferenceScheme( figure, atoms, charges, max_charge_difference=None, scale_factor=1, ): charges = -np.array(charges) max_charge = charges.max() colors = np.ones((len(atoms), 3)) if max_charge_difference is None: maxi = abs(charges).max() else: maxi = max_charge_difference charges = charges.clip(-maxi, maxi)