def test__evaluate(): pot = EamPotential(symbols=symbols, func_pair=func_pair_name, func_density=func_density_name, func_embedding=func_embedding_name) pot.evaluate( r = r, rho = rho, rcut = r_max, parameters = parameters)
#pot.obj_embedding.evaluate( # rho=rho, # r=r, # parameters=parameters, # o_pair=pot.obj_pair, # o_density=pot.obj_density) # RETEST USING AGGREGATED METHOD print(80 * '-') print("CONSTRUCTOR TEST FOR THE EMBEDDING FUNCTION IN EAMPOTENTIAL CLASS") print(80 * '-') pot = EamPotential(symbols=symbols, func_pair=func_pair_name, func_density=func_density_name, func_embedding=func_embedding_name) pot.evaluate(r=r, rho=rho, rcut=r_max, parameters=parameters) print('type(pot.pair):{}'.format(type(pot.pair))) for s1 in symbols: for s2 in symbols: k = '{}{}'.format(s1, s2) print('{}:{}:{}'.format(k, type(pot.pair[k]), pot.pair[k].shape)) print('type(pot.density):{}'.format(type(pot.density))) for s in symbols: print('{}:{}:{}'.format(s, type(pot.density[s]), pot.density[s].shape)) print('type(pot.embedding):{}'.format(type(pot.embedding))) for s in symbols: print('{}:{}:{}'.format(s, type(pot.embedding[s]), pot.embedding[s].shape))
pot.symbols)) print('pot.parameter_names == {}'.format(\ pot.parameter_names)) print('pot.is_charge == {}'.format(\ pot.is_charge)) print('pot.param == {}'.format(\ pot.param)) print('type(pot.param) == {}'.format(\ str(type(pot.param)))) assert pot.potential_type == 'eam' assert pot.symbols == symbols assert pot.is_charge is False assert isinstance(pot.param, dict) #------------------------------------------------------------------------------ parameters = OrderedDict() parameters['p_NiNi_D0'] = 1.0 parameters['p_NiNi_a'] = 1.0 parameters['p_NiNi_r0'] = lattice_info['Ni'][ 'equilibrium_interatomic_distance'] parameters['d_Ni_rho0'] = 1.0 parameters['d_Ni_beta'] = 1.0 parameters['d_Ni_r0'] = lattice_info['Ni']['equilibrium_interatomic_distance'] parameters['e_Ni_ecoh'] = lattice_info['Ni']['cohesive_energy'] parameters['e_Ni_latticetype'] = lattice_info['Ni']['lattice_type'] parameters['e_Ni_B'] = lattice_info['Ni']['bulk_modulus'] parameters['e_Ni_a0'] = lattice_info['Ni']['lattice_parameter'] pot.evaluate(r=np.array(), rho=np.array(), parameters=parameters)