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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

C<br />

ENDIF<br />

C<br />

C - Create request information -----------<br />

C<br />

C Your algorithms<br />

C<br />

...<br />

C<br />

C Assign values <strong>to</strong> the result array<br />

C<br />

RESULT(1) = ...<br />

...<br />

RESULT(8) = ...<br />

C<br />

RETURN<br />

END<br />

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

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

typedef void adams_c_REQSUB(const struct s<strong>Adams</strong>Request* req, double<br />

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

/*<br />

* REQUEST -------------------------------------------------<br />

----------------<br />

*/<br />

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

{<br />

int ID;<br />

int NPAR;<br />

const double* PAR;<br />

const char* COMMENT;<br />

const char* TITLE[8];<br />

};<br />

Examples<br />

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

SAVSUB<br />

The SAVSUB restart subroutine allows you <strong>to</strong> s<strong>to</strong>re any information needed <strong>to</strong> later restart user-written<br />

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

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

SAVSUB and RELSUB are optional. You only need them if you want <strong>to</strong> use 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.<br />

193

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

Saved successfully!

Ooh no, something went wrong!