printMillerSummary

PURPOSE ^

print information on Miller indices

SYNOPSIS ^

function printMillerSummary(cdef, P)

DESCRIPTION ^

 print information on Miller indices

 This includes a verification of completenes and conflicts.

 THIS IS NO USER FUNCTION

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function printMillerSummary(cdef, P)
0002 % print information on Miller indices
0003 %
0004 % This includes a verification of completenes and conflicts.
0005 %
0006 % THIS IS NO USER FUNCTION
0007 
0008 % The elk-library: convex geometry applied to crystallization modeling.
0009 %   Copyright (C) 2013 Alexander Reinhold
0010 %
0011 % This program is free software: you can redistribute it and/or modify it
0012 %   under the terms of the GNU General Public License as published by the
0013 %   Free Software Foundation, either version 3 of the License, or (at your
0014 %   option) any later version.
0015 %
0016 % This program is distributed in the hope that it will be useful, but
0017 %   WITHOUT ANY WARRANTY; without even the implied warranty of
0018 %   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0019 %   General Public License for more details.
0020 %
0021 % You should have received a copy of the GNU General Public License along
0022 %   with this program.  If not, see <http://www.gnu.org/licenses/>.
0023 
0024 disp(' ');
0025 if isfield(cdef, 'millerDefined')
0026     %% obtain Miller information
0027     % defined miller indices
0028     millerDefinedMatrix = cdef.millerDefined;
0029     millerDefinedStringList = convertMillerToString(...
0030         millerDefinedMatrix, '{');
0031     if ~iscell(millerDefinedStringList)
0032         millerDefinedStringList = {millerDefinedStringList};
0033     end
0034     % grouped information
0035     millerGroupList = {};
0036     millerCompleteMatrix = zeros(0, 3);
0037     for i = 1:size(cdef.millerDefined, 1)
0038         thisGroup =  executeExternBorchertFunction('form2face', ...
0039             cdef.millerDefined(i, :), P(2, cdef.sym.defined));
0040         millerGroupList{i} = sortrows(thisGroup);
0041         millerCompleteMatrix = [millerCompleteMatrix; thisGroup];
0042     end
0043     millerCompleteMatrix = sortrows(millerCompleteMatrix);
0044     
0045     %% Output facet information
0046     disp('You selected the following face groups and resulting faces: ');
0047     for iGroup = 1:length(millerGroupList)
0048         outstring = ['   ' millerDefinedStringList{iGroup} ': '];
0049         thisFacetStringList = convertMillerToString(...
0050             millerGroupList{iGroup}, '(');
0051         if ~iscell(thisFacetStringList)
0052             thisFacetStringList = {thisFacetStringList};
0053         end
0054         for iStr = 1:length(thisFacetStringList)
0055             outstring = [outstring thisFacetStringList{iStr} ', '];
0056         end
0057         outstring(end-1:end) = [];
0058         disp(outstring);
0059     end
0060     
0061     %% output interfering groups (not unique)
0062     interfering = [];
0063     for i = 1:size(millerDefinedMatrix, 1)
0064         for j = (i+1):size(millerDefinedMatrix, 1)
0065             filter = (millerGroupList{i}(:,1) == millerDefinedMatrix(j,1)) & ...
0066                 (millerGroupList{i}(:,2) == millerDefinedMatrix(j,2)) & ...
0067                 (millerGroupList{i}(:,3) == millerDefinedMatrix(j,3));
0068             if sum(filter) > 0
0069                 interfering(end+1, :) = [i, j];
0070             end
0071         end
0072     end
0073     if isempty(interfering)
0074         disp('No interfering crystal forms detected.')
0075     else
0076         interfering
0077         for i = 1:size(interfering, 1)
0078             disp(['CRYSTAL FORM ' millerDefinedStringList{interfering(i,1)}...
0079                 ' DOES INTERFERE WITH '...
0080                 millerDefinedStringList{interfering(i,2)} '.']);
0081         end
0082     end
0083     %% output, if shape is complete
0084     % Therefore, we construct a polytope and investigate if it is flat.
0085     hrep = struct('A', millerCompleteMatrix, 'h', ...
0086         ones(size(millerCompleteMatrix, 1), 1));
0087     vrep = convertHrepToVrep(hrep, elkZerotol, 1e5);
0088     if any(abs(vrep.V(:)) > 1e4)
0089         disp('DEFINITION OF CRYSTAL FORMS NOT YET COMPLETED.');
0090     else
0091         disp('Enough faces defined for a closed shape.');
0092     end
0093 else
0094     disp('Please define crystal forms.');
0095 end

Generated on Sat 18-Jul-2015 16:45:31 by m2html © 2005