Exemple #1
0
def main(*args):
    """Main function called when script is executed directly."""
    
    # Read input file in as dictionary
    with open(args[0]) as f:
        input_dict = iprPy.input.parse(f, allsingular=True)
    
    # Interpret and process input parameters
    process_input(input_dict, *args[1:])
    
    # Run surface_energy
    results_dict = surface_energy(input_dict['lammps_command'],
                                  input_dict['ucell'],
                                  input_dict['potential'],
                                  input_dict['surface_hkl'],
                                  mpi_command = input_dict['mpi_command'],
                                  sizemults = input_dict['sizemults'],
                                  minwidth = input_dict['surface_minwidth'],
                                  even = input_dict['surface_even'],
                                  conventional_setting = input_dict['surface_cellsetting'],
                                  cutboxvector = input_dict['surface_cutboxvector'],
                                  shiftindex = input_dict['surface_shiftindex'],
                                  etol = input_dict['energytolerance'],
                                  ftol = input_dict['forcetolerance'],
                                  maxiter = input_dict['maxiterations'],
                                  maxeval = input_dict['maxevaluations'],
                                  dmax = input_dict['maxatommotion'])
    
    # Build and save data model of results
    record = iprPy.load_record(record_style)
    record.buildcontent(input_dict, results_dict)
    with open('results.json', 'w') as f:
        record.content.json(fp=f, indent=4)
def main(*args):
    """Main function called when script is executed directly."""
    
    # Read in parameters from input file
    with open(args[0]) as f:
        input_dict = iprPy.input.parse(f, allsingular=True)
    
    # Interpret and process input parameters
    process_input(input_dict, *args[1:])
    
    #Run pointdiffusion 
    results_dict = pointdiffusion(input_dict['lammps_command'],
                                  input_dict['initialsystem'],
                                  input_dict['potential'],
                                  input_dict['point_kwargs'],
                                  mpi_command = input_dict['mpi_command'],
                                  temperature = input_dict['temperature'],
                                  runsteps = input_dict['runsteps'],
                                  thermosteps = input_dict['thermosteps'],
                                  dumpsteps = input_dict['dumpsteps'],
                                  equilsteps = input_dict['equilsteps'],
                                  randomseed = input_dict['randomseed'])
    
    # Save data model of results
    script = os.path.splitext(os.path.basename(__file__))[0]
    
    record = iprPy.load_record(record_style)
    record.buildcontent(script, input_dict, results_dict)
    
    with open('results.json', 'w') as f:
        record.content.json(fp=f, indent=4)
def main(*args):
    """Main function called when script is executed directly."""
    
    # Read input file in as dictionary
    with open(args[0]) as f:
        input_dict = iprPy.input.parse(f, allsingular=True)
    
    # Interpret and process input parameters
    process_input(input_dict, *args[1:])
    
    # Run ptd_energy to refine values
    results_dict = calc(input_dict['lammps_command'],
                        input_dict['initialsystem'],
                        input_dict['potential'],
                        input_dict['point_kwargs'],
                        1.05 * input_dict['ucell'].box.a,
                        mpi_command = input_dict['mpi_command'],
                        etol = input_dict['energytolerance'],
                        ftol = input_dict['forcetolerance'],
                        maxiter = input_dict['maxiterations'],
                        maxeval = input_dict['maxevaluations'],
                        dmax = input_dict['maxatommotion'])
    
    # Save data model of results
    script = Path(__file__).stem
    
    record = iprPy.load_record(record_style)
    record.buildcontent(script, input_dict, results_dict)
    
    with open('results.json', 'w') as f:
        record.content.json(fp=f, indent=4)
Exemple #4
0
def main(*args):
    """Main function called when script is executed directly."""

    # Read input file in as dictionary
    with open(args[0]) as f:
        input_dict = iprPy.input.parse(f, allsingular=True)

    # Interpret and process input parameters
    process_input(input_dict, *args[1:])

    # Run crystal_compare to compare two systems based on spacegroup info
    results_dict = crystal_space_group(
        input_dict['ucell'],
        symprec=input_dict['symmetryprecision'],
        to_primitive=input_dict['primitivecell'],
        no_idealize=not input_dict['idealcell'])

    # Save data model of results
    script = Path(__file__).stem

    record = iprPy.load_record(record_style)
    record.buildcontent(script, input_dict, results_dict)

    with open('results.json', 'w') as f:
        record.content.json(fp=f, indent=4)
