addNucleation

PURPOSE ^

add nucleation handling to solver structure

SYNOPSIS ^

function solverState = addNucleation(solverState, pbeDefinition)

DESCRIPTION ^

 add nucleation handling to solver structure

 THIS FUNCTION IS NO USER FUNCTION.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function solverState = addNucleation(solverState, pbeDefinition)
0002 % add nucleation handling to solver structure
0003 %
0004 % THIS FUNCTION IS NO USER FUNCTION.
0005 
0006 % The elk-library: convex geometry applied to crystallization modeling.
0007 %   Copyright (C) 2012 Alexander Reinhold
0008 %
0009 % This program is free software: you can redistribute it and/or modify it
0010 %   under the terms of the GNU General Public License as published by the
0011 %   Free Software Foundation, either version 3 of the License, or (at your
0012 %   option) any later version.
0013 %
0014 % This program is distributed in the hope that it will be useful, but
0015 %   WITHOUT ANY WARRANTY; without even the implied warranty of
0016 %   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0017 %   General Public License for more details.
0018 %
0019 % You should have received a copy of the GNU General Public License along
0020 %   with this program.  If not, see <http://www.gnu.org/licenses/>.
0021 
0022 %% Task
0023 % it adds:
0024 %   * nucleation pivot at nucleation size (number=0)
0025 %   * nucleation boundary at nucleation size (number=0)
0026 
0027 if ~solverState.flagNucleation
0028     
0029     solverState.flagNucleation = 1;
0030     
0031     solverState.hcMatrix = [pbeDefinition.nucleationSize ...
0032                             pbeDefinition.nucleationSize ...
0033                             solverState.hcMatrix];
0034     [hcMatrixDump upVector ~] = ensureProperDecData(...
0035         pbeDefinition.nucleationSize(1:pbeDefinition.nDecCoordinate, 1), ... 
0036         1, pbeDefinition);
0037     solverState.upVector = [[1 1] * upVector, solverState.upVector];
0038     %! Dev: the below should now be obsolete by the above lines
0039 %     solverState.upVector = [[1 1] * computeUpVector(pbeDefinition, ...
0040 %         pbeDefinition.nucleationSize(1:pbeDefinition.nDecCoordinate, :), ...
0041 %         elkZerotol) ...
0042 %         solverState.upVector];
0043     %/
0044 %     solverState.upVector = [...
0045 %         [1 1] * computePartitionIndexDec(pbeDefinition.dec, ...
0046 %           pbeDefinition.nucleationSize(1:pbeDefinition.nDecCoordinate, :), [], 1) ...
0047 %         solverState.upVector];
0048    
0049 
0050     solverState.numberVector = [0 0 solverState.numberVector];
0051     
0052     solverState.indexVector = [-2 0 solverState.indexVector];
0053     
0054     if solverState.flagDensity
0055         solverState.probabilityVector = [inf inf solverState.probabilityVector];
0056     end
0057 else
0058     error('elk:solver:generalError', ['nucleation phenomena shall be ' ...
0059         'added while it is already presend']);
0060 end

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