Fixed issue with creation of save directories.
This commit is contained in:
parent
178350bdc2
commit
5053e3ffba
@ -82,6 +82,7 @@ OptionsStruct.PlotLive = true;
|
|||||||
OptionsStruct.JobNumber = 0;
|
OptionsStruct.JobNumber = 0;
|
||||||
OptionsStruct.RunOnGPU = false;
|
OptionsStruct.RunOnGPU = false;
|
||||||
OptionsStruct.SaveData = false;
|
OptionsStruct.SaveData = false;
|
||||||
|
OptionsStruct.SaveDirectory = './Results/Data_3D/RealTimeDynamics';
|
||||||
options = Helper.convertstruct2cell(OptionsStruct);
|
options = Helper.convertstruct2cell(OptionsStruct);
|
||||||
|
|
||||||
sim = Simulator.DipolarGas(options{:});
|
sim = Simulator.DipolarGas(options{:});
|
||||||
@ -91,7 +92,8 @@ sim.Potential = pot.trap();
|
|||||||
%-% Run Simulation %-%
|
%-% Run Simulation %-%
|
||||||
[Params, Transf, psi, V, VDk] = sim.run();
|
[Params, Transf, psi, V, VDk] = sim.run();
|
||||||
|
|
||||||
SaveDirectory = './Results/Data_3D/RealTimeDynamics';
|
% Save only final state as initial wavefunction for real-time propagation
|
||||||
|
mkdir(sprintf(OptionsStruct.SaveDirectory))
|
||||||
save(sprintf(strcat(SaveDirectory, '/psi_init.mat'),Params.njob),'psi','Transf','Params','VDk','V');
|
save(sprintf(strcat(SaveDirectory, '/psi_init.mat'),Params.njob),'psi','Transf','Params','VDk','V');
|
||||||
close all
|
close all
|
||||||
clear
|
clear
|
||||||
|
@ -3,17 +3,12 @@ function [Params, Transf, psi,V,VDk] = run(this)
|
|||||||
[Params] = this.setupParameters();
|
[Params] = this.setupParameters();
|
||||||
this.SimulationParameters = Params;
|
this.SimulationParameters = Params;
|
||||||
|
|
||||||
if strcmp(this.SimulationMode, 'RealTimeEvolution')
|
|
||||||
this.QuenchSettings = this.setupQuenchSettings(Params);
|
|
||||||
end
|
|
||||||
|
|
||||||
% --- Set up spatial grids and transforms ---
|
% --- Set up spatial grids and transforms ---
|
||||||
[Transf] = this.setupSpace(Params);
|
[Transf] = this.setupSpace(Params);
|
||||||
[TransfRad] = this.setupSpaceRadial(Params);
|
[TransfRad] = this.setupSpaceRadial(Params);
|
||||||
|
|
||||||
% --- Initialize ---
|
% --- Initialize ---
|
||||||
mkdir(sprintf(this.SaveDirectory))
|
mkdir(sprintf(this.SaveDirectory))
|
||||||
|
|
||||||
[psi,V,VDk] = this.initialize(Params,Transf,TransfRad);
|
[psi,V,VDk] = this.initialize(Params,Transf,TransfRad);
|
||||||
|
|
||||||
Observ.EVec = []; Observ.NormVec = []; Observ.PCVec = []; Observ.tVecPlot = []; Observ.mucVec = [];
|
Observ.EVec = []; Observ.NormVec = []; Observ.PCVec = []; Observ.tVecPlot = []; Observ.mucVec = [];
|
||||||
@ -21,11 +16,15 @@ function [Params, Transf, psi,V,VDk] = run(this)
|
|||||||
Observ.res_idx = 1;
|
Observ.res_idx = 1;
|
||||||
|
|
||||||
% --- Run Simulation ---
|
% --- Run Simulation ---
|
||||||
mkdir(sprintf(this.SaveDirectory))
|
if this.DoSave
|
||||||
mkdir(sprintf(strcat(this.SaveDirectory, '/Run_%03i'),Params.njob))
|
mkdir(sprintf(strcat(this.SaveDirectory, '/Run_%03i'),Params.njob))
|
||||||
|
end
|
||||||
if strcmp(this.SimulationMode, 'EnergyMinimization')
|
if strcmp(this.SimulationMode, 'EnergyMinimization')
|
||||||
[psi] = this.runGradientDescent(psi,Params,Transf,VDk,V,Observ);
|
[psi] = this.runGradientDescent(psi,Params,Transf,VDk,V,Observ);
|
||||||
else
|
else
|
||||||
|
if strcmp(this.SimulationMode, 'RealTimeEvolution')
|
||||||
|
this.QuenchSettings = this.setupQuenchSettings(Params);
|
||||||
|
end
|
||||||
[psi] = this.propagateWavefunction(psi,Params,Transf,VDk,V,t_idx,Observ);
|
[psi] = this.propagateWavefunction(psi,Params,Transf,VDk,V,t_idx,Observ);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user