Exemple #5
0
def main(*args):
    """Main function called when script is executed directly."""

    # Read input file in as dictionary
    with open(args[0]) as f:
        input_dict = iprPy.input.parse(f, allsingular=True)

    # Interpret and process input parameters
    process_input(input_dict, *args[1:])

    # Run relax_static to relax system
    results_dict = relax_static(input_dict['lammps_command'],
                                input_dict['initialsystem'],
                                input_dict['potential'],
                                mpi_command=input_dict['mpi_command'],
                                p_xx=input_dict['pressure_xx'],
                                p_yy=input_dict['pressure_yy'],
                                p_zz=input_dict['pressure_zz'],
                                p_xy=input_dict['pressure_xy'],
                                p_xz=input_dict['pressure_xz'],
                                p_yz=input_dict['pressure_yz'],
                                dispmult=input_dict['displacementkick'],
                                etol=input_dict['energytolerance'],
                                ftol=input_dict['forcetolerance'],
                                maxiter=input_dict['maxiterations'],
                                maxeval=input_dict['maxevaluations'],
                                dmax=input_dict['maxatommotion'],
                                maxcycles=input_dict['maxcycles'],
                                ctol=input_dict['cycletolerance'])

    # Build and save data model of results
    record = iprPy.load_record(record_style)
    record.buildcontent(input_dict, results_dict)
    with open('results.json', 'w') as f:
        record.content.json(fp=f, indent=4)
Exemple #6
0
def main(*args):
    """Main function called when script is executed directly."""
    
    # Read input file in as dictionary
    with open(args[0]) as f:
        input_dict = iprPy.input.parse(f, allsingular=True)
    
    # Interpret and process input parameters
    process_input(input_dict, *args[1:])
    
    # Run e_vs_r
    results_dict = e_vs_r(input_dict['lammps_command'],
                          input_dict['initialsystem'],
                          input_dict['potential'],
                          mpi_command = input_dict['mpi_command'],
                          ucell = input_dict['ucell'],
                          rmin = input_dict['minimum_r'],
                          rmax = input_dict['maximum_r'],
                          rsteps = input_dict['number_of_steps_r'])
    
    # Save data model of results
    script = os.path.splitext(os.path.basename(__file__))[0]
    
    record = iprPy.load_record(record_style)
    record.buildcontent(script, input_dict, results_dict)
    
    with open('results.json', 'w') as f:
        record.content.json(fp=f, indent=4)
Exemple #7
0
def main(*args):
    """Main function called when script is executed directly."""

    # Read input file in as dictionary
    with open(args[0]) as f:
        input_dict = iprPy.input.parse(f, allsingular=True)

    # Interpret and process input parameters
    process_input(input_dict, *args[1:])

    # Run relax_static to relax system
    results_dict = baintransformation(input_dict['lammps_command'],
                                      input_dict['a_bcc'],
                                      input_dict['a_fcc'],
                                      input_dict['symbol'],
                                      input_dict['sizemults'],
                                      input_dict['potential'],
                                      mpi_command=input_dict['mpi_command'],
                                      num_a=input_dict['number_a_scale'],
                                      num_c=input_dict['number_c_scale'],
                                      min_a=input_dict['minimum_a_scale'],
                                      max_a=input_dict['maximum_a_scale'],
                                      min_c=input_dict['minimum_c_scale'],
                                      max_c=input_dict['maximum_c_scale'],
                                      etol=input_dict['energytolerance'],
                                      ftol=input_dict['forcetolerance'],
                                      maxiter=input_dict['maxiterations'],
                                      maxeval=input_dict['maxevaluations'],
                                      dmax=input_dict['maxatommotion'])

    # Build and save data model of results
    record = iprPy.load_record(record_style)
    record.buildcontent(input_dict, results_dict)
    with open('results.json', 'w') as f:
        record.content.json(fp=f, indent=4)
Exemple #8
0
def main(*args):
    """Main function called when script is executed directly."""

    # Read in parameters from input file
    with open(args[0]) as f:
        input_dict = iprPy.input.parse(f, allsingular=True)

    # Interpret and process input parameters
    process_input(input_dict, *args[1:])

    #Run pointdiffusion
    results_dict = pointdiffusion(input_dict['lammps_command'],
                                  input_dict['initialsystem'],
                                  input_dict['potential'],
                                  input_dict['point_kwargs'],
                                  mpi_command=input_dict['mpi_command'],
                                  temperature=input_dict['temperature'],
                                  runsteps=input_dict['runsteps'],
                                  thermosteps=input_dict['thermosteps'],
                                  dumpsteps=input_dict['dumpsteps'],
                                  equilsteps=input_dict['equilsteps'],
                                  randomseed=input_dict['randomseed'])

    # Save data model of results
    script = Path(__file__).stem

    record = iprPy.load_record(record_style)
    record.buildcontent(script, input_dict, results_dict)

    with open('results.json', 'w') as f:
        record.content.json(fp=f, indent=4)
