From 308acca29df188da3eb447e0117d8d67fa72a26b Mon Sep 17 00:00:00 2001 From: Karthik Chandrashekara Date: Wed, 20 Nov 2024 00:02:17 +0100 Subject: [PATCH] Corrected the lack of re-calculation of VDk with new variational parameters, changed plotting to accept folder path as argument, increased number of gpus to run solver on. --- .../+Plotter/visualizeGSWavefunction2D.m | 4 +--- Dipolar-Gas-Simulator/+Scripts/analyzeRun2D.m | 4 +--- Dipolar-Gas-Simulator/+Scripts/run_locally.m | 8 ++++++++ .../@DipolarGas/initialize.m | 18 +++--------------- .../bwhpc_matlab_gpe_sim_gpu.slurm | 2 +- 5 files changed, 14 insertions(+), 22 deletions(-) diff --git a/Dipolar-Gas-Simulator/+Plotter/visualizeGSWavefunction2D.m b/Dipolar-Gas-Simulator/+Plotter/visualizeGSWavefunction2D.m index 27cd369..be6d7cc 100644 --- a/Dipolar-Gas-Simulator/+Plotter/visualizeGSWavefunction2D.m +++ b/Dipolar-Gas-Simulator/+Plotter/visualizeGSWavefunction2D.m @@ -1,10 +1,8 @@ -function visualizeGSWavefunction2D(run_index) +function visualizeGSWavefunction2D(folder_path, run_index) set(0,'defaulttextInterpreter','latex') set(groot, 'defaultAxesTickLabelInterpreter','latex'); set(groot, 'defaultLegendInterpreter','latex'); - folder_path = './Data'; - % Load data Data = load(sprintf(horzcat(folder_path, '/Run_%03i/psi_gs.mat'),run_index),'psi','Params','Transf','Observ'); diff --git a/Dipolar-Gas-Simulator/+Scripts/analyzeRun2D.m b/Dipolar-Gas-Simulator/+Scripts/analyzeRun2D.m index e94cf27..3578ff5 100644 --- a/Dipolar-Gas-Simulator/+Scripts/analyzeRun2D.m +++ b/Dipolar-Gas-Simulator/+Scripts/analyzeRun2D.m @@ -1,9 +1,7 @@ -function analyzeRun2D(run_index) +function analyzeRun2D(folder_path, run_index) set(0,'defaulttextInterpreter','latex') set(groot, 'defaultAxesTickLabelInterpreter','latex'); set(groot, 'defaultLegendInterpreter','latex'); - folder_path = './Data'; - % Load data Data = load(sprintf(horzcat(folder_path, '/Run_%03i/psi_gs.mat'),run_index),'psi','Observ','Transf','Params','VParams'); diff --git a/Dipolar-Gas-Simulator/+Scripts/run_locally.m b/Dipolar-Gas-Simulator/+Scripts/run_locally.m index bc48203..033af36 100644 --- a/Dipolar-Gas-Simulator/+Scripts/run_locally.m +++ b/Dipolar-Gas-Simulator/+Scripts/run_locally.m @@ -111,3 +111,11 @@ Plotter.visualizeWavefunction2D(psi,Params,Transf) %% - Plot GS wavefunction Plotter.visualizeGSWavefunction2D(Params.njob) +%% + +folder_path = './Data_TriangularPhase'; +run_index = 1; +Plotter.visualizeGSWavefunction2D(folder_path, run_index) +% analyzeRun2D(folder_path, run_index) + +%% \ No newline at end of file diff --git a/Dipolar-Gas-Simulator/+VariationalSolver2D/@DipolarGas/initialize.m b/Dipolar-Gas-Simulator/+VariationalSolver2D/@DipolarGas/initialize.m index d39f778..b93ccae 100644 --- a/Dipolar-Gas-Simulator/+VariationalSolver2D/@DipolarGas/initialize.m +++ b/Dipolar-Gas-Simulator/+VariationalSolver2D/@DipolarGas/initialize.m @@ -1,24 +1,12 @@ function [psi,V,VDk] = initialize(this,Params,VParams,Transf) - % == User-defined potential == % V = this.Potential; assert(~anynan(V), 'Potential not defined! Specify as .Potential = .trap() + .'); % == Calculating the DDIs == % - if isfile(strcat(this.SaveDirectory, '/VDk_M.mat')) - VDk = load(sprintf(strcat(this.SaveDirectory, '/VDk_M.mat'))); - VDk = VDk.VDk; - VDkSize = size(VDk); - if VDkSize(1) ~= Params.Nx && VDkSize(2) ~= Params.Ny - VDk = this.Calculator.calculateVDkWithCutoff(Transf, Params, VParams); - save(sprintf(strcat(this.SaveDirectory, '/VDk_M.mat')),'VDk'); - fprintf('Saved VDk incomensurate with specified grid points: Computed and saved DDI potential for new grid size in Fourier space with cutoff.\n') - end - else - VDk = this.Calculator.calculateVDkWithCutoff(Transf, Params, VParams); - save(sprintf(strcat(this.SaveDirectory, '/VDk_M.mat')),'VDk'); - fprintf('Computed and saved DDI potential in Fourier space with cutoff.\n') - end + VDk = this.Calculator.calculateVDkWithCutoff(Transf, Params, VParams); + save(sprintf(strcat(this.SaveDirectory, '/VDk_M.mat')),'VDk'); + fprintf('Computed and saved DDI potential in Fourier space with cutoff.\n') % == Setting up the initial wavefunction == % psi = this.setupWavefunction(Params,Transf); diff --git a/Dipolar-Gas-Simulator/bwhpc_matlab_gpe_sim_gpu.slurm b/Dipolar-Gas-Simulator/bwhpc_matlab_gpe_sim_gpu.slurm index 85000f4..9eda034 100644 --- a/Dipolar-Gas-Simulator/bwhpc_matlab_gpe_sim_gpu.slurm +++ b/Dipolar-Gas-Simulator/bwhpc_matlab_gpe_sim_gpu.slurm @@ -5,7 +5,7 @@ # Request number of nodes and GPU for job #SBATCH --nodes=1 #SBATCH --ntasks-per-node=1 -#SBATCH --gres=gpu:A40:1 +#SBATCH --gres=gpu:A40:3 #SBATCH --mem=8G # Estimated wallclock time for job #SBATCH --time=10:00:00