Exemplo n.º 1
0
    print(F'Bookkeeping:\t {elapsed}')

    ###########################################################################
    #
    #   Send Probe Information to Tinker
    #
    ###########################################################################
    start = time.time()
    # Inform Tinker of the probe atoms
    for comm in engine_comm:
        mdi.MDI_Send_Command(">NPROBES", comm)
        mdi.MDI_Send(len(probes), 1, mdi.MDI_INT, comm)
        mdi.MDI_Send_Command(">PROBES", comm)
        mdi.MDI_Send(probe_pole_indices, len(probes), mdi.MDI_INT, comm)

    angstrom_to_bohr = mdi.MDI_Conversion_Factor("angstrom",
                                                 "atomic_unit_of_length")
    elapsed - time.time() - start
    print(F'Sending info to tinker:\t {elapsed}')

    ###########################################################################
    #
    #   Engine and Trajectory File Compatibility Check.
    #
    ###########################################################################

    # Check that engine and trajectory are compatible.
    # Process first two lines of snapshot to get information.
    with open(snapshot_filename, "r") as snapshot_file:
        first_line = snapshot_file.readline()
        natoms = int(first_line.split()[0])
        second_line = snapshot_file.readline().split()
Exemplo n.º 2
0
            iarg += 1
        else:
            raise Exception("Unrecognized command-line option")

        iarg += 1

    # Confirm that the MDI options were provided
    if mdi_options is None:
        raise Exception("-mdi command-line option was not provided")

    # Initialize the MDI Library
    mdi.MDI_Init(mdi_options, mpi_comm_world)

    # Get unit conversions
    colvar = distance.Distance(319, 320)
    kcalmol_to_atomic = mdi.MDI_Conversion_Factor("kilocalorie_per_mol",
                                                  "atomic_unit_of_energy")
    angstrom_to_atomic = mdi.MDI_Conversion_Factor("angstrom",
                                                   "atomic_unit_of_length")
    kcalmol_per_angstrom_to_atomic = kcalmol_to_atomic / angstrom_to_atomic

    # Input parameters
    width = 0.2 * angstrom_to_atomic  # Gaussian width of first collective variable
    height = 0.1 * kcalmol_to_atomic  # Gaussian height of first collective variable
    total_steps = 8000  # Number of MD iterations. Note timestep = 2fs
    tau_gaussian = 400  # Frequency of addition of Gaussians
    upper_restraint = 14.0 * angstrom_to_atomic
    lower_restraint = 1.0 * angstrom_to_atomic
    upper_window = 8.0 * angstrom_to_atomic
    lower_window = 2.4 * angstrom_to_atomic
    k_restraint = 10 * kcalmol_per_angstrom_to_atomic
    verbose = False