Exemple #9
0
def main(*args):
    """Main function called when script is executed directly."""

    # Read input file in as dictionary
    with open(args[0]) as f:
        input_dict = iprPy.input.parse(f, allsingular=True)

    # Interpret and process input parameters
    process_input(input_dict, *args[1:])

    # Run lammps_ELASTIC_refine to refine values
    results_dict = elastic_constants_static(
        input_dict['lammps_command'],
        input_dict['initialsystem'],
        input_dict['potential'],
        mpi_command=input_dict['mpi_command'],
        strainrange=input_dict['strainrange'],
        etol=input_dict['energytolerance'],
        ftol=input_dict['forcetolerance'],
        maxiter=input_dict['maxiterations'],
        maxeval=input_dict['maxevaluations'],
        dmax=input_dict['maxatommotion'])

    # Save data model of results
    script = os.path.splitext(os.path.basename(__file__))[0]

    record = iprPy.load_record(record_style)
    record.buildcontent(script, input_dict, results_dict)

    with open('results.json', 'w') as f:
        record.content.json(fp=f, indent=4)
Exemple #10
0
def main(*args):
    """Main function  called when script is executed directly."""

    # Read input file in as dictionary
    with open(args[0]) as f:
        input_dict = iprPy.input.parse(f, allsingular=True)

    # Interpret and process input parameters
    process_input(input_dict, *args[1:])

    # Run relax_box to refine values
    results_dict = relax_box(input_dict['lammps_command'],
                             input_dict['initialsystem'],
                             input_dict['potential'],
                             mpi_command=input_dict['mpi_command'],
                             p_xx=input_dict['pressure_xx'],
                             p_yy=input_dict['pressure_yy'],
                             p_zz=input_dict['pressure_zz'],
                             p_xy=input_dict['pressure_xy'],
                             p_xz=input_dict['pressure_xz'],
                             p_yz=input_dict['pressure_yz'],
                             strainrange=input_dict['strainrange'])

    # Save data model of results
    script = Path(__file__).stem

    record = iprPy.load_record(record_style)
    record.buildcontent(script, input_dict, results_dict)

    with open('results.json', 'w') as f:
        record.content.json(fp=f, indent=4)
Exemple #11
0
def main(*args):
    """Main function called when script is executed directly."""

    # Read input file in as dictionary
    with open(args[0]) as f:
        input_dict = iprPy.input.parse(f, allsingular=True)

    # Interpret and process input parameters
    process_input(input_dict, *args[1:])

    # Run phonon
    results_dict = phonon(
        input_dict['lammps_command'],
        input_dict['ucell'],
        input_dict['potential'],
        mpi_command=input_dict['mpi_command'],
        a_mult=input_dict['sizemults'][0][1] - input_dict['sizemults'][0][0],
        b_mult=input_dict['sizemults'][1][1] - input_dict['sizemults'][1][0],
        c_mult=input_dict['sizemults'][2][1] - input_dict['sizemults'][2][0],
        distance=input_dict['displacementdistance'],
        symprec=input_dict['symmetryprecision'])

    # Save data model of results
    script = Path(__file__).stem

    record = iprPy.load_record(record_style)
    record.buildcontent(script, input_dict, results_dict)

    with open('results.json', 'w') as f:
        record.content.json(fp=f, indent=4)
def main(*args):
    """Main function called when script is executed directly."""
    
    # Read input file in as dictionary
    with open(args[0]) as f:
        input_dict = iprPy.input.parse(f, allsingular=True)
    
    # Interpret and process input parameters
    process_input(input_dict, *args[1:])
    
    # Run surface_energy
    results_dict = surface_energy(input_dict['lammps_command'],
                                  input_dict['initialsystem'],
                                  input_dict['potential'],
                                  mpi_command = input_dict['mpi_command'],
                                  etol = input_dict['energytolerance'],
                                  ftol = input_dict['forcetolerance'],
                                  maxiter = input_dict['maxiterations'],
                                  maxeval = input_dict['maxevaluations'],
                                  dmax = input_dict['maxatommotion'],
                                  cutboxvector = input_dict['surface_cutboxvector'])
    
    # Save data model of results
    script = os.path.splitext(os.path.basename(__file__))[0]
    
    record = iprPy.load_record(record_style)
    record.buildcontent(script, input_dict, results_dict)
    
    with open('results.json', 'w') as f:
        record.content.json(fp=f, indent=4)
