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 - Evaluate Normal Force components -------------<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 />

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

RESULT(3) = ...<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_CNFSUB(const struct s<strong>Adams</strong>ContactFriction* fric,<br />

double TIME, const double* LOCI, const double* NI, const double*<br />

LOCJ, const double* NJ, double GAP, double GAPDOT, double GAPDOTDOT,<br />

double AREA, int DFLAG, int IFLAG, double* VALUES );<br />

typedef void STDCALL adams_f77_CNFSUB(const int* ID, const double*<br />

TIME, const double* PAR, const int* NPAR, const double* LOCI, const<br />

double* NI, const double* LOCJ, const double* NJ, const double* GAP,<br />

const double* GAPDOT, const double* GAPDOTDOT, const double* AREA,<br />

const int* DFLAG, const int* IFLAG, double* VALUES );<br />

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

{<br />

int ID;<br />

int nIGEOM;<br />

int nJGEOM;<br />

int* IGEOM;<br />

int* JGEOM;<br />

int* IFLIP_GEOM;<br />

int* JFLIP_GEOM;<br />

};<br />

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

{<br />

struct s<strong>Adams</strong>Contact contact;<br />

int NPAR;<br />

const double* PAR;<br />

};<br />

CONSUB<br />

The CONSUB driver subroutine can be used <strong>to</strong> control an <strong>Adams</strong> simulation from within a user<br />

subroutine. Interactively issuing the CONTROL command (C++ or FORTRAN) invokes CONSUB.<br />

Other user-written subroutines cannot call CONSUB.<br />

139

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

Saved successfully!

Ooh no, something went wrong!