Exemplo n.º 1
0
def get_surface_charge_adf(mol: Molecule, job: Type[Job],
                           s: Settings) -> Settings:
    """Perform a gas-phase ADF single point and return settings for a COSMO-ADF single point.

    The previous gas-phase calculation as moleculair fragment.

    Parameters
    ----------
    mol : |plams.Molecule|_
        A PLAMS Molecule.

    job : |Callable|_
        A type Callable of a class derived from :class:`Job`, e.g. :class:`AMSJob`
        or :class:`Cp2kJob`.

    s : |plams.Settings|_
        The settings for **job**.

    Returns
    -------
    |plams.Settings|_
        A new Settings intance, constructed from **s**, suitable for DFT COSMO-RS calculations.

    """
    s.input.allpoints = ''
    results = mol.job_single_point(job, s, ret_results=True)
    coskf = get_coskf(results)

    for at in mol:
        at.properties.adf.fragment = 'gas'
    s.update(get_template('qd.yaml')['COSMO-ADF'])
    s.input.fragments.gas = coskf

    return s
Exemplo n.º 2
0
def update_ff_jobs(s: Settings) -> None:
    """Update forcefield settings."""
    if NANO_CAT is not None:
        raise NANO_CAT

    ff = Settings()
    set_cp2k_param(ff, s.optional.forcefield)

    optimize = s.optional.qd.optimize
    if optimize and optimize.use_ff:
        if optimize.job1 and str(optimize.job1) == str(Cp2kJob):
            optimize.s1 = Settings() if optimize.s1 is None else optimize.s1
            optimize.s1 += get_template('qd.yaml')['CP2K_CHARM_opt']
            optimize.s1 += ff

        if optimize.job2 and str(optimize.job1) == str(Cp2kJob):
            optimize.s2 = Settings() if optimize.s2 is None else optimize.s2
            optimize.s2 += get_template('qd.yaml')['CP2K_CHARM_opt']
            optimize.s2 += ff

    dissociate = s.optional.qd.dissociate
    if dissociate and dissociate.use_ff:
        if dissociate.job1 and str(dissociate.job1) == str(Cp2kJob):
            dissociate.s1 = Settings(
            ) if dissociate.s1 is None else dissociate.s1
            dissociate.s1 += get_template('qd.yaml')['CP2K_CHARM_opt']
            dissociate.s1 += ff

    activation_strain = s.optional.qd.activation_strain
    if activation_strain and activation_strain.use_ff:
        if activation_strain.job1 and str(
                activation_strain.job1) == str(Cp2kJob):
            key = 'CP2K_CHARM_singlepoint' if not activation_strain.md else 'CP2K_CHARM_md'
            activation_strain.s1 = Settings(
            ) if activation_strain.s1 is None else activation_strain.s1  # noqa
            activation_strain.s1 += get_template('qd.yaml')[key]
            activation_strain.s1 += ff
Exemplo n.º 3
0
def _get_logp(s: Settings, name: str, logger: logging.Logger) -> float:
    logp_s = s.copy()
    logp_s.update(get_template('qd.yaml')['COSMO-RS logp'])
    for v in logp_s.input.compound:
        v._h = v._h.format(os.environ["ADFRESOURCES"])

    logp_job = CRSJob(settings=logp_s, name='LogP')
    results = _crs_run(logp_job, name)
    try:
        logp = results.readkf('LOGP', 'logp')[0]
        logger.info(f'{results.job.__class__.__name__}: {name} LogP '
                    f'calculation ({results.job.name}) is successful')
    except Exception:
        logger.error(f'{results.job.__class__.__name__}: {name} LogP '
                     f'calculation ({results.job.name}) has failed')
        logp = np.nan
    return logp
Exemplo n.º 4
0
def _preoptimize(mol: Molecule) -> None:
    """Perform a constrained geometry optimization of **mol** with AMS UFF."""
    s = get_template('qd.yaml')['UFF']
    s.input.ams.constraints.atom = mol.properties.indices
    s.input.ams.GeometryOptimization.coordinatetype = 'Cartesian'
    mol.job_geometry_opt(AMSJob, s, name='E_XYn_preopt')
Exemplo n.º 5
0
        #: Print time for each log event
        time: bool

        #: Print date for each log event
        date: bool

__all__ = [
    "get_compkf",
    "get_fast_sigma_properties",
    "run_fast_sigma",
    "read_csv",
    "sanitize_smiles_df",
]

LOGP_SETTINGS = get_template('qd.yaml')['COSMO-RS logp']
LOGP_SETTINGS.runscript.nproc = 1
LOGP_SETTINGS.update(get_template('crs.yaml')['ADF combi2005'])
LOGP_SETTINGS.input.property.volumequotient = 6.766

GAMMA_E_SETTINGS = get_template('qd.yaml')['COSMO-RS activity coefficient']
GAMMA_E_SETTINGS.runscript.nproc = 1
GAMMA_E_SETTINGS.update(get_template('crs.yaml')['ADF combi2005'])
del GAMMA_E_SETTINGS.input.compound[0]

SOL_SETTINGS = copy.deepcopy(GAMMA_E_SETTINGS)
SOL_SETTINGS.input.property._h = "puresolubility"
SOL_SETTINGS.input.temperature = "298.15 298.15 1"
SOL_SETTINGS.input.pressure = "1.01325"
SOL_SETTINGS.input.compound = [Settings({"_h": None, "_1": "compkffile"})]