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.

C<br />

C - Subroutine initialization -----------<br />

C<br />

...<br />

C<br />

ENDIF<br />

C<br />

C - Evaluate variable----------------<br />

C<br />

C Your algorithm<br />

C<br />

...<br />

C<br />

C Assign the returned value<br />

C<br />

VALUE = ...<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_VARSUB(const struct s<strong>Adams</strong>Variable* variable,<br />

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

/*<br />

* VARIABLE<br />

*/<br />

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

{<br />

int ID;<br />

int NPAR;<br />

const double* PAR;<br />

double IC;<br />

};<br />

Examples<br />

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

VFOSUB<br />

The VFOSUB evaluation subroutine computes force components for a VFORCE (C++ or FORTRAN).<br />

VFOSUB is optional. You only need it if you don't want <strong>to</strong> use function expressions in the VFORCE<br />

statement.<br />

Use<br />

Corresponding Statement<br />

Calling Sequence<br />

SUBROUTINE VFOSUB (id, time, par, npar,dflag, iflag, result)<br />

229

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

Saved successfully!

Ooh no, something went wrong!