FIESUB

ModelingA field subroutine is used to calculate the six component forces/torques and their derivatives for a force field entity.

Use

User-defined field using forces/torques computed in a FIESUB:

<Force_Field
   id                  = "303001"
   i_marker_id         = "30301010"
   j_marker_id         = "30301020"
   body1_id            = "30101"
   body2_id            = "30301"
   usrsub_param_string = "USER(303001)"
   usrsub_dll_name     = "NULL"
 />

Format

Fortran Calling Syntax
SUBROUTINE FIESUB (ID, TIME, PAR, NPAR, DISP, VELO, DFLAG, IFLAG, FIELD, DFDDIS, DFDVEL)
C/C++ Calling Syntax
void STDCALL FIESUB (int *id, double *time, double *par, int *npar, double *disp, double *veloint, int *dflag, int *iflag, double *field, double *dfddis, double *dfdvel)
Python Calling Syntax
def FIESUB(id, time, par, npar, disp, velo, dflag, iflag):
    return [field, dfddis, dfdvel]
MATLAB Calling Syntax
function [field, dfddis, dfdvel] = FIESUB(id, time, par, npar, disp1, velo, dflag, iflag)

Attributes

ID
[integer]
The field element identifier.
TIME
[double precision]
The current simulation time.
PAR
[double precision]
An array that contains the constant arguments from the list provided in the user defined statement.
NPAR
[integer]
The number of entries in the PAR array.
DISP
[double precision]
An array of dimension 6 that contains the transitional/rotational displacements of the I marker with respect to the J marker, expressed in the coordinate system of the J marker.
VELO
[double precision]
An array of dimension 6 that contains the translational/rotational velocities of the I marker with respect to the J marker, expressed in the coordinate system of the J marker.
DFLAG
[logical]
The differencing flag.
IFLAG
[logical]
The initialization flag.

Output

FIELD
[double precision]
An array of dimension 6 that contains the computed forces/torques.
DFDDIS
[double precision]
An array of dimension 36 that contains the values of the 6x6 matrix representing the derivatives of the six force/torque components with respect to the displacement array. DFDDIS is constructed using a column-major order.
DFDVEL
[double precision]
An array of dimension 36 that contains the values of the 6x6 matrix representing the derivatives of the six force/torque components with respect to the velocity array. DFDVEL is constructed using a column-major order.

Example

def FIESUB(id, time, par, npar, disp, velo, dflag, iflag):
    dfddis=[]
    dfdvel=[]
        for i in xrange(6):
            for j in xrange(6):
                dfddis.append(0.0)
                dfdvel.append(0.0)
    dfddis[0*6+0] = -14037.  
    dfddis[1*6+1] = -1049.
    dfddis[2*6+2] = -1049.
    dfddis[3*6+3] = -2120.
    dfddis[4*6+4] = -9358.
    dfddis[5*6+5] = -9358.
        for i in xrange(6):
            for j in xrange(6):
                dfdvel[j*6+i] =0.1*dfddis[j*6+i]
    d=list(disp);
    d[0] = d[0]-5.0;
    field=[]
        for i in xrange(6):
            field.append(0.0)
            for j in xrange(6):
                field[i] = field[i]+dfddis[j*6+i]*d[j]+dfdvel[j*6+i]*velo[j]
    return [field, dfddis, dfdvel]