From 34a11f0c6a9bd0b3f3d49234d6904fad7c0766dc Mon Sep 17 00:00:00 2001 From: Karthik Chandrashekara Date: Wed, 20 Nov 2024 15:05:47 +0100 Subject: [PATCH] Cosmetic changes, minor parameter tweaks for faster convergence. --- Dipolar-Gas-Simulator/+Scripts/run_on_cluster.m | 4 ++-- .../@Calculator/calculateVDkWithCutoff.m | 6 +++--- .../@Calculator/calculateVariationalEnergy.m | 3 +-- .../+VariationalSolver2D/@DipolarGas/initialize.m | 2 +- Dipolar-Gas-Simulator/bwhpc_matlab_gpe_sim_gpu.slurm | 2 +- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Dipolar-Gas-Simulator/+Scripts/run_on_cluster.m b/Dipolar-Gas-Simulator/+Scripts/run_on_cluster.m index 8fecc6e..d63dd2b 100644 --- a/Dipolar-Gas-Simulator/+Scripts/run_on_cluster.m +++ b/Dipolar-Gas-Simulator/+Scripts/run_on_cluster.m @@ -24,7 +24,7 @@ OptionsStruct.TrapPotentialType = 'None'; OptionsStruct.NumberOfGridPoints = [256, 256]; OptionsStruct.Dimensions = [100, 100]; -OptionsStruct.TimeStepSize = 100E-6; % in s +OptionsStruct.TimeStepSize = 500E-6; % in s OptionsStruct.MinimumTimeStepSize = 1E-5; % in s OptionsStruct.TimeCutOff = 2E6; % in s OptionsStruct.EnergyTolerance = 5E-10; @@ -35,7 +35,7 @@ OptionsStruct.MaxIterations = 20; OptionsStruct.VariationalWidth = 5.7; OptionsStruct.WidthLowerBound = 0.2; OptionsStruct.WidthUpperBound = 12; -OptionsStruct.WidthCutoff = 1e-3; +OptionsStruct.WidthCutoff = 1e-2; OptionsStruct.PlotLive = false; OptionsStruct.JobNumber = 1; diff --git a/Dipolar-Gas-Simulator/+VariationalSolver2D/@Calculator/calculateVDkWithCutoff.m b/Dipolar-Gas-Simulator/+VariationalSolver2D/@Calculator/calculateVDkWithCutoff.m index 1f98cbc..78770de 100644 --- a/Dipolar-Gas-Simulator/+VariationalSolver2D/@Calculator/calculateVDkWithCutoff.m +++ b/Dipolar-Gas-Simulator/+VariationalSolver2D/@Calculator/calculateVDkWithCutoff.m @@ -1,9 +1,9 @@ -function VDk = calculateVDkWithCutoff(~, Transf, Params, VParams) +function VDk = calculateVDkWithCutoff(~, Transf, Params, ell) % == Calculating the DDI potential in Fourier space with appropriate cutoff == % % Interaction in K space - QX = Transf.KX*VParams.ell/sqrt(2); - QY = Transf.KY*VParams.ell/sqrt(2); + QX = Transf.KX*ell/sqrt(2); + QY = Transf.KY*ell/sqrt(2); Qsq = QX.^2 + QY.^2; absQ = sqrt(Qsq); diff --git a/Dipolar-Gas-Simulator/+VariationalSolver2D/@Calculator/calculateVariationalEnergy.m b/Dipolar-Gas-Simulator/+VariationalSolver2D/@Calculator/calculateVariationalEnergy.m index 81f984b..55f1698 100644 --- a/Dipolar-Gas-Simulator/+VariationalSolver2D/@Calculator/calculateVariationalEnergy.m +++ b/Dipolar-Gas-Simulator/+VariationalSolver2D/@Calculator/calculateVariationalEnergy.m @@ -9,8 +9,7 @@ function E = calculateVariationalEnergy(this, psi, Params, ell, Transf, V) normfac = Params.Lx*Params.Ly/numel(psi); % DDIs - VParams.ell = ell; - VDk = this.calculateVDkWithCutoff(Transf, Params, VParams); % VDk depends on the variational parameters. THIS HAS TO BE RECALCULATED HERE FOR THE CONSTRAINED OPTIMIZATION TO WORK! + VDk = this.calculateVDkWithCutoff(Transf, Params, ell); % VDk depends on the variational parameters. THIS HAS TO BE RECALCULATED HERE FOR THE CONSTRAINED OPTIMIZATION TO WORK! frho = fftn(abs(psi).^2); Phi = real(ifftn(frho.*VDk)); Eddi = 0.5*Params.gdd*Phi.*abs(psi).^2/(sqrt(2*pi)*ell);% diff --git a/Dipolar-Gas-Simulator/+VariationalSolver2D/@DipolarGas/initialize.m b/Dipolar-Gas-Simulator/+VariationalSolver2D/@DipolarGas/initialize.m index 81d22b2..37dc116 100644 --- a/Dipolar-Gas-Simulator/+VariationalSolver2D/@DipolarGas/initialize.m +++ b/Dipolar-Gas-Simulator/+VariationalSolver2D/@DipolarGas/initialize.m @@ -4,7 +4,7 @@ function [psi,V,VDk] = initialize(this,Params,VParams,Transf) assert(~anynan(V), 'Potential not defined! Specify as .Potential = .trap() + .'); % == Calculating the DDIs == % - VDk = this.Calculator.calculateVDkWithCutoff(Transf, Params, VParams); + VDk = this.Calculator.calculateVDkWithCutoff(Transf, Params, VParams.ell); % == 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 5fe6b0f..da79093 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:2 #SBATCH --mem=8G # Estimated wallclock time for job #SBATCH --time=4:00:00