Added job number as a property of DipolarGas class.

This commit is contained in:
Karthik 2024-06-18 13:52:38 +02:00
parent 263805dd7a
commit d0849a8680
3 changed files with 7 additions and 2 deletions

View File

@ -24,6 +24,7 @@ OptionsStruct.TimeStepSize = 50E-6; % in s
OptionsStruct.NumberOfTimeSteps = 100; % in s
OptionsStruct.EnergyTolerance = 5E-10;
OptionsStruct.JobNumber = 6;
OptionsStruct.SaveData = true;
OptionsStruct.SaveDirectory = './Data';
options = Helper.convertstruct2cell(OptionsStruct);
@ -31,7 +32,7 @@ clear OptionsStruct
sim = Simulator.DipolarGas(options{:});
pot = Simulator.Potentials(options{:});
sim.Potential = pot.trap(); % + pot.repulsive_stirrer();
sim.Potential = pot.trap(); % + pot.repulsive_chopstick();
%-% Run Simulation %-%
[Params, Transf, psi, V, VDk] = sim.run();

View File

@ -22,6 +22,7 @@ classdef DipolarGas < handle & matlab.mixin.Copyable
%Flags
JobNumber;
DebugMode;
DoSave;
SaveDirectory;
@ -61,6 +62,8 @@ classdef DipolarGas < handle & matlab.mixin.Copyable
@(x) assert(isnumeric(x) && isscalar(x) && (x > 0)));
addParameter(p, 'MinimumTimeStepSize', 1e-6,...
@(x) assert(isnumeric(x) && isscalar(x) && (x > 0)));
addParameter(p, 'JobNumber', 1,...
@(x) assert(isnumeric(x) && isscalar(x) && (x > 0)));
addParameter(p, 'DebugMode', false,...
@islogical);
addParameter(p, 'SaveData', false,...
@ -84,6 +87,7 @@ classdef DipolarGas < handle & matlab.mixin.Copyable
this.EnergyTolerance = p.Results.EnergyTolerance;
this.MinimumTimeStepSize = p.Results.MinimumTimeStepSize;
this.JobNumber = p.Results.JobNumber;
this.DebugMode = p.Results.DebugMode;
this.DoSave = p.Results.SaveData;
this.SaveDirectory = p.Results.SaveDirectory;

View File

@ -50,7 +50,7 @@ function [Params] = setupParameters(this)
% even though the solution is good, this just stops it going on forever
Params.mindt = this.MinimumTimeStepSize; % Minimum size for a time step using adaptive dt
Params.njob = 6;
Params.njob = this.JobNumber;
% ================ Parameters defined by those above ================ %