Exemple #13
0
def main(*args):
    """Main function called when script is executed directly."""
    
    # Read input file in as dictionary
    with open(args[0]) as f:
        input_dict = iprPy.input.parse(f, allsingular=True)
    
    # Interpret and process input parameters
    process_input(input_dict, *args[1:])
    
    # Run full_Relax to refine values
    results_dict = relax_dynamic(input_dict['lammps_command'],
                                 input_dict['initialsystem'],
                                 input_dict['potential'],
                                 mpi_command = input_dict['mpi_command'],
                                 p_xx = input_dict['pressure_xx'],
                                 p_yy = input_dict['pressure_yy'],
                                 p_zz = input_dict['pressure_zz'],
                                 p_xy = input_dict['pressure_xy'],
                                 p_xz = input_dict['pressure_xz'],
                                 p_yz = input_dict['pressure_yz'],
                                 temperature = input_dict['temperature'],
                                 runsteps = input_dict['runsteps'],
                                 integrator = input_dict['integrator'],
                                 thermosteps = input_dict['thermosteps'],
                                 dumpsteps = input_dict['dumpsteps'],
                                 equilsteps = input_dict['equilsteps'],
                                 randomseed = input_dict['randomseed'])
    
    # Build and save data model of results
    record = iprPy.load_record(record_style)
    record.buildcontent(input_dict, results_dict)
    with open('results.json', 'w') as f:
        record.content.json(fp=f, indent=4)
Exemple #14
0
def main(*args):
    """Main function called when script is executed directly."""

    # Read input file in as dictionary
    with open(args[0]) as f:
        input_dict = iprPy.input.parse(f, allsingular=True)

    # Interpret and process input parameters
    process_input(input_dict, *args[1:])

    results_dict = dislocationarraystress(
        input_dict['lammps_command'],
        input_dict['ucell'],
        input_dict['potential'],
        input_dict['temperature'],
        mpi_command=input_dict['mpi_command'],
        sigma_xz=input_dict['sigma_xz'],
        sigma_yz=input_dict['sigma_yz'],
        runsteps=input_dict['runsteps'],
        thermosteps=input_dict['thermosteps'],
        dumpsteps=input_dict['dumpsteps'],
        randomseed=input_dict['randomseed'],
        bwidth=input_dict['boundarywidth'],
        rigidbounds=input_dict['rigidboundaries'])

    # Save data model of results
    script = os.path.splitext(os.path.basename(__file__))[0]

    record = iprPy.load_record(record_style)
    record.buildcontent(script, input_dict, results_dict)

    with open('results.json', 'w') as f:
        record.content.json(fp=f, indent=4)
Exemple #15
0
def main(*args):
    """Main function called when script is executed directly."""

    # Read input file in as dictionary
    with open(args[0]) as f:
        input_dict = iprPy.input.parse(f, allsingular=True)

    # Interpret and process input parameters
    process_input(input_dict, *args[1:])

    # Run diatom
    results_dict = diatom(input_dict['lammps_command'],
                          input_dict['potential'],
                          input_dict['symbols'],
                          mpi_command=input_dict['mpi_command'],
                          rmin=input_dict['minimum_r'],
                          rmax=input_dict['maximum_r'],
                          rsteps=input_dict['number_of_steps_r'])

    # Save data model of results
    script = Path(__file__).stem

    record = iprPy.load_record(record_style)
    record.buildcontent(script, input_dict, results_dict)

    with open('results.json', 'w') as f:
        record.content.json(fp=f, indent=4)
Exemple #16
0
def main(*args):
    """Main function called when script is executed directly."""

    # Read input file in as dictionary
    with open(args[0]) as f:
        input_dict = iprPy.input.parse(f, allsingular=True)

    # Interpret and process input parameters
    process_input(input_dict, *args[1:])

    results_dict = dislocationarray(
        input_dict['lammps_command'],
        input_dict['ucell'],
        input_dict['potential'],
        input_dict['C'],
        input_dict['dislocation_burgers'],
        input_dict['dislocation_ξ_uvw'],
        input_dict['dislocation_slip_hkl'],
        mpi_command=input_dict['mpi_command'],
        m=input_dict['dislocation_m'],
        n=input_dict['dislocation_n'],
        sizemults=input_dict['sizemults'],
        amin=input_dict['amin'],
        bmin=input_dict['bmin'],
        cmin=input_dict['cmin'],
        shift=input_dict['dislocation_shift'],
        shiftscale=input_dict['dislocation_shiftscale'],
        shiftindex=input_dict['dislocation_shiftindex'],
        etol=input_dict['energytolerance'],
        ftol=input_dict['forcetolerance'],
        maxiter=input_dict['maxiterations'],
        maxeval=input_dict['maxevaluations'],
        dmax=input_dict['maxatommotion'],
        annealtemp=input_dict['annealtemperature'],
        annealsteps=input_dict['annealsteps'],
        randomseed=input_dict['randomseed'],
        boundarywidth=input_dict['dislocation_boundarywidth'],
        boundaryscale=input_dict['dislocation_boundaryscale'],
        linear=input_dict['dislocation_onlylinear'],
        cutoff=input_dict['dislocation_duplicatecutoff'])

    # Build and save data model of results
    record = iprPy.load_record(record_style)
    record.buildcontent(input_dict, results_dict)
    with open('results.json', 'w') as f:
        record.content.json(fp=f, indent=4)
