Ejemplo n.º 1
0
def prepare_stacking_fault_map_2D(database_name, run_directory_name,
                                pot_kwargs=None, **kwargs):
    """
    Calls prepare stacking_fault_map_2D for each unique family
    """
    # Load database
    database = iprPy.load_database(database_name)
    
    # Build kwargs for each family
    families = np.unique(database.get_records_df(style='stacking_fault').family)
    for family in families:
        print(family, flush=True)        
        kwargs['parent_family'] = kwargs['defect_family'] = family 
        
        # Prepare
        prepare.stacking_fault_map_2D.main(database_name, run_directory_name,
                                           pot_kwargs=pot_kwargs, **kwargs)
Ejemplo n.º 2
0
def prepare_surface_energy_static(database_name, run_directory_name,
                                pot_kwargs=None, **kwargs):
    """
    Calls prepare surface_energy_static for each unique family
    """
    # Load database
    database = iprPy.load_database(database_name)
    
    # Build kwargs for each family
    families = np.unique(database.get_records_df(style='free_surface').family)
    for family in families:
        print(family, flush=True)        
        kwargs['parent_family'] = kwargs['defect_family'] = family 
        
        # Prepare
        prepare.surface_energy_static.main(database_name, run_directory_name,
                                           pot_kwargs=pot_kwargs, **kwargs)
Ejemplo n.º 3
0
def main():
    """
    Primary prepare workflow for setting up calculations consistent with how
    they are performed for the NIST Interatomic Potentials Repository.

    GLOBAL SETTINGS:
    - database - The iprPy.Database to use
    - prepare_terms - A dict of prepare settings to use.
    - all_lmppot_ids - The list of LAMMPS potential ids to use.

    INDIVIDUAL POOL SETTINGS:
    - styles - The list of calculation + workflow branch styles to prepare.
    - run_directory - The run directory where the prepared calculations are put.
    - np_per_runner - The expected number of processors per calculation.
    - num_lmppot_ids - The max number of LAMMPS potentials to prepare at a time.
    """

    ################### Set database and global prepare_terms #################

    # Load database
    database = iprPy.load_database('master')
    print(database)

    # Define executables and commands
    prepare_terms = {}
    prepare_terms['lammps_command'] = 'E:/LAMMPS/2020-03-03/bin/lmp_mpi'
    prepare_terms['mpi_command'] = 'mpiexec -localonly {np_per_runner}'
    prepare_terms['lammps_command_snap_1'] = 'E:/LAMMPS/2017-01-27/bin/lmp_mpi'
    prepare_terms['lammps_command_snap_2'] = 'E:/LAMMPS/2019-06-05/bin/lmp_mpi'
    prepare_terms['lammps_command_old'] = 'E:/LAMMPS/2019-06-05/bin/lmp_mpi'
    #prepare_terms['lammps_command_aenet'] =  '/users/lmh1/LAMMPS/bin/lmp_mpi_2020_03_03_aenet'

    ######################## Specify potentials to use ########################

    # Option #1: Select potentials from database to use
    #lmppots_df = database.potdb.get_lammps_potentials(return_df = True,
    #    status = 'active',
    #potid = ['1999--Mishin-Y-Farkas-D-Mehl-M-J-Papaconstantopoulos-D-A--Ni'],
    #pair_style = ['eam', 'eam/alloy', 'eam/fs'],
    #    symbols = ['Cu'],
    #)[1]
    #all_lmppot_ids = np.unique(lmppots_df.id).tolist()

    # Option #2: Specify potential ids directly
    all_lmppot_ids = [
        '2019--Plummer-G--Ti-Al-C--LAMMPS--ipr1',
        '2019--Plummer-G--Ti-Si-C--LAMMPS--ipr1',
        '2021--Plummer-G--Ti-Al-C--LAMMPS--ipr1',
        #    '2022--Hiremath-P--W--LAMMPS--ipr1',
        #    '2022--Mendelev-M-I--Ni-Nb--LAMMPS--ipr1'
    ]

    print(len(all_lmppot_ids), 'potential ids found')
    print()

    ########################### Pool settings #################################

    # Pool #1: Basic potential evaluations and scans
    styles = [
        'isolated_atom',
        'diatom_scan',
        'E_vs_r_scan:bop',
        'E_vs_r_scan',
    ]
    run_directory = 'master_1'
    np_per_runner = '1'
    num_lmppot_ids = 100
    prepare_pool(database, styles, run_directory, np_per_runner,
                 all_lmppot_ids, num_lmppot_ids, prepare_terms)

    # Pool #2: Round 1 of crystal structure relaxations
    styles = [
        'relax_box',
        'relax_static',
        'relax_dynamic',
    ]
    run_directory = 'master_2'
    np_per_runner = '1'
    num_lmppot_ids = 100
    prepare_pool(database, styles, run_directory, np_per_runner,
                 all_lmppot_ids, num_lmppot_ids, prepare_terms)

    # Pool #3: Round 2 of crystal structure relaxations
    styles = ['relax_static:from_dynamic']
    run_directory = 'master_3'
    np_per_runner = '1'
    num_lmppot_ids = 100
    prepare_pool(database, styles, run_directory, np_per_runner,
                 all_lmppot_ids, num_lmppot_ids, prepare_terms)

    # Pool #4: Crystal space group analysis
    styles = ['crystal_space_group:relax']
    run_directory = 'master_4'
    np_per_runner = '1'
    num_lmppot_ids = 100
    prepare_pool(database, styles, run_directory, np_per_runner,
                 all_lmppot_ids, num_lmppot_ids, prepare_terms)
