oldformat column map

This commit is contained in:
Michael Stumpf 2018-12-03 17:08:32 +01:00
parent 081a4104d9
commit 261f685463
1 changed files with 40 additions and 0 deletions

40
matlab/colmap_oldformat.m Normal file
View File

@ -0,0 +1,40 @@
function [col] = colmap_oldformat(iscal)
% [col] = colmap_oldformat(iscal)
% Create a containers.Map object with particle column order.
% Input
% iscal scalar written? (number of scalars)
% Output
% col column map which can be indexed by e.g. col('x')
col = containers.Map('KeyType','char','ValueType','double');
ioffset = 0;
col('x') = ioffset+1;
col('y') = ioffset+2;
col('z') = ioffset+3;
col('r') = ioffset+4;
col('rho')= ioffset+5;
col('ax') = ioffset+6;
col('ay') = ioffset+7;
col('az') = ioffset+8;
col('u') = ioffset+9;
col('v') = ioffset+10;
col('w') = ioffset+11;
col('ox') = ioffset+12;
col('oy') = ioffset+13;
col('oz') = ioffset+14;
col('fx') = ioffset+15;
col('fy') = ioffset+16;
col('fz') = ioffset+17;
col('tx') = ioffset+18;
col('ty') = ioffset+19;
col('tz') = ioffset+20;
ioffset = ioffset+20;
if iscal
for ii=1:iscal
col(['s',sprintf('%d',ii)]) = ioffset+1;
col(['q',sprintf('%d',ii)]) = ioffset+2;
ioffset = ioffset+2;
end
end
col('id') = ioffset+1;
end