Exemple #17
0
def main(*args):
    """Main function called when script is executed directly."""

    # Read input file in as dictionary
    with open(args[0]) as f:
        input_dict = iprPy.input.parse(f, allsingular=True)

    # Interpret and process input parameters
    process_input(input_dict, *args[1:])

    results_dict = peierlsnabarro(
        input_dict['ucell'],
        input_dict['C'],
        input_dict['dislocation_burgers'],
        input_dict['dislocation_ξ_uvw'],
        input_dict['dislocation_slip_hkl'],
        input_dict['gamma'],
        m=input_dict['dislocation_m'],
        n=input_dict['dislocation_n'],
        cutofflongrange=input_dict['cutofflongrange'],
        tau=input_dict['tau'],
        alpha=input_dict['alpha'],
        beta=input_dict['beta'],
        cdiffelastic=input_dict['cdiffelastic'],
        cdiffsurface=input_dict['cdiffsurface'],
        cdiffstress=input_dict['cdiffstress'],
        fullstress=input_dict['fullstress'],
        halfwidth=input_dict['halfwidth'],
        normalizedisreg=input_dict['normalizedisreg'],
        xnum=input_dict['xnum'],
        xstep=input_dict['xstep'],
        xmax=input_dict['xmax'],
        min_method=input_dict['minimize_style'],
        min_options=input_dict['minimize_options'],
        min_cycles=input_dict['minimize_cycles'])

    # Save data model of results
    script = Path(__file__).stem

    record = iprPy.load_record(record_style)
    record.buildcontent(script, input_dict, results_dict)

    with open('results.json', 'w') as f:
        record.content.json(fp=f, indent=4)
Exemple #18
0
def main(*args):
    """Main function called when script is executed directly."""
    
    # Read input file in as dictionary
    with open(args[0]) as f:
        input_dict = iprPy.input.parse(f, allsingular=True)
    
    # Interpret and process input parameters
    process_input(input_dict, *args[1:])
    
    # Run diatom
    results_dict = isolated_atom(input_dict['lammps_command'],
                                 input_dict['potential'])
    
    # Build and save data model of results
    record = iprPy.load_record(record_style)
    record.buildcontent(input_dict, results_dict)
    with open('results.json', 'w') as f:
        record.content.json(fp=f, indent=4)
Exemple #19
0
def main(*args):
    """Main function called when script is executed directly."""

    # Read input file in as dictionary
    with open(args[0]) as f:
        input_dict = iprPy.input.parse(f, allsingular=True)

    # Interpret and process input parameters
    process_input(input_dict, *args[1:])

    results_dict = stackingfaultmap(
        input_dict['lammps_command'],
        input_dict['initialsystem'],
        input_dict['potential'],
        input_dict['shiftvector1'],
        input_dict['shiftvector2'],
        mpi_command=input_dict['mpi_command'],
        numshifts1=input_dict['stackingfault_numshifts1'],
        numshifts2=input_dict['stackingfault_numshifts2'],
        cutboxvector=input_dict['stackingfault_cutboxvector'],
        faultpos=input_dict['faultpos'],
        etol=input_dict['energytolerance'],
        ftol=input_dict['forcetolerance'],
        maxiter=input_dict['maxiterations'],
        maxeval=input_dict['maxevaluations'],
        dmax=input_dict['maxatommotion'])

    results_dict['gamma'] = am.defect.GammaSurface(
        a1vect=input_dict['stackingfault_shiftvector1'],
        a2vect=input_dict['stackingfault_shiftvector2'],
        box=input_dict['ucell'].box,
        a1=results_dict['shift1'],
        a2=results_dict['shift2'],
        E_gsf=results_dict['E_gsf'])

    # Save data model of results
    script = os.path.splitext(os.path.basename(__file__))[0]

    record = iprPy.load_record(record_style)
    record.buildcontent(script, input_dict, results_dict)

    with open('results.json', 'w') as f:
        record.content.json(fp=f, indent=4)
