Note: | Use mixed case names for the Adams subroutine names when using the C style interface. For the default subroutine name capitalize the first letter and have the remaining letters lower case; Fiesub for example. Doing this ensures that Adams Solver correctly distinguishes a C style subroutine from Fortran and calls with the appropriate interface. |

id | An integer variable that provides the identifier of the FIELD statement requesting information from FIESUB. From the identifier, Adams Solver automatically knows other information (such as the par argument) available in the corresponding statement. |
time | A double-precision variable through which Adams Solver conveys the current simulation time. |
par | A double-precision array of constants taken, in order, from the USER parenthetical list of the FIELD statement. |
npar | An integer variable that indicates the number of constants specified in the USER parenthetical list. The primary purpose of npar is to provide FIESUB with the number of values stored in the par array. |
disp | A six-element, double-precision array that provides the x, y, and z translational displacements and the AX, AY, and AZ rotational displacements that Adams Solver measures at the I marker with respect to the J marker, resolved in the coordinate system of the J marker. For more information, see AX function (C++ or FORTRAN), AY function (C++ or FORTRAN), and AZ function (C++ or FORTRAN). |
velo | A six-element, double-precision array that provides the x, y, and z translational velocities and the x, y, and z rotational velocities that Adams Solver measures at the I marker with respect to the J marker, resolved in the coordinate system of the J marker. |
dflag | A logical variable that Adams Solver sets to true when it needs derivatives from FIESUB. FIESUB needs to evaluate dfddis and dfdvel only when the dflag argument is true. Otherwise, Adams Solver sets the dflag argument to false. |
iflag | An integer variable that Adams Solver sets to indicate why the routine is being called: ![]() When iflag is 0 Adams Solver calling to compute the value of the user-written variable. When iflag is set to 1 or 3 do any initializations that your subroutine requires. When your user-defined subroutine has static data that needs to be saved and restored to support the Adams Solver commands Save and Reload, then call the serialization functions for your data when iflag is set to 7, and the un-serialization functions when iflag is set to 9. In simple subroutines where serializing data is not needed, you can declare iflag as a logical variable. In this case you can do any initializations when Adams Solver sets iflag to true, and compute the subroutine's value when Adams Solver sets iflag to false. |
field | A six-element, double-precision array that returns the x, y, and z translational forces and the x, y, and z rotational forces that Adams Solver applies at the I marker with respect to the J marker, resolved in the coordinate system of the J marker. |
dfddis | A six-by-six, double-precision array that returns the derivatives of the six field components with respect to the six displacement values in the disp array. For example, the derivative of the fourth FIELD component (TX) with respect to the second displacement variable (y) is dfddis (4,2). You only need to define dfddis when dflag is set to true. |
dfdvel | A six-by-six, double-precision array of the derivatives of the six field components with respect to the six velocity values in the velo array. For example, the derivative of the first FIELD component (FX) with respect to the sixth velocity variable (WZ) is dfdvel(1,6). You need to define dfdvel only when dflag is set to true. |
Caution: | ■The dfddis and dfdvel arrays must always be positive semidefinite. Adams Solver does not warn you if the dfddis array, the dfdvel array, or both, are not positive semidefinite. An array A is positive semidefinite if xT A x > 0 for all x not equal to 0. ■Don't attempt to make any of the six field components dependent on system variables other than those FIESUB passes through the arguments disp, velo, and time. This rule prohibits calls to the utility subroutines SYSARY and SYSFNC. Failure to comply with this rule does not produce error messages, but greatly reduces the integration step sizes, increases the CPU time, and decreases the probability of convergence to a solution. ■If FIESUB returns the six field components without their correct derivatives, simulation times may correspondingly increase, and the probability of convergence to a solution decreases. ■If AKISPL, CUBSPL, or any of the Adams Solver utility subroutines are used, don't forget to involve the derivatives returned by these subroutines when the FIESUB derivatives are evaluated. ■Field components with continuous derivatives are desirable. Discontinuous derivatives cause a reduction of integration step size at the discontinuity, and may cause Adams Solver to fail to converge to a solution. ■When the iflag argument is not zero, Adams Solver sets the disp and velo arguments to zeros. When you execute Adams Solver, computations that divide by these values result in fatal errors. You should check for nonzero values, or ensure the iflag argument is zero, before dividing by disp or velo values. |