diff --git a/Dipolar-Gas-Simulator/+Simulator/@DipolarGas/runGradientDescent.m b/Dipolar-Gas-Simulator/+Simulator/@DipolarGas/runGradientDescent.m index e2eb775..e115ee0 100644 --- a/Dipolar-Gas-Simulator/+Simulator/@DipolarGas/runGradientDescent.m +++ b/Dipolar-Gas-Simulator/+Simulator/@DipolarGas/runGradientDescent.m @@ -3,6 +3,7 @@ function [psi] = runGradientDescent(this,psi,Params,Transf,VDk,V,Observ) format long; AdditionalParams.GradientDescentMethod = this.GradientDescentMethod; + SimulationMode = this.SimulationMode; switch this.GradientDescentMethod case 'HeavyBall' @@ -17,7 +18,7 @@ function [psi] = runGradientDescent(this,psi,Params,Transf,VDk,V,Observ) % Live Plotter if this.PlotLive - Plotter.plotLive(psi,Params,Transf,Observ,this.SimulationMode, AdditionalParams) + Plotter.plotLive(psi,Params,Transf,Observ,SimulationMode,AdditionalParams) drawnow end @@ -63,7 +64,7 @@ function [psi] = runGradientDescent(this,psi,Params,Transf,VDk,V,Observ) Observ.res_idx = Observ.res_idx + 1; if this.PlotLive - Plotter.plotLive(psi,Params,Transf,Observ,this.SimulationMode, AdditionalParams) + Plotter.plotLive(psi,Params,Transf,Observ,SimulationMode,AdditionalParams) drawnow end @@ -84,9 +85,8 @@ function [psi] = runGradientDescent(this,psi,Params,Transf,VDk,V,Observ) E = this.Calculator.calculateTotalEnergy(psi,Params,Transf,VDk,V) / Norm; Observ.EVec = [Observ.EVec E]; - disp('Saving data...'); save(sprintf(strcat(this.SaveDirectory, '/Run_%03i/psi_gs.mat'),Params.njob),'psi','muchem','Observ','Transf','Params','VDk','V'); - disp('Save complete!'); + disp('Completed and saved!'); case 'NonLinearCGD' @@ -104,7 +104,7 @@ function [psi] = runGradientDescent(this,psi,Params,Transf,VDk,V,Observ) % Live plotter if this.PlotLive - Plotter.plotLive(psi,Params,Transf,Observ,this.SimulationMode, AdditionalParams) + Plotter.plotLive(psi,Params,Transf,Observ,SimulationMode,AdditionalParams) drawnow end @@ -182,7 +182,7 @@ function [psi] = runGradientDescent(this,psi,Params,Transf,VDk,V,Observ) % Live plotter if this.PlotLive - Plotter.plotLive(psi,Params,Transf,Observ,this.SimulationMode, AdditionalParams) + Plotter.plotLive(psi,Params,Transf,Observ,SimulationMode,AdditionalParams) drawnow end save(sprintf(strcat(this.SaveDirectory, '/Run_%03i/psi_gs.mat'),Params.njob),'psi','muchem','Observ','Transf','Params','VDk','V');