def main(*args):
    """Main function called when script is executed directly."""
    
    # Read input file in as dictionary
    with open(args[0]) as f:
        input_dict = iprPy.input.parse(f, allsingular=True)
    
    # Interpret and process input parameters
    process_input(input_dict, *args[1:])
    
    results_dict = stackingfaultmap(input_dict['lammps_command'],
                                     input_dict['initialsystem'],
                                     input_dict['potential'],
                                     input_dict['shiftvector1'],
                                     input_dict['shiftvector2'],
                                     mpi_command = input_dict['mpi_command'],
                                     numshifts1 = input_dict['stackingfault_numshifts1'],
                                     numshifts2 = input_dict['stackingfault_numshifts2'],
                                     cutboxvector = input_dict['stackingfault_cutboxvector'],
                                     faultpos = input_dict['faultpos'],
                                     etol = input_dict['energytolerance'],
                                     ftol = input_dict['forcetolerance'],
                                     maxiter = input_dict['maxiterations'],
                                     maxeval = input_dict['maxevaluations'],
                                     dmax = input_dict['maxatommotion'])
    
    results_dict['gamma'] = am.defect.GammaSurface(a1vect = input_dict['stackingfault_shiftvector1'],
                                                   a2vect = input_dict['stackingfault_shiftvector2'],
                                                   box = input_dict['ucell'].box,
                                                   a1 = results_dict['shift1'],
                                                   a2 = results_dict['shift2'],
                                                   E_gsf = results_dict['E_gsf'])
    
    # Save data model of results
    script = os.path.splitext(os.path.basename(__file__))[0]
    
    record = iprPy.load_record(record_style)
    record.buildcontent(script, input_dict, results_dict)
    
    with open('results.json', 'w') as f:
        record.content.json(fp=f, indent=4)
def main(*args):
    """Main function called when script is executed directly."""

    # Read input file in as dictionary
    with open(args[0]) as f:
        input_dict = iprPy.input.parse(f, allsingular=True)

    # Interpret and process input parameters
    process_input(input_dict, *args[1:])

    results_dict = dislocationmonopole(
        input_dict['lammps_command'],
        input_dict['initialsystem'],
        input_dict['potential'],
        input_dict['burgersvector'],
        input_dict['C'],
        mpi_command=input_dict['mpi_command'],
        axes=input_dict['transformationmatrix'],
        m=input_dict['stroh_m'],
        n=input_dict['stroh_n'],
        lineboxvector=input_dict['dislocation_lineboxvector'],
        etol=input_dict['energytolerance'],
        ftol=input_dict['forcetolerance'],
        maxiter=input_dict['maxiterations'],
        maxeval=input_dict['maxevaluations'],
        dmax=input_dict['maxatommotion'],
        annealtemp=input_dict['annealtemperature'],
        annealsteps=input_dict['annealsteps'],
        randomseed=input_dict['randomseed'],
        bshape=input_dict['dislocation_boundaryshape'],
        bwidth=input_dict['boundarywidth'])

    # Save data model of results
    script = Path(__file__).stem

    record = iprPy.load_record(record_style)
    record.buildcontent(script, input_dict, results_dict)

    with open('results.json', 'w') as f:
        record.content.json(fp=f, indent=4)
def main(*args):
    """Main function called when script is executed directly."""
    
    # Read input file in as dictionary
    with open(args[0]) as f:
        input_dict = iprPy.input.parse(f, allsingular=True)
    
    # Interpret and process input parameters
    process_input(input_dict, *args[1:])
   
    results_dict = dislocationmonopole(input_dict['lammps_command'],
                                       input_dict['initialsystem'],
                                       input_dict['potential'],
                                       input_dict['burgersvector'],
                                       input_dict['C'],
                                       mpi_command = input_dict['mpi_command'],
                                       axes = input_dict['transformationmatrix'],
                                       m = input_dict['stroh_m'],
                                       n = input_dict['stroh_n'],
                                       lineboxvector  = input_dict['dislocation_lineboxvector'],
                                       etol = input_dict['energytolerance'],
                                       ftol = input_dict['forcetolerance'],
                                       maxiter = input_dict['maxiterations'],
                                       maxeval = input_dict['maxevaluations'],
                                       dmax = input_dict['maxatommotion'],
                                       annealtemp =  input_dict['annealtemperature'],
                                       randomseed = input_dict['randomseed'],
                                       bshape = input_dict['dislocation_boundaryshape'],
                                       bwidth = input_dict['boundarywidth'])
    
    # Save data model of results
    script = os.path.splitext(os.path.basename(__file__))[0]
    
    record = iprPy.load_record(record_style)
    record.buildcontent(script, input_dict, results_dict)
    
    with open('results.json', 'w') as f:
        record.content.json(fp=f, indent=4)
Exemple #23
0
def main(*args):
    """Main function called when script is executed directly."""
    
    # Read input file in as dictionary
    with open(args[0]) as f:
        input_dict = iprPy.input.parse(f, allsingular=True)
    
    # Interpret and process input parameters
    process_input(input_dict, *args[1:])
    
    # Run full_Relax to refine values
    results_dict = relax_dynamic(input_dict['lammps_command'],
                                 input_dict['initialsystem'],
                                 input_dict['potential'],
                                 mpi_command = input_dict['mpi_command'],
                                 p_xx = input_dict['pressure_xx'],
                                 p_yy = input_dict['pressure_yy'],
                                 p_zz = input_dict['pressure_zz'],
                                 p_xy = input_dict['pressure_xy'],
                                 p_xz = input_dict['pressure_xz'],
                                 p_yz = input_dict['pressure_yz'],
                                 temperature = input_dict['temperature'],
                                 runsteps = input_dict['runsteps'],
                                 integrator = input_dict['integrator'],
                                 thermosteps = input_dict['thermosteps'],
                                 dumpsteps = input_dict['dumpsteps'],
                                 equilsteps = input_dict['equilsteps'],
                                 randomseed = input_dict['randomseed'])
    
    # Save data model of results
    script = os.path.splitext(os.path.basename(__file__))[0]
    
    record = iprPy.load_record(record_style)
    record.buildcontent(script, input_dict, results_dict)
    
    with open('results.json', 'w') as f:
        record.content.json(fp=f, indent=4)
