A small update below,
For randomized alloys it may be also necessary to load the material type, so the script below also imports the material type from the atom-coords file.
We need to check with the creators if this is enough to have good calculations of energy terms.
Best,
Gabriel
----------------------------------
long int numberofatoms,i=0;
double sx,sy,sz,atomiclayer,materialtype;
std::string myText;
std::ifstream initialspinfile("spins-00000000.ini");
//Load spin data
if(!initialspinfile){
std::cerr << "Spin direction file could not be opened.\n";
exit(EXIT_FAILURE);
} else {
initialspinfile >> numberofatoms;
while (initialspinfile >> sx >> sy >> sz) {
atoms::x_spin_array[i] = sx;
atoms::y_spin_array[i] = sy;
atoms::z_spin_array[i] = sz;
i++;
}
initialspinfile.close();
}
//Copy materials type structure.
initialspinfile.open("atoms-coords.ini");
i=0;
if(!initialspinfile){
std::cerr << "Atom definition file could not be opened.\n";
exit(EXIT_FAILURE);
} else {
initialspinfile >> numberofatoms;
while (initialspinfile >> materialtype >> atomiclayer >> sx >> sy >> sz) {
atoms::type_array[i] = materialtype;
i++;
}
initialspinfile.close();
}
stats::mag_m();
vout::data();