Skip to content

Commit

Permalink
Message: Updates since last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Legaspi committed Feb 10, 2014
1 parent a8372be commit 14be409
Show file tree
Hide file tree
Showing 15 changed files with 394 additions and 153 deletions.
209 changes: 162 additions & 47 deletions BondOrderScript.m

Large diffs are not rendered by default.

43 changes: 33 additions & 10 deletions BondOrderScript_JKLDrives.m
Original file line number Diff line number Diff line change
@@ -1,13 +1,35 @@
% %% DON'T RUN FROM HERE
%
% while false
%% Get already-run calcs with a given file prefix
field = [];

if (true)
fn = '8-merPPV-N2Optimized';


flist = dir('j:\NoAngle\*.mat');
for i = 1:length(flist)
fstr = regexpi(flist(i).name, ['^',fn,'-([0-9.]+)VA\.mat$'], 'tokens');
if (~isempty(fstr))
field(end+1) = str2double(fstr{1}{1});
end
end

field = sort(field,'ascend');

S = load(['j:\NoAngle\',fn,'-0VA.mat']);

%% Run multiple molecules
mols = {fn,field(end),S.obj.axis_params};
else


%% If you didn't load the data from above, insert data to run here (or Run multiple molecules)
mols = {'15-merPPV-N2Optimized',.083,[3 118]};
end

%% Set other params and run

mols = {'MeLPPP-13mer',.064,[1 186]};
nstates = 25;
norbs = 1000;
poolsize = 7;
poolsize = 3;

run_energy_calcs = false;
load_data = true;
Expand All @@ -30,10 +52,11 @@
% system(['subst s: "',rootdir,SFolder,'"']);
% system(['subst o: "',rootdir,OFolder,'"']);
% system(['subst p: "',rootdir,PFolder,'"']);

field = 0:0.001:mols{imol,2};
% field = [0:0.001:0.045, 0.0452:0.0002:0.065, 0.066:0.001:mols{imol,2}];

if (isempty(field))
field = 0:0.001:mols{imol,2};
%field = [0:0.001:0.054, 0.0542:0.0002:0.083, 0.084:0.001:mols{imol,2}];
%field = [0:0.001:0.054, 0.0542:0.0002:mols{imol,2}];
end

%% Are you loading pre-existing data? Set this to false.
if (run_energy_calcs)
Expand Down
29 changes: 16 additions & 13 deletions EnergyCalcExp.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
fail_iterator; % unsigned int: keeps track of the next index available in fail_bucket.
% length(fail_bucket) = m = fail_iterator - 1

ampacexe = '"c:\Program Files\Semichem, Inc\Ampac-10.1\ampac.exe"'; % Path to the AMPAC executable, including " marks
sysvars; % Contains paths to ampac and indo and other info for the system that runs this calculation
ampacexe; % Ampac path with leading and trailing " marks
end

properties (SetAccess = public)
Expand Down Expand Up @@ -371,14 +372,8 @@
% Output:
% obj: EnergyCalcExp object. The constructed object.
%--------------------------------------------------------------------------------------------------%
function obj = EnergyCalcExp(parameters, mol, axis_params, MAT, indo, ampac, load_libs, varargin)
if (~exist('c:\Program Files\Semichem, Inc\Ampac-10.1\ampac.exe','file'))
if (exist('c:\Program Files (x86)\Semichem, Inc\Ampac-10.1\ampac.exe','file'))
obj.ampacexe = '"c:\Program Files (x86)\Semichem, Inc\Ampac-10.1\ampac.exe"';
else
throw(MException('EnergyCalcExp:InvalidAmpacPath','EnergyCalcExp: Cannot find AMPAC! Update path'));
end
end
function obj = EnergyCalcExp(parameters, mol, axis_params, MAT, indo, ampac, load_libs, description, sysvars)

if (nargin > 4)
% pause(0.02); % Hard drive delay catch-up...
if (~exist(mol,'file'))
Expand All @@ -390,10 +385,18 @@
obj.MATFilename = MAT;
obj.molecule = mol;
obj.axis_params = axis_params;
obj.description = description;

if (~isempty(varargin))
obj.description = varargin{1};
if (~isempty(sysvars))
obj.sysvars = sysvars;
else
obj.sysvars = ECESysVars.getInstance;
warning('off','ECESysVars:AlreadyInit');
obj.sysvars.initialize;
warning('on','ECESysVars:AlreadyInit');
end

obj.ampacexe = ['"',sysvars.getVars('ampac'),'"'];

if (indo(end) ~= '\')
indo = [indo, '\'];
Expand Down Expand Up @@ -665,7 +668,7 @@
tmp_indo_path = tmp_indo_path(1:end-1);
end

indo = Indo(indoparams, tmp_ampac_path, ampac.hash, tmp_indo_path, indo_out.hash);
indo = Indo(indoparams, tmp_ampac_path, ampac.hash, tmp_indo_path, indo_out.hash, obj.sysvars);
%
% if (indoparams.output_dm)
% movefile([obj.ampacdatapath, ampac.hash, '-dm.bin'], ...
Expand Down Expand Up @@ -1501,7 +1504,7 @@
tmp_indo_path = tmp_indo_path(1:end-1);
end

indo = Indo(indoparams, tmp_ampac_path, ampac.hash, tmp_indo_path, indo_out.hash);
indo = Indo(indoparams, tmp_ampac_path, ampac.hash, tmp_indo_path, indo_out.hash, obj.sysvars);

indo_out.indo = indo;

Expand Down
18 changes: 13 additions & 5 deletions Indo.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
ehsci % (i,1) hole of the ith SCI basis function (0 if GS)
% (i,2) = elec of the ith SCI basis function (0 if GS)

indoExe = '"c:\mscpp\demo-dci-working.exe"';
% indoExe = '"c:\mscpp\demo-dci\Release\demo-dci.exe"';
indoExe; % Path to INDO exe
end % properties
properties (Transient)
osc % (1,i) oscillator strength from gs to state i
Expand Down Expand Up @@ -159,7 +158,8 @@ function readIndo(obj, inputfile)
end
end
methods
function res = Indo(ConfigIn, dataPathIn, jobNameIn, varargin)
function res = Indo(ConfigIn, dataPathIn, jobNameIn, dataPathOut, jobNameOut, sysvars)

if (nargin < 1)
res.config = Indo.defaultConfig();
else
Expand All @@ -178,13 +178,21 @@ function readIndo(obj, inputfile)
if (nargin < 4)
res.dataPathOut = res.dataPathIn;
else
res.dataPathOut = varargin{1};
res.dataPathOut = dataPathOut;
end
if (nargin < 5)
res.jobNameOut = res.jobNameIn;
else
res.jobNameOut = varargin{2};
res.jobNameOut = jobNameOut;
end
if (nargin < 6)
sysvars = ECESysVars.getInstance;
warning('off','ECESysVars:AlreadyInit');
sysvars.initialize;
warning('on','ECESysVars:AlreadyInit');
end
res.indoExe = ['"',sysvars.getVars('indo'),'"'];

if (nargin > 0)
% jobstring = [res.indoExe,' "',res.dataPath,'\',res.jobName,'"', ...
% ' ',num2str(res.config.charge), ...
Expand Down
36 changes: 18 additions & 18 deletions LoadPPVData.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,58 +2,58 @@

%% 6-mer PPV Unrelaxed

rootdir = 'C:\Users\clegaspi\Documents\MATLAB\data\6-merPPV\';
loadrootdir = 'C:\Users\clegaspi\Documents\MATLAB\data\6-merPPV\';
mat_file_path = {'..\6-merPPV-EvsF.mat'};

%% 7-mer PPV Unrelaxed

rootdir = 'C:\Users\clegaspi\Documents\MATLAB\data\7-merPPV\';
loadrootdir = 'C:\Users\clegaspi\Documents\MATLAB\data\7-merPPV\';
mat_file_path = {'..\7-merPPV-EvsF.mat'};

%% 8-mer PPV Unrelaxed

rootdir = 'C:\Users\clegaspi\Documents\MATLAB\data\8-merPPV\';
loadrootdir = 'C:\Users\clegaspi\Documents\MATLAB\data\8-merPPV\';
mat_file_path = {'..\8-merPPV-EvsF.mat'};

%% 9-mer PPV Unrelaxed

rootdir = 'C:\Users\clegaspi\Documents\MATLAB\data\9-merPPV\';
loadrootdir = 'C:\Users\clegaspi\Documents\MATLAB\data\9-merPPV\';
mat_file_path = {'..\9-merPPV-EvsF.mat'};

%% 10-mer PPV Unrelaxed

rootdir = 'C:\Users\clegaspi\Documents\MATLAB\data\10-merPPV\';
loadrootdir = 'C:\Users\clegaspi\Documents\MATLAB\data\10-merPPV\';
mat_file_path = {'..\10-merPPV-EvsF.mat'};

%% 13-mer PPV Unrelaxed

rootdir = 'C:\Users\clegaspi\Documents\MATLAB\data\13-merPPV\';
loadrootdir = 'C:\Users\clegaspi\Documents\MATLAB\data\13-merPPV\';
mat_file_path = {'..\13-merPPV-EvsF.mat'};

%% 15-mer PPV Unrelaxed

rootdir = 'C:\Users\clegaspi\Documents\MATLAB\data\15-merPPV\';
loadrootdir = 'C:\Users\clegaspi\Documents\MATLAB\data\15-merPPV\';
mat_file_path = {'..\15-merPPV-EvsF.mat'};


%% 17-mer PPV Unrelaxed

rootdir = 'C:\Users\clegaspi\Documents\MATLAB\data\17-merPPV\';
loadrootdir = 'C:\Users\clegaspi\Documents\MATLAB\data\17-merPPV\';
mat_file_path = {'..\17-merPPV-EvsF.mat'};

%% 20-mer PPV Unrelaxed

rootdir = 'C:\Users\clegaspi\Documents\MATLAB\data\20-merPPV\';
loadrootdir = 'C:\Users\clegaspi\Documents\MATLAB\data\20-merPPV\';
mat_file_path = {'..\20-merPPV-EvsF.mat'};

%% Load data here

if (rootdir(end) ~= '\')
rootdir = [rootdir, '\'];
if (loadrootdir(end) ~= '\')
loadrootdir = [loadrootdir, '\'];
end

for i = 1:length(mat_file_path)
load([rootdir, mat_file_path{i}]);
load([loadrootdir, mat_file_path{i}]);
end

if (strcmpi(myexp.ampacdatapath, 'p:\'))
Expand All @@ -70,10 +70,10 @@
OFolder = 'INDOLib';
PFolder = 'GSLib';

system('subst ',expt,': /d');
system('subst ',indo,': /d');
system('subst ',ampac,': /d');
system(['subst ',expt,': /d']);
system(['subst ',indo,': /d']);
system(['subst ',ampac,': /d']);

system(['subst ',expt,': "',rootdir,SFolder,'"']);
system(['subst ',indo,': "',rootdir,OFolder,'"']);
system(['subst ',ampac,': "',rootdir,PFolder,'"']);
system(['subst ',expt,': "',loadrootdir,SFolder,'"']);
system(['subst ',indo,': "',loadrootdir,OFolder,'"']);
system(['subst ',ampac,': "',loadrootdir,PFolder,'"']);
10 changes: 6 additions & 4 deletions OptExcStateStructure.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@

% ampac_pathonly = 'C:\Users\Christian\Documents\Research\Yaron\dyes2\data\DMG-8mer\';
% ampac_nameonly = '8-merPPVampac';

% EXECUTABLE PATHWAYS, NO QUOTES
AmpacEXE = 'C:\Program Files\Semichem, Inc\Ampac-10.1\ampac.exe';
OpenBabelEXE = 'C:\Program Files (x86)\OpenBabel-2.3.2\babel.exe';
if (~ECE_system_vars('check'))
ECE_system_vars('setall');
end

global AMPACEXE;
AmpacEXE = AMPACEXE;


indoidx = find(cellfun(@(x)isequal(lower(x),'indo'), varargin));
Expand Down
19 changes: 15 additions & 4 deletions SetUpSubstDrives.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

%% Load substituted drives

rootdir = fullfile(pwd,'data\8-merPPV-newampac\Coupling');
rootdir = fullfile(pwd,'..\data\17-merPPV\');
% rootdir = fullfile('C:\Users\clegaspi\Documents\MATLAB\data\13-merPPV\');
SFolder = 'Exp';
OFolder = 'INDOLib';
PFolder = 'GSLib';
Expand All @@ -18,7 +19,12 @@
end

if (~exist(rootdir,'dir'))
mkdir(rootdir);
response = questdlg('This directory does not exist. Create?','Dir DNE','Yes','No','Yes');
if (strcmp(response,'Yes'))
mkdir(rootdir);
else
return;
end
end
if (~exist([rootdir,SFolder],'dir'))
mkdir([rootdir,SFolder]);
Expand Down Expand Up @@ -46,7 +52,7 @@

%% Load substituted drives

rootdir = 'C:\Users\clegaspi\Documents\MATLAB\data\MeLPPP-13mer\';
rootdir = fullfile(pwd,'..\data\PFH-13mer-N2Opt\');
SFolder = 'Exp';
OFolder = 'INDOLib';
PFolder = 'GSLib';
Expand All @@ -56,7 +62,12 @@
end

if (~exist(rootdir,'dir'))
mkdir(rootdir);
response = questdlg('This directory does not exist. Create?','Dir DNE','Yes','No','Yes');
if (strcmp(response,'Yes'))
mkdir(rootdir);
else
return;
end
end
if (~exist([rootdir,SFolder],'dir'))
mkdir([rootdir,SFolder]);
Expand Down
12 changes: 2 additions & 10 deletions ampac_to_xyz.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,8 @@
%AMPAC_TO_XYZ Summary of this function goes here
% Detailed explanation goes here

% OpenBabelEXE = 'C:\Program Files (x86)\OpenBabel-2.3.2\babel.exe';
ampacexe = 'C:\Program Files\Semichem, Inc.\Ampac-10.1\ampac.exe';

if (~exist(ampacexe, 'file'))
if (exist('C:\Program Files (x86)\Semichem, Inc.\Ampac-10.1\ampac.exe', 'file'))
ampacexe = 'C:\Program Files (x86)\Semichem, Inc.\Ampac-10.1\ampac.exe';
else
throw(MException('ampac_to_xyz:AmpacNotFound', 'ampac_to_xyz: AMPAC EXE not found. Please edit.'));
end
end
sysvars = ECESysVars.getInstance;
ampacexe = sysvars.getVars('ampac');

if (iscell(input))
zmatrix = input;
Expand Down
4 changes: 2 additions & 2 deletions closest_member.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
[b,ix] = sort(myset,'ascend');

for i = 1:length(b)
if (b(i) < a)
if (b(i) < a && i < length(b))
continue;
elseif (b(i) == a)
elseif (b(i) == a || (b(i) < a && i == length(b)))
varargout{1} = b(i);
switch nargout
case 2
Expand Down
8 changes: 7 additions & 1 deletion distort_geometry.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
function newzmatrix = distort_geometry(zmatrix, ring_info, newblsbyatom, varargin)
AmpacEXE = 'C:\Program Files\Semichem, Inc\Ampac-10.1\ampac.exe';
if (~ECE_system_vars('check'))
ECE_system_vars('setall');
end

global AMPACEXE;
AmpacEXE = AMPACEXE;

newzmatrix = zmatrix;
natoms = size(zmatrix, 1);
rings = {ring_info.rings};
Expand Down
Loading

0 comments on commit 14be409

Please sign in to comment.