def main(*args):
    """Main function for running calculation"""

    # Read input file in as dictionary
    with open(args[0]) as f:
        input_dict = iprPy.input.parse(f, allsingular=True)

    # Interpret and process input parameters
    process_input(input_dict, *args[1:])

    #Read in potential
    potential = lmp.Potential(input_dict['potential'],
                              input_dict['potential_dir'])

    #Get axes info
    axes = np.array(
        [input_dict['x-axis'], input_dict['y-axis'], input_dict['z-axis']])

    # Perform crss calculation
    results_dict = crss(input_dict['lammps_command'],
                        input_dict['initial_system'],
                        potential,
                        input_dict['C'],
                        mpi_command=input_dict['mpi_command'],
                        chi=input_dict['chi_angle'],
                        sigma=input_dict['sigma'],
                        tau_1=input_dict['tau_1'],
                        tau_2=input_dict['tau_2'],
                        press=input_dict['press'],
                        rss_steps=input_dict['rss_steps'],
                        axes=axes)

    # Build and save data model of results
    record = iprPy.load_record(record_style)
    record.buildcontent(input_dict, results_dict)
    with open('results.json', 'w') as f:
        record.content.json(fp=f, indent=4)
Exemple #25
0
def main(*args):
    """Main function called when script is executed directly."""

    # Read input file in as dictionary
    with open(args[0]) as f:
        input_dict = iprPy.input.parse(f, allsingular=True)

    # Interpret and process input parameters
    process_input(input_dict, *args[1:])

    results_dict = stackingfault(
        input_dict['lammps_command'],
        input_dict['initialsystem'],
        input_dict['potential'],
        mpi_command=input_dict['mpi_command'],
        a1vect=input_dict['shiftvector1'],
        a2vect=input_dict['shiftvector2'],
        ucell=input_dict['ucell'],
        transform=input_dict['transformationmatrix'],
        cutboxvector=input_dict['stackingfault_cutboxvector'],
        faultposrel=input_dict['faultpos'],
        a1=input_dict['stackingfault_shiftfraction1'],
        a2=input_dict['stackingfault_shiftfraction2'],
        etol=input_dict['energytolerance'],
        ftol=input_dict['forcetolerance'],
        maxiter=input_dict['maxiterations'],
        maxeval=input_dict['maxevaluations'],
        dmax=input_dict['maxatommotion'])

    # Save data model of results
    script = Path(__file__).stem

    record = iprPy.load_record(record_style)
    record.buildcontent(script, input_dict, results_dict)

    with open('results.json', 'w') as f:
        record.content.json(fp=f, indent=4)
def main(*args):
    """Main function called when script is executed directly."""
    
    # Read input file in as dictionary
    with open(args[0]) as f:
        input_dict = iprPy.input.parse(f, allsingular=True)
    
    # Interpret and process input parameters
    process_input(input_dict, *args[1:])
    
    # Run crystal_compare to compare two systems based on spacegroup info
    results_dict = crystal_space_group(input_dict['ucell'],
                                       symprec=input_dict['symmetryprecision'],
                                       to_primitive=input_dict['primitivecell'],
                                       no_idealize=not input_dict['idealcell'])
    
    # Save data model of results
    script = os.path.splitext(os.path.basename(__file__))[0]
    
    record = iprPy.load_record(record_style)
    record.buildcontent(script, input_dict, results_dict)
    
    with open('results.json', 'w') as f:
        record.content.json(fp=f, indent=4)
