1 function UDXoutput2Dtimeseries(filename,p,t,u,attr_name,attr_rank,attr_shape,time)
4 ## UDXoutput2Dtimeseries(filename,p,t,u,attr_name,attr_rank,attr_shape,time)
6 ## Outputs data in DX form.
7 ## Only one variable can be written to the file
8 ## variable must be a scalar, vector or tensor of doubles
10 ## attr_name = name of the variable (type string)
11 ## attr_rank = rank of variable data (0 for scalar, 1 for vector, etc.)
12 ## attr_shape = number of components of variable data (assumed 1 for scalar)
16 % This file is part of
18 % SECS2D - A 2-D Drift--Diffusion Semiconductor Device Simulator
19 % -------------------------------------------------------------------
20 % Copyright (C) 2004-2006 Carlo de Falco
24 % SECS2D is free software; you can redistribute it and/or modify
25 % it under the terms of the GNU General Public License as published by
26 % the Free Software Foundation; either version 2 of the License, or
27 % (at your option) any later version.
29 % SECS2D is distributed in the hope that it will be useful,
30 % but WITHOUT ANY WARRANTY; without even the implied warranty of
31 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 % GNU General Public License for more details.
34 % You should have received a copy of the GNU General Public License
35 % along with SECS2D; If not, see <http://www.gnu.org/licenses/>.
37 Nsteps = length(time);
44 UDXoutput2Ddata(filename,p,t,u(:,1:attr_shape),[attr_name "1"],attr_rank,attr_shape,endfile);
47 UDXappend2Ddata(filename,p,t,u(:,[1:attr_shape]+attr_shape*(it-1)),...
48 [attr_name num2str(it)],attr_rank,attr_shape,endfile);
51 fid=fopen(filename,"a");
53 fprintf (fid, "object \"%s_series\" class series\n",attr_name);
55 fprintf (fid,"member %d position %g value \"%s\"\n",it-1,time(it),[attr_name num2str(it)]);
57 fprintf (fid, "\nend\n");