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.

188<br />

<strong>Adams</strong>/<strong>Solver</strong><br />

C - Compute and assign the motion acceleration ---<br />

C<br />

ELSE<br />

C<br />

C Your algorithm<br />

C<br />

...<br />

C<br />

C Assign a value <strong>to</strong> VALUE for the motion acceleration<br />

C<br />

VALUE = ...<br />

C<br />

ENDIF<br />

C<br />

RETURN<br />

END<br />

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

typedef void adams_c_MOTSUB(const struct s<strong>Adams</strong>Motion* motion, double<br />

TIME, int DFLAG, int IFLAG, double* RESULT);<br />

/*<br />

* MOTION<br />

*/<br />

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

{<br />

int ID;<br />

int NPAR;<br />

const double* PAR;<br />

int JOINT;<br />

const char* Type;<br />

int I;<br />

int J;<br />

char Which[2];<br />

const char* DVA;<br />

};<br />

Examples<br />

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

RELSUB<br />

The RELSUB restart subroutine allows you <strong>to</strong> reload any information needed <strong>to</strong> restart user-written<br />

subroutines. <strong>Adams</strong>/<strong>Solver</strong> calls SAVSUB during a SAVE command <strong>to</strong> write user data. RELSUB can<br />

then read the data during a RELOAD command.<br />

SAVSUB and RELSUB are optional. You only need them if you want the SAVE and RELOAD<br />

commands <strong>to</strong> save and reload user data, in addition <strong>to</strong> internal <strong>Adams</strong>/<strong>Solver</strong> data.

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

Saved successfully!

Ooh no, something went wrong!