Ejemplo n.º 4
0
# import libraries
import numpy as np
import potentials
import atomman as am
import iprPy

# Load database
database = iprPy.load_database('iprhub')
print(database)

# Define executables and commands
prepare_terms = {}
prepare_terms['lammps_command'] = '/users/lmh1/LAMMPS/2020_03_03/src/lmp_mpi'
prepare_terms['mpi_command'] = '/cluster/deb9/bin/mpirun -n {np_per_runner}'
prepare_terms[
    'lammps_command_snap_1'] = '/users/lmh1/LAMMPS/2017_03_31/src/lmp_mpi'
prepare_terms[
    'lammps_command_snap_2'] = '/users/lmh1/LAMMPS/2019_06_05/src/lmp_mpi'
prepare_terms[
    'lammps_command_old'] = '/users/lmh1/LAMMPS/2019_06_05/src/lmp_mpi'
prepare_terms[
    'lammps_command_aenet'] = '/users/lmh1/LAMMPS/bin/lmp_mpi_2020_03_03_aenet'

# Potential settings
prepare_terms['potential_status'] = 'all'
lmppots, lmppots_df = database.potdb.get_lammps_potentials(return_df=True,
                                                           status=None)
all_lmppot_ids = np.unique(lmppots_df.id).tolist()
print(len(all_lmppot_ids), 'potential ids found')
print()
from multiprocessing import Pool

import iprPy
from iprPy.workflow import multi_runners
import iprPy.workflow.prepare as prepare

if __name__ == '__main__':

    # Database, run directory and number of processors to use
    database_name = 'testDB'
    run_directory_name = 'testDB_1'
    database = iprPy.load_database(name=database_name)
    run_directory = iprPy.load_run_directory(name=run_directory_name)

    np = 1

    # Lammps and mpi commands
    lammps_command = 'lmp_mpi -p 8x1'
    mpi_command = 'mpiexec -localonly 8'
    number_replicas = 8

    # Potential-based modifiers
    pot_kwargs = {}
    #pot_kwargs['id'] = '2008--Zhou-X-W--Pd-H--LAMMPS--ipr1'
    pot_kwargs['currentIPR'] = 'False'
    pot_kwargs['pair_style'] = ['eam', 'eam/alloy', 'eam/fs', 'eam/cd']

    # Prototype-based modifiers
    families = [
        'A1--Cu--fcc',
        # 'A2--W--bcc',
Ejemplo n.º 6
0
# import libraries
import numpy as np
import potentials
import atomman as am
import iprPy

# Load database
database = iprPy.load_database('master')
print(database)

# Define executables and commands
prepare_terms = {}
prepare_terms['lammps_command'] = 'E:/LAMMPS/2020-03-03/bin/lmp_mpi'
prepare_terms['mpi_command'] = 'mpiexec -localonly {np_per_runner}'
prepare_terms['lammps_command_snap_1'] = 'E:/LAMMPS/2017-01-27/bin/lmp_mpi'
prepare_terms['lammps_command_snap_2'] = 'E:/LAMMPS/2019-06-05/bin/lmp_mpi'
prepare_terms['lammps_command_old'] = 'E:/LAMMPS/2019-06-05/bin/lmp_mpi'
#prepare_terms['lammps_command_aenet'] =  '/users/lmh1/LAMMPS/bin/lmp_mpi_2020_03_03_aenet'

# Potential settings
all_lmppot_ids = [
    '2019--Plummer-G--Ti-Al-C--LAMMPS--ipr1',
    '2019--Plummer-G--Ti-Si-C--LAMMPS--ipr1',
    '2021--Plummer-G--Ti-Al-C--LAMMPS--ipr1',
    #    '2022--Hiremath-P--W--LAMMPS--ipr1',
    #    '2022--Mendelev-M-I--Ni-Nb--LAMMPS--ipr1'
]
prepare_terms['potential_status'] = 'all'
#lmppots, lmppots_df = database.potdb.get_lammps_potentials(return_df=True, status=None)
#all_lmppot_ids = np.unique(lmppots_df.id).tolist()
print(len(all_lmppot_ids), 'potential ids found')