update to new interface
This commit is contained in:
parent
78c0243b8c
commit
0e1b24d0e9
|
|
@ -23,7 +23,8 @@ function [s] = read_scal_complete_ucf(file,varargin)
|
||||||
fname = sprintf('%s/%s.%05d',fdir,fbase,0);
|
fname = sprintf('%s/%s.%05d',fdir,fbase,0);
|
||||||
|
|
||||||
% Open first file
|
% Open first file
|
||||||
obj = ucf(fname,'read','verbosity',par.Results.verbosity,'debug',par.Results.debug);
|
obj = ucf('verbosity',par.Results.verbosity,'debug',par.Results.debug);
|
||||||
|
obj.open(fname);
|
||||||
if ~obj.validateType('field')
|
if ~obj.validateType('field')
|
||||||
error('read error: no field data.');
|
error('read error: no field data.');
|
||||||
end
|
end
|
||||||
|
|
@ -64,7 +65,8 @@ function [s] = read_scal_complete_ucf(file,varargin)
|
||||||
fname = sprintf('%s/%s.%05d',fdir,fbase,ifile);
|
fname = sprintf('%s/%s.%05d',fdir,fbase,ifile);
|
||||||
while exist(fname,'file')
|
while exist(fname,'file')
|
||||||
% Open file
|
% Open file
|
||||||
obj = ucf(fname,'read','verbosity',par.Results.verbosity,'debug',par.Results.debug);
|
obj = ucf('verbosity',par.Results.verbosity,'debug',par.Results.debug);
|
||||||
|
obj.open(fname)
|
||||||
if ~obj.validateType('field')
|
if ~obj.validateType('field')
|
||||||
error('read error: no field data.');
|
error('read error: no field data.');
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,8 @@ function [tbeg,tend,nstat,sm,ss,su,sv] = read_statistics_channel_scal_ucf(file,v
|
||||||
nset = numel(sets);
|
nset = numel(sets);
|
||||||
|
|
||||||
% Open UCF file and read
|
% Open UCF file and read
|
||||||
obj = ucf(file,'read','verbosity',par.Results.verbosity,'debug',par.Results.debug);
|
obj = ucf('verbosity',par.Results.verbosity,'debug',par.Results.debug);
|
||||||
|
obj.open(file);
|
||||||
tend = obj.getSimulationTime(1);
|
tend = obj.getSimulationTime(1);
|
||||||
|
|
||||||
% Read parameters of first set
|
% Read parameters of first set
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,8 @@ function [tbeg,tend,nstat,um,uu,vv,ww,uv,uub,uvb,varargout] = read_statistics_ch
|
||||||
nset = numel(sets);
|
nset = numel(sets);
|
||||||
|
|
||||||
% Open UCF file and read
|
% Open UCF file and read
|
||||||
obj = ucf(file,'read','verbosity',par.Results.verbosity,'debug',par.Results.debug);
|
obj = ucf('verbosity',par.Results.verbosity,'debug',par.Results.debug);
|
||||||
|
obj.open(file);
|
||||||
tend = obj.getSimulationTime(1);
|
tend = obj.getSimulationTime(1);
|
||||||
|
|
||||||
% Read first dataset
|
% Read first dataset
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,8 @@ function [u,ibu,jbu,kbu,nxul,nyul,nzul,...
|
||||||
nset = numel(sets);
|
nset = numel(sets);
|
||||||
|
|
||||||
% Open file
|
% Open file
|
||||||
obj = ucf(file,'read','verbosity',par.Results.verbosity,'debug',par.Results.debug);
|
obj = ucf('verbosity',par.Results.verbosity,'debug',par.Results.debug);
|
||||||
|
obj.open(file);
|
||||||
if ~obj.validateType('field')
|
if ~obj.validateType('field')
|
||||||
error('read error: no field data.');
|
error('read error: no field data.');
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,8 @@ function [u,v,w,p] = read_uvwp_complete_ucf(file,varargin)
|
||||||
fname = sprintf('%s/%s.%05d',fdir,fbase,0);
|
fname = sprintf('%s/%s.%05d',fdir,fbase,0);
|
||||||
|
|
||||||
% Open first file
|
% Open first file
|
||||||
obj = ucf(fname,'read','verbosity',par.Results.verbosity,'debug',par.Results.debug);
|
obj = ucf('verbosity',par.Results.verbosity,'debug',par.Results.debug);
|
||||||
|
obj.open(fname);
|
||||||
if ~obj.validateType('field')
|
if ~obj.validateType('field')
|
||||||
error('read error: no field data.');
|
error('read error: no field data.');
|
||||||
end
|
end
|
||||||
|
|
@ -95,7 +96,8 @@ function [u,v,w,p] = read_uvwp_complete_ucf(file,varargin)
|
||||||
fname = sprintf('%s/%s.%05d',fdir,fbase,ifile);
|
fname = sprintf('%s/%s.%05d',fdir,fbase,ifile);
|
||||||
while exist(fname,'file')
|
while exist(fname,'file')
|
||||||
% Open file
|
% Open file
|
||||||
obj = ucf(fname,'read','verbosity',par.Results.verbosity,'debug',par.Results.debug);
|
obj = ucf('verbosity',par.Results.verbosity,'debug',par.Results.debug);
|
||||||
|
obj.open(fname);
|
||||||
if ~obj.validateType('field')
|
if ~obj.validateType('field')
|
||||||
error('read error: no field data.');
|
error('read error: no field data.');
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -32,9 +32,8 @@ function [] = write_particles_ucf(file,pp,col,time,varargin)
|
||||||
end
|
end
|
||||||
|
|
||||||
% Create file
|
% Create file
|
||||||
obj = ucf(file,'create','verbosity',par.Results.verbosity,'debug',par.Results.debug);
|
obj = ucf('verbosity',par.Results.verbosity,'debug',par.Results.debug);
|
||||||
obj.setFileHeader('particle','endian',par.Results.endian);
|
obj.create(file,'type','particle','endian',par.Results.endian);
|
||||||
|
|
||||||
% Add particle data step by step
|
% Add particle data step by step
|
||||||
for it=1:nt
|
for it=1:nt
|
||||||
obj.appendStep(time(it));
|
obj.appendStep(time(it));
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,8 @@ function [] = write_scal_chunk_ucf(file,s,ib,jb,kb,nx,ny,nz,time,ighost,varargin
|
||||||
nscal = size(s,4);
|
nscal = size(s,4);
|
||||||
|
|
||||||
% Create file and write to it
|
% Create file and write to it
|
||||||
obj = ucf(file,'create','verbosity',par.Results.verbosity,'debug',par.Results.debug);
|
obj = ucf('verbosity',par.Results.verbosity,'debug',par.Results.debug);
|
||||||
obj.setFileHeader('field','rank',par.Results.rank,'endian',par.Results.endian);
|
obj.create(file,'type','field','rank',par.Results.rank,'endian',par.Results.endian);
|
||||||
obj.appendStep(time);
|
obj.appendStep(time);
|
||||||
|
|
||||||
% Write scalar field by field
|
% Write scalar field by field
|
||||||
|
|
|
||||||
|
|
@ -47,8 +47,8 @@ function [] = write_scal_complete_ucf(file,s,ibegp,iendp,jbegp,jendp,kbegp,kendp
|
||||||
ke = kendp(izproc+1);
|
ke = kendp(izproc+1);
|
||||||
|
|
||||||
% Create a new chunk file
|
% Create a new chunk file
|
||||||
obj = ucf(fname,'create','verbosity',par.Results.verbosity,'debug',par.Results.debug);
|
obj = ucf('verbosity',par.Results.verbosity,'debug',par.Results.debug);
|
||||||
obj.setFileHeader('field','rank',[iproc,ixproc,iyproc,izproc],'endian',par.Results.endian);
|
obj.create(fname,'type','field','rank',[iproc,ixproc,iyproc,izproc],'endian',par.Results.endian);
|
||||||
obj.appendStep(time);
|
obj.appendStep(time);
|
||||||
|
|
||||||
% Write data field by field
|
% Write data field by field
|
||||||
|
|
|
||||||
|
|
@ -33,8 +33,8 @@ function [] = write_uvwp_chunk_ucf(file,...
|
||||||
parse(par,varargin{:});
|
parse(par,varargin{:});
|
||||||
|
|
||||||
% Create file and write to it
|
% Create file and write to it
|
||||||
obj = ucf(file,'create','verbosity',par.Results.verbosity,'debug',par.Results.debug);
|
obj = ucf('verbosity',par.Results.verbosity,'debug',par.Results.debug);
|
||||||
obj.setFileHeader('field','rank',par.Results.rank,'endian',par.Results.endian);
|
obj.create(file,'type','field','rank',par.Results.rank,'endian',par.Results.endian);
|
||||||
obj.appendStep(time);
|
obj.appendStep(time);
|
||||||
|
|
||||||
% Write u
|
% Write u
|
||||||
|
|
|
||||||
|
|
@ -56,8 +56,8 @@ function [] = write_uvwp_complete_ucf(file,...
|
||||||
keu = kendu(izproc+1); kev = kendv(izproc+1); kew = kendw(izproc+1); kep = kendp(izproc+1);
|
keu = kendu(izproc+1); kev = kendv(izproc+1); kew = kendw(izproc+1); kep = kendp(izproc+1);
|
||||||
|
|
||||||
% Create a new chunk file
|
% Create a new chunk file
|
||||||
obj = ucf(fname,'create','verbosity',par.Results.verbosity,'debug',par.Results.debug);
|
obj = ucf('verbosity',par.Results.verbosity,'debug',par.Results.debug);
|
||||||
obj.setFileHeader('field','rank',[iproc,ixproc,iyproc,izproc],'endian',par.Results.endian);
|
obj.create(fname,'type','field','rank',[iproc,ixproc,iyproc,izproc],'endian',par.Results.endian);
|
||||||
obj.appendStep(time);
|
obj.appendStep(time);
|
||||||
ighost = 0;
|
ighost = 0;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -72,8 +72,8 @@ function [] = write_uvwp_newmesh_ucf(file,...
|
||||||
keu = kendu(izproc+1); kev = kendv(izproc+1); kew = kendw(izproc+1); kep = kendp(izproc+1);
|
keu = kendu(izproc+1); kev = kendv(izproc+1); kew = kendw(izproc+1); kep = kendp(izproc+1);
|
||||||
|
|
||||||
% Create output file
|
% Create output file
|
||||||
obj = ucf(fname,'create','verbosity',par.Results.verbosity,'debug',par.Results.debug);
|
obj = ucf('verbosity',par.Results.verbosity,'debug',par.Results.debug);
|
||||||
obj.setFileHeader('field','rank',[iproc,ixproc,iyproc,izproc],'endian',par.Results.endian);
|
obj.create(fname,'type','field','rank',[iproc,ixproc,iyproc,izproc],'endian',par.Results.endian);
|
||||||
obj.appendStep(time);
|
obj.appendStep(time);
|
||||||
|
|
||||||
% Interpolate to refined chunk and write
|
% Interpolate to refined chunk and write
|
||||||
|
|
@ -99,8 +99,6 @@ function [] = write_uvwp_newmesh_ucf(file,...
|
||||||
obj.appendField(tmp,0,ibp,jbp,kbp,nxp,nyp,nzp);
|
obj.appendField(tmp,0,ibp,jbp,kbp,nxp,nyp,nzp);
|
||||||
|
|
||||||
obj.close();
|
obj.close();
|
||||||
clear obj
|
|
||||||
fclose all;
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue