ufsowa / mcdif

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

Optimalisation #5

Closed ufsowa closed 8 years ago

ufsowa commented 8 years ago

(1) Consider if all actual variables (BLOCK, HIST, REZ) all needed. (2) Clear control_output.dat (3) Think about Vatom vector, if still neaded. (4) opcja::dislocation_movement -> update_opcja()-> update_plaster -> del_in_plaster Searching of site to delete is very inefficient!!!

ufsowa commented 8 years ago

ad. 3 Vatoms will be kept and updated in testing/controling purposes. At all, it is not so bad to have it. If sth will go wrong, then error will be returned. You are sure that all vacancies are counted properly.

:+1: At the end of simulation, print Vatoms.size() togeather with EVENTS.size().

ufsowa commented 8 years ago

ad. 1 The same situation as with Vatoms.

It will be kept in control/testing purposes. It is easy see what happens in simulation. Possible application in calculating total velocity :boom:

Keep in mind that information from movement of dislocation is stored in BLOCKS and REZ. So no only where vac/atom is crearted/removed, but also whole path is saved. In majority, atoms virtual jumps are counted. Vacancy virtual jumps are counted too, but they cancel themselves. Only first and last point of the path is counted in case of vacancies.

:facepunch: Nothing to change now.

ufsowa commented 8 years ago

ad. 4 Now, when movement of dislocation is performed via vacancy-atom virtual jump, all block are updated stech, vac.

It was designed in that way because equilibration (executing of dislocation movements) starts from specific place and disturb all other regions. Now, it starts from BLOCK nr 0.

for(i=BLOCK.begin; i=BLOCK.end){ do_equlibrate(i); }

If BLOCK[i] is equilibrated, then it can modify all others BLOCK. Lets suppose that, BLOCK[n+1] is checked for equilibration after BLOCK[n] which changed BLOCK[n+1] state.

In normal situation BLOCK[n+1] should be equilibrated. Now it is in doubt. So, this concept is wrong.

Better solution is to not update stech, vac in BLOCKS. This ensure that equilibration is performed due to state obtained by kinetics, not due to kinetic+equilibration. It simulate the situation where all dislocation starts theirs moves in the same time. Then it is no important where equilibration starts, which is :boom:

BLOCKS keep an information about crystal state in given time, after kinetic. Before equilibration starts.

:-1: Delete/comment update of BLOCKS in virtual_jump. :+1: Think how to add update BLOCK?

ufsowa commented 8 years ago

ad. 4

Actual solution was kept -> update after every virtual_jump. Solution of this require changing in choosing a type of atom in opcja::choose_type :facepunch: