obtainAbsTolVector

PURPOSE ^

create abs tol vector from given solver state structure

SYNOPSIS ^

function absTol = obtainAbsTolVector(solverState, absTolPosition,absTolNumber, absTolBulk, absTolDensity)

DESCRIPTION ^

 create abs tol vector from given solver state structure

 THIS IS NO USER FUNCTION

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function absTol = obtainAbsTolVector(solverState, absTolPosition, ...
0002     absTolNumber, absTolBulk, absTolDensity)
0003 % create abs tol vector from given solver state structure
0004 %
0005 % THIS IS NO USER FUNCTION
0006 
0007 % The elk-library: convex geometry applied to crystallization modeling.
0008 %   Copyright (C) 2012 Alexander Reinhold
0009 %
0010 % This program is free software: you can redistribute it and/or modify it
0011 %   under the terms of the GNU General Public License as published by the
0012 %   Free Software Foundation, either version 3 of the License, or (at your
0013 %   option) any later version.
0014 %
0015 % This program is distributed in the hope that it will be useful, but
0016 %   WITHOUT ANY WARRANTY; without even the implied warranty of
0017 %   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0018 %   General Public License for more details.
0019 %
0020 % You should have received a copy of the GNU General Public License along
0021 %   with this program.  If not, see <http://www.gnu.org/licenses/>.
0022 
0023 %% rewrite hcMatrix
0024 solverState.hcMatrix = solverState.hcMatrix*0 + absTolPosition;
0025 %% rewrite numberVector
0026 solverState.numberVector = solverState.numberVector*0 + absTolNumber;
0027 %% rewrite bulkVector
0028 if numel(absTolBulk) == 1
0029     solverState.bulkStateVector = solverState.bulkStateVector*0 + absTolBulk;
0030 elseif length(absTolBulk) == length(solverState.bulkStateVector)
0031     solverState.bulkStateVector = absTolBulk;
0032 else
0033     error('elk:populationBalance:wrongInput', ...
0034         ['Absolute tolerance for bulk state does not match dimension of ' ...
0035          'bulk state vector']);
0036 end
0037 %% density
0038 if solverState.flagDensity
0039     solverState.probabilityVector = solverState.probabilityVector*0 + ...
0040         absTolDensity;
0041 end
0042 
0043 %% pack to vector
0044 % ..that matches the state vector
0045 absTol = packState(solverState);

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