update to new interface

This commit is contained in:
Michael Stumpf 2018-11-27 10:17:36 +01:00
parent 78c0243b8c
commit 0e1b24d0e9
11 changed files with 106 additions and 102 deletions

View File

@ -23,7 +23,8 @@ function [s] = read_scal_complete_ucf(file,varargin)
fname = sprintf('%s/%s.%05d',fdir,fbase,0);
% 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')
error('read error: no field data.');
end
@ -64,7 +65,8 @@ function [s] = read_scal_complete_ucf(file,varargin)
fname = sprintf('%s/%s.%05d',fdir,fbase,ifile);
while exist(fname,'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')
error('read error: no field data.');
end

View File

@ -11,7 +11,8 @@ function [tbeg,tend,nstat,sm,ss,su,sv] = read_statistics_channel_scal_ucf(file,v
nset = numel(sets);
% 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);
% Read parameters of first set

View File

@ -11,7 +11,8 @@ function [tbeg,tend,nstat,um,uu,vv,ww,uv,uub,uvb,varargout] = read_statistics_ch
nset = numel(sets);
% 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);
% Read first dataset

View File

@ -35,7 +35,8 @@ function [u,ibu,jbu,kbu,nxul,nyul,nzul,...
nset = numel(sets);
% 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')
error('read error: no field data.');
end

View File

@ -27,7 +27,8 @@ function [u,v,w,p] = read_uvwp_complete_ucf(file,varargin)
fname = sprintf('%s/%s.%05d',fdir,fbase,0);
% 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')
error('read error: no field data.');
end
@ -95,7 +96,8 @@ function [u,v,w,p] = read_uvwp_complete_ucf(file,varargin)
fname = sprintf('%s/%s.%05d',fdir,fbase,ifile);
while exist(fname,'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')
error('read error: no field data.');
end

View File

@ -32,9 +32,8 @@ function [] = write_particles_ucf(file,pp,col,time,varargin)
end
% Create file
obj = ucf(file,'create','verbosity',par.Results.verbosity,'debug',par.Results.debug);
obj.setFileHeader('particle','endian',par.Results.endian);
obj = ucf('verbosity',par.Results.verbosity,'debug',par.Results.debug);
obj.create(file,'type','particle','endian',par.Results.endian);
% Add particle data step by step
for it=1:nt
obj.appendStep(time(it));

View File

@ -26,8 +26,8 @@ function [] = write_scal_chunk_ucf(file,s,ib,jb,kb,nx,ny,nz,time,ighost,varargin
nscal = size(s,4);
% Create file and write to it
obj = ucf(file,'create','verbosity',par.Results.verbosity,'debug',par.Results.debug);
obj.setFileHeader('field','rank',par.Results.rank,'endian',par.Results.endian);
obj = ucf('verbosity',par.Results.verbosity,'debug',par.Results.debug);
obj.create(file,'type','field','rank',par.Results.rank,'endian',par.Results.endian);
obj.appendStep(time);
% Write scalar field by field

View File

@ -47,8 +47,8 @@ function [] = write_scal_complete_ucf(file,s,ibegp,iendp,jbegp,jendp,kbegp,kendp
ke = kendp(izproc+1);
% Create a new chunk file
obj = ucf(fname,'create','verbosity',par.Results.verbosity,'debug',par.Results.debug);
obj.setFileHeader('field','rank',[iproc,ixproc,iyproc,izproc],'endian',par.Results.endian);
obj = ucf('verbosity',par.Results.verbosity,'debug',par.Results.debug);
obj.create(fname,'type','field','rank',[iproc,ixproc,iyproc,izproc],'endian',par.Results.endian);
obj.appendStep(time);
% Write data field by field

View File

@ -33,8 +33,8 @@ function [] = write_uvwp_chunk_ucf(file,...
parse(par,varargin{:});
% Create file and write to it
obj = ucf(file,'create','verbosity',par.Results.verbosity,'debug',par.Results.debug);
obj.setFileHeader('field','rank',par.Results.rank,'endian',par.Results.endian);
obj = ucf('verbosity',par.Results.verbosity,'debug',par.Results.debug);
obj.create(file,'type','field','rank',par.Results.rank,'endian',par.Results.endian);
obj.appendStep(time);
% Write u

View File

@ -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);
% Create a new chunk file
obj = ucf(fname,'create','verbosity',par.Results.verbosity,'debug',par.Results.debug);
obj.setFileHeader('field','rank',[iproc,ixproc,iyproc,izproc],'endian',par.Results.endian);
obj = ucf('verbosity',par.Results.verbosity,'debug',par.Results.debug);
obj.create(fname,'type','field','rank',[iproc,ixproc,iyproc,izproc],'endian',par.Results.endian);
obj.appendStep(time);
ighost = 0;

View File

@ -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);
% Create output file
obj = ucf(fname,'create','verbosity',par.Results.verbosity,'debug',par.Results.debug);
obj.setFileHeader('field','rank',[iproc,ixproc,iyproc,izproc],'endian',par.Results.endian);
obj = ucf('verbosity',par.Results.verbosity,'debug',par.Results.debug);
obj.create(fname,'type','field','rank',[iproc,ixproc,iyproc,izproc],'endian',par.Results.endian);
obj.appendStep(time);
% 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.close();
clear obj
fclose all;
end
end
end