In [ ]:
import os, sys, time
import numpy as np
import mapp4py
from mapp4py import dmd
In [ ]:
from mapp4py import mpi
if mpi().rank!=0:
with open(os.devnull, 'w') as f:
sys.stdout = f;
In [ ]:
sim = dmd.atoms.import_cfg(5,'configs/Al_DMD.cfg')
In [ ]:
def _(id,x_dof,c_dof,alpha_dof,alpha):
if id>3197:
x_dof[0]=False;
x_dof[1]=False;
x_dof[2]=False;
c_dof[0]=False;
sim.do(_)
In [ ]:
sim.ff_eam_setfl("potentials/NiAl.eam.alloy",[3.0],[2.0])
In [ ]:
sim.hP = 4.13566766225 * 0.1 * np.sqrt(1.60217656535/1.66053904020)
sim.kB = 8.617330350e-5
In [ ]:
sim.temp = 300.0
In [ ]:
min_cg = dmd.min_cg();
min_cg.ntally = 1000;
min_cg.e_tol = 1.0e-10;
min_cg.ls = mapp4py.ls_brent();
min_cg.ntally = 0;
In [ ]:
min_cg.run(sim,10000)
In [ ]:
def _(id,alpha_dof,c):
if id>3197:
alpha_dof[0]=False;
if id==0:
c[0]=0.0;
sim.do(_)
In [ ]:
chem = dmd.bdf();
chem.a_tol = 1.0e-6;
chem.ntally = 1;
chem.max_ngmres_iters = 20;
chem.max_nnewton_iters = 100;
chem.max_nsteps = 10000;
chem.nreset = 1;
chem.export = dmd.export_cfg('dumps/dump',10,sort=True,extra_vecs=['c_d'])
In [ ]:
sim.step=0
chem.run(sim,10.0**(30));