DMPSUB

The DMPSUB evaluation subroutine computes the modal damping ratios for a FLEX_BODY statement (C++ or FORTRAN). DMPSUB is optional. You need it only if you want custom damping that is not the same for all modes, or if the modal damping changes with time.
 
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; Dmpsub for example. Doing this ensures that Adams Solver correctly distinguishes a C style subroutine from Fortran and calls with the appropriate interface.

Use

Corresponding Statement

Calling Sequence

SUBROUTINE DMPSUB (id, time, par, npar, freq, nmode, h, cratios)

Input Arguments

 
id
An integer variable that provides the identifier of the FLEX_BODY statement requesting information from the DMPSUB. From the identifier, Adams Solver automatically knows other information (such as the par argument) available in the corresponding statement.
time
A double-precision variable containing the current simulation time.
par
A double-precision array of constants taken, in order, from the USER parenthetical list of the FLEX_BODY 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 the DMPSUB evaluation subroutine with the number of values stored in the par array.
freq
An array of natural frequencies for the modes in cycles per user-defined time.
nmode
The total number of modes associated with the FLEX_BODY statement.
h
The current integrator step size. This is useful if you are using damping to prevent integration problems.

Output Argument

 
cratios
An array of damping ratios as a fraction of critical damping. There must be one value computed for each of the modes.

Examples

To control the modal damping of individual modes using a user-written subroutine, use CRATIO=USER according to Adams standard practice. The damping ratios for the selected modes are obtained through a call to the DMPSUB subroutine. For a model using units of seconds for time, this example illustrates:
1% critical damping for modes less than 100 Hz.
10% critical damping for modes greater or equal to 100 Hz but less than 1 kHz.
100% critical damping for modes greater than or equal to 1 kHz.
The following statement defines the constants Adams Solver is to pass to the DMPSUB evaluation subroutine:
FLEX_BODY/1, I=101, J=201
, CRATIO=USER(.01,100,.1,1000,1)
For the current example of this subroutine, see dmpsub.f

C Style - Prototype

typedef void adams_c_DMPSUB(const struct sAdamsCratio* flex, double TIME, const double* FREQS, int NMODE, double STEPSIZE, double* CRATIOS);
 
/*
* FLEX_BODY ----------------------------------------------------
*/
struct sAdamsFlexBody
{
int ID;
/* int NMAT;
const int* MATRICES;
int VM;
int WM; */
};
struct sAdamsCratio
{
struct sAdamsFlexBody FlexBody;
int NPAR;
const double* PAR;
};