ufsowa / mcdif

Monte Carlo based alghoritms used to simulate thermodynamic and kinetic properties of the alloys
3 stars 4 forks source link

Add fake atom #63

Closed ufsowa closed 5 years ago

ufsowa commented 5 years ago

Add atoms to simulate different shapes of the surfaces

ufsowa commented 5 years ago

It is assumed that faked atoms have type -1

Things to change are: site.cpp get_atom()

lattice.cpp check_site_belonging_to_sim_area <-- THIS is important place bool lattice :: check_site_belonging_to_region(site *A){

void lattice::sim_atoms_list_init() if(atom >= 0) - no faked atoms will be added to sim_atom_list

There is also atom_list with all atoms. We want to have that if faked atom then (1) no faked interaction at all (energy neighbours) (2) no faked atoms in neighbours (jumps) (3) no faked atom in sim_atom_listand atom_list.

void lattice :: sites_zone_init(int typ, double rmin, double rmax, site atom_list, vector <site> &atom_neigh)

void lattice :: jumps_shell_init(){

ufsowa commented 5 years ago

When reading structure from file, first read all atoms then do initialization of neighs. It is ok.

Currently the lattice is set up on the base of structure.in and then file is read After that simulation is initialized

ufsowa commented 5 years ago

Structure is initialized correctly. There is a problem with executing algorithm/energy calculation SGCMC change type to -1 and that leads to [-1] corruption.

Change needed in: unsigned int lattice :: get_atom_typ_numbers() mc.cpp void sgcmc(l new_typ=sample->get_atom_type(typ)

DIRECT fails too, No type change. There is a problem ni pot.get_energy

ufsowa commented 5 years ago

Fix savings to care about type < 0 Need to handle this situation in other way

ufsowa commented 5 years ago

Very usefull tool in case of segmentation fault: dynamic analysis http://valgrind.org/docs/manual/quick-start.html#quick-start.intro static analysis: https://stackoverflow.com/questions/3718998/fixing-segmentation-faults-in-c

ufsowa commented 5 years ago

Added check for types and fixed savings.

TODO:

I. Tests

(0) Fix save_Natoms to exlcude faked form file. Keep it only in global. (1) load structure from file a: pic (SGCMC) b: diff (KMC) (2) add single faked atom and check observability (3) Do simulations in 2D with faked atoms and without it

II. Remove/modify printouts for atoms <0. IN some cases should be error, in other only printouts.

ufsowa commented 5 years ago

All done. Remaining is: (3) Do simulations in 2D with faked atoms and without it

ufsowa commented 5 years ago

DONE.

SGCMC also works.

KMC under test. Done and works