Exemple #27
0
def main(*args):
    """Main function called when script is executed directly."""

    # Read input file in as dictionary

    with open(args[0]) as f:
        input_dict = iprPy.input.parse(f, allsingular=True)

    # Interpret and process input parameters

    process_input(input_dict, *args[1:])

    results_dict = DM()

    results_dict['neb_log'] = calc_neb(
        input_dict['lammps_command'],
        input_dict['initialsystem'],
        input_dict['potential'],
        input_dict['initialdefect_number'],
        input_dict['defectpair_number'],
        input_dict['point_mobility_kwargs'],
        input_dict['allSymbols'],
        mpi_command=input_dict['mpi_command'],
        etol=input_dict['energytolerance'],  #From lammps_min
        ftol=input_dict['forcetolerance'],  #From lammps_min
        dmax=input_dict['maxatommotion'],  #From lammps_min
        nreplicas=input_dict['numberreplicas'],  #For NEB
        springconst=input_dict['springconst'],  #For NEB
        thermosteps=input_dict['thermosteps'],  #For NEB
        dumpsteps=input_dict['dumpsteps'],  # For minimization settings
        timestep=input_dict['timestep'],  # For minimization setings 
        minsteps=input_dict['minsteps'],  #For NEB
        climbsteps=input_dict['climbsteps']  #For NEB
    )

    # Load log from completed NEB

    neb = lmp.NEBLog()

    #Printing the number of replicas, and the log for the minruns and climbruns

    print('There were', neb.nreplicas, 'replicas')
    print(neb.minrun)
    print(neb.climbrun)

    #Creating a figure which contains the energy vs movement coordinate information
    #for the initial system, the final minimized system, and the climbed system

    fig = plt.figure()

    rx, e = neb.get_neb_path(0)

    results_dict['unrelaxed_run'] = DM()
    results_dict['unrelaxed_run']['coordinates'] = rx.tolist()
    results_dict['unrelaxed_run']['energy'] = e.tolist()

    plt.plot(rx, e, 'o:', label='unrelaxed')

    rx, e = neb.get_neb_path(neb.minrun.Step.values[-1])

    results_dict['final_minimized_run'] = DM()
    results_dict['final_minimized_run']['coordinates'] = rx.tolist()
    results_dict['final_minimized_run']['energy'] = e.tolist()

    plt.plot(rx, e, 'o:', label='after min run')

    rx, e = neb.get_neb_path(neb.climbrun.Step.values[-1])

    plt.plot(rx, e, 'o:', label='after climb run')

    results_dict['final_climb_run'] = DM()
    results_dict['final_climb_run']['coordinates'] = rx.tolist()
    results_dict['final_climb_run']['energy'] = e.tolist()

    plt.legend()

    plt.title('Defect Formation energy vs Normalized Migration Coordinate')
    plt.xlabel('Migration Coordinate')
    plt.ylabel('Change in formation energy (eV)')

    fig.savefig('EnergyvsCoord.png')

    #Creating a figure which combines the minimum energy path after the
    #minimization step and the climb steps, to give the fullest description
    #of the minimum energy path

    fig2 = plt.figure()

    rx1, e1 = neb.get_neb_path(neb.minrun.Step.values[-1])
    rx2, e2 = neb.get_neb_path(neb.climbrun.Step.values[-1])

    rx = []
    e = []
    index1 = 0
    index2 = 0

    while index2 < len(rx2):  #Going through the coordinates of the
        if rx1[index1] < rx2[index2]:  #minimum and climb steps so that they
            rx.append(rx1[index1])  #are properly ordered
            e.append(e1[index1])
            index1 = index1 + 1
        elif rx1[index1] > rx2[index2]:
            rx.append(rx2[index2])
            e.append(e2[index2])
            index2 = index2 + 1
        elif rx1[index1] == rx2[index1]:
            rx.append(rx1[index1])
            e.append(e1[index1])
            index1 = index1 + 1
            index2 = index2 + 1

    #Storing and ploting resulting information

    results_dict['min_and_climb_run'] = DM()
    results_dict['min_and_climb_run']['coordinates'] = rx
    results_dict['min_and_climb_run']['energy'] = e

    plt.plot(rx, e, 'o:', label='Min and Climb Run Combined')
    plt.legend()

    plt.title('Defect Formation energy vs Normalized Migration Coordinate')
    plt.xlabel('Migration Coordinate')
    plt.ylabel('Change in formation energy (eV)')

    #Creating a record using the calc_point_defect_mobility format

    record = iprPy.load_record(record_style)

    fig2.savefig('min_climb_combined.png')

    #Printing the information on the forward and reverse energy barrier,
    #and storing it in the results dict

    print('Forward barrier =', uc.get_in_units(neb.get_barrier(), 'eV'), 'eV')
    print('Reverse barrier =',
          uc.get_in_units(neb.get_barrier(reverse=True), 'eV'), 'eV')

    script = os.path.splitext(os.path.basename(__file__))[0]

    results_dict['barrier'] = DM()
    results_dict['barrier']['energy_units'] = 'eV'
    results_dict['barrier']['forward_barrier'] = uc.get_in_units(
        neb.get_barrier(), 'eV')
    results_dict['barrier']['reverse_barrier'] = uc.get_in_units(
        neb.get_barrier(reverse=True), 'eV')

    #building a record and printing it

    record.buildcontent(script, input_dict, results_dict)

    with open('results.json', 'w') as f:
        record.content.json(fp=f, indent=4)