Contents     Functions         Previous Next     PDF Index



The of_time function is a low level function dealing with CPU and/or memory consuming steps of a time integration.

The case sensitive commands are

lininterplinear interpolation.
storelaststeppre-allocated saving of a time step in a structure with fields initially built with struct('uva',[u,v,a],'FNL',model.FNL)
interpTime scheme interpolations (low level call).
-1In place memory assignment.


The lininterp command which syntax is

out = of_time ('lininterp',table,val,last) ,

computes val containing the interpolated values given an input table which first column contains the abscissa and the following the values of each function. Due to performance requirements, the abscissa must be in ascending order. The variable last contains [i1 xi si], the starting index (beginning at 0), the first abscissa and coordinate. The following example shows the example of 2 curves to interpolate:

out=of_time('lininterp',[0 0 1;1 1 2;2 2 4],linspace(0,2,10)',zeros(1,3))

Warning : this command modifies the variable last within a given function this may modify other identical constants in the same m-file. To avoid any problems, this variable should be generated using zeros (the Matlab function) to assure its memory allocation independence.

The storelaststep command makes a deep copy of the displacement, velocity and acceleration fields (stored in each column of the variable uva.uva in the preallocated variables u, v and a following the syntax:



This command performs transient numerical scheme response interpolations. It is used by fe_time when the user gives a TimeVector in the command. In such case the output instants do not correspond to the solver computation instants, the approached output instants must thus be interpolated from the solver instants using the numerical scheme quadrature rules.

This command uses current solver instant t1 and the last instant step t0 of the solver uva. The uva matrix is stored in Case and contains in each column, displacement, velocity and acceleration at t0. The interpolation strategy that is different for each numerical scheme depends on the arguments given to of_time.

Warning : this command modifies out.def at very low level, out.def thus cannot be initialized by simple numerical values, but by a non trivial command (use zeros(1) instead of 0 for example) to ensure the unicity of this data in memory.

For a Newmark or HHT-alpha scheme, the low level call command is

of_time ('interp', out, beta,gamma,uva,a, t0,t1,model.FNL);

where beta and gamma are the coefficients of the Newmark scheme, first two values of opt.Opt.

Thus the displacement (u1) and velocity (v1) at time t1 will be computed from the displacement (u0), velocity (v0), acceleration (a0) stored in uva, the new acceleration a (a1), and the time step (h=t1−t0) as

v1 = v0 + h (1− γ) a0 + h γ a1 
u1 = u0 + h v0 + h2 (
 − β) a0 + h2 β a1

NL force (model.FNL) is linearly interpolated.

For the Theta-Method scheme, the low level command is

of_time ('interp', out, opt.Opt(1),[],uva,v, t0,t1,model.FNL);

Thus the displacement (u1) at time t1 will be computed from the displacement (u0), velocity (v0), stored in uva, the new velocity v (v1), and the time step (h=t1−t0) as

u1 = u0 + h (1−θ) v0 + h θ v1     (10.6)

For the staticnewton method, it is possible to use the same storage strategy (since it is optimized for performance), using

of_time ('interp', out, [],[], [],u, t0,t1,model.FNL);

In this case no interpolation is performed.

Please note that this low-level call uses the internal variables of fe_time at the state where is is evaluated. It is then useful to know that inside fe_time:


This command performs in place memory assignment of data. It is used to avoid memory duplication between several layers of code when computation data is stored at high level. One can thus propagate data values at low level in variables shared by several layers of code without handling output and updates at each level.

The basic syntax to fill-in preallocated variable r1 with the content of r2 is i0 = of_time(-1,r1,r2);. The output i0 is the current position in r1 after filling with r2.

It is possible to use a fill-in offset i1 to start filling r1 with r2 from index position i1 : i0 = of_time([-1 i1],r1,r2);.

To avoid errors, one must ensure that the assigned variable is larger than the variable to transmit. The following example illustrates the use of this command.

% In place memory assignment in vectors with of_time -1
r1=zeros(10,1); % sample shared variable
r2=rand(3,1); % sample data
% fill in start of r1 with r2 data
% fill in start of r1 with r2 data and 
% get current position in r1
% i0 is current pos
% fill in r1 with r2+1
% with a position offset
i0=of_time([-1 i0],r1,r2+1);

See also


©1991-2016 by SDTools
Previous Up Next