ufsowa / mcdif

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

Assign spins variable to sites #61

Open ufsowa opened 5 years ago

ufsowa commented 5 years ago

In site class add spin variable. Set spins for given atom type when creating lattice.

ufsowa commented 5 years ago

It is a lot of work to add spin in site. Need to repeat same operations like for atom. Lattice assign, set/get.

Better solution will be to keep mapping vector in potential(cvm class) which will map Atom type to spin.

ufsowa commented 5 years ago

Use add_atom_type(atom,name); in lattice.cpp/h to assigne sipns in the same way as names.

Add vector atoms_spins as atoms_type[typ]=spin Modify function: void lattice :: add_atom_type(int _atom, string name, int spin){

In future use key map here to map name/spin to type http://www.cplusplus.com/forum/general/14982/

ufsowa commented 5 years ago

Done in https://github.com/ufsowa/mcdif/commit/c148e97998010889cbf0b187f27cb140885c7a8a https://github.com/ufsowa/mcdif/commit/cf7b615984e769f01b544ab184facd9c0ee9105f

ufsowa commented 5 years ago

Added declaration of spins to lattice: https://github.com/ufsowa/mcdif/commit/867ebdc9f45a5d0760c0a080df2eb00f1e7c7e02

Add spin to site.

Assign spins to atom when building structure in site new_site(set_prec(x+X),set_prec(y+Y),set_prec(z+Z),ATOM,name,l);

Also assign spins to atoms when reading structure from file: void lattice::read_structure(string file_name,wektor start,wektor end,wektor set_st, int lattice_nr)