Contents     Functions         Previous Next     PDF Index

ufwrite

Purpose

Write to a Universal File.

Syntax

ufwrite(FileName,UFS,i)
ufwrite(FileName,model)

Description

You can export to UFF using the feplot and iiplot export menus.
ufwrite(FileName,UFS,i) appends the dataset i from a curve stack UFS to the file FileName. For details on curve stacks see section 2.1.2. ufwrite(FileName,model) can be used to export FEM models.

For datasets representing

Starting from scratch, you define an curve stack DB=xfopt('empty'). You can then copy data sets from the stack XF (previously initialized by iiplot or xfopt) using DB(i)=XF(j). You can also build a new data set by giving its fields (see xfopt for the fields for the three supported dataset types). The following would be a typical example

 UF=xfopt('empty')
 UF(1)={'node',FEnode,'elt',FEelt};
 UF(2)={'w',IIw,'xf',IIxf};
 UF(3)={'po',IIres,'res',IIres,'dof',XFdof};

Once the curve stack built, ufwrite('NewFile',UF,1:3) will write the three datasets.

With iiplot, you can use the stack to change properties as needed then write selected datasets to a file. For example,

 tname=nas2up('tempname .uf');
 ci=iicom('CurveLoad','gartid');
 ci.Stack{'Test'}.x='frequency'; % modify properties, see xfopt('_datatype')
 ci.Stack{'Test'}.yn='accele';    
 iicom('sub');         % reinitialize plot to check
 ufwrite(tname,ci,'Test');
 % write a model
 ci.Stack{'SE','model'}=demosdt('demo gartte');
 ufwrite(tname,ci,'model');
 % write a time trace
 C1=fe_curve('TestRicker .6 2',linspace(0,1.2,120));
 C1=ufwrite('_toxf',C1); % Transform to xf format
 C1.x= xfopt('_datatype','time');
 C1.yn= xfopt('_datatype','Acceleration');
 C1.fun= xfopt('_funtype',1);
 ufwrite(tname,ci,'Ricker'); 
 UFS=ufread(tname); % reread the UFF to check result

Note that you can edit these properties graphically in the iiplot properties ... figure.

See also

ufread, iiplot, nasread


©1991-2019 by SDTools
Previous Up Next