diff --git a/matlab/colmap_oldformat.m b/matlab/colmap_oldformat.m new file mode 100644 index 0000000..9fb17b0 --- /dev/null +++ b/matlab/colmap_oldformat.m @@ -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 \ No newline at end of file