02.04.2013 Views

Welcome to Adams/Solver Subroutines - Kxcad.net

Welcome to Adams/Solver Subroutines - Kxcad.net

Welcome to Adams/Solver Subroutines - Kxcad.net

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Welcome</strong> <strong>to</strong> <strong>Adams</strong>/<strong>Solver</strong> <strong>Subroutines</strong><br />

C - External variable definitions ---------<br />

C INTEGER NPAR DOUBLE PRECISION<br />

PAR( * )<br />

C<br />

C PAR Array containing passed parameters<br />

C NPAR Number of passed parameters<br />

C<br />

C - Local variable definitions -----------<br />

C ...<br />

C<br />

C === Executable code ================================<br />

C<br />

C - Your commands -----------------<br />

C ...<br />

C<br />

RETURN<br />

END<br />

C Style - Pro<strong>to</strong>type<br />

typedef void adams_c_CONSUB(const struct s<strong>Adams</strong>Control* con);<br />

/*<br />

* CONTROL<br />

*/<br />

struct s<strong>Adams</strong>Control<br />

{<br />

int NPAR;<br />

const double* PAR;<br />

};<br />

Examples<br />

For an example of this subroutine, see consub.f.<br />

COUSUB, COUXX, COUXX2<br />

The COUSUB, COUXX, and COUXX2 subroutines define a user-defined COUPLER (C++ or<br />

FORTRAN):<br />

• COUSUB specifies the coupler constraint as a function of the displacements of the joints being<br />

coupled.<br />

• COUXX returns <strong>to</strong> <strong>Adams</strong>/<strong>Solver</strong> the first partial derivatives of the coupler constraint, with<br />

respect <strong>to</strong> each joint displacement.<br />

• COUXX2 returns the matrix of second partial derivatives of the coupler constraint, with respect<br />

<strong>to</strong> the joint displacements.<br />

141

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!