of_time

Contents

of_time#

Purpose

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.

lininterp#

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:

of_time('storelaststep',uva,u,v,a);

interp#

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.uva.uva and contains in each column, displacement, velocity, acceleration and possibly residual at t0 (the residual can be used for resultant computations). 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

 
    (10.23)

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

 
    (10.24)


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:

  • current instant computed is time tc=t(j1+1) using time step dt, values are t0=tc-dt and t1=tc.
  • uva is generally stored in Case.uva.
  • the current acceleration, velocity or displacement values when interpolation is performed are always a, v, and u.
  • The out data structure must be preallocated and is modified by low level C calls. Expected fields are


    defdisplacement output, must be preallocated with size length(OutInd) x length(data)
    vvelocity output, must be preallocated with size length(OutInd) x length(data)
    aacceleration output (when computed) must be preallocated with size length(OutInd) x length(data)
    datacolumn vector of output times
    OutIndint32 vector of output indices, must be given
    cur[Step dt], must be given
    FNLpossibly preallocated data structure to store non-linear loads. FNL.def must be length(model.FNL) by size(out.data,1) (or possibly size(out.FNL.data,1), in this case fieldnames must be def,DOF,data,cur)
  • non linear loads in model.FNL are never interpolated.

-1#

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
of_time(-1,r1,r2); 
% fill in start of r1 with r2 data and 
% get current position in r1
i0=of_time(-1,r1,r2);
% i0 is current pos
% fill in r1 with r2+1
% with a position offset
i0=of_time([-1 i0],r1,r2+1);